librelist archives

« back to archive

Firmware on Windows

Firmware on Windows

From:
Joe Fruchey
Date:
2015-10-09 @ 03:02
I'm struggling to figure out how to upload new firmware on Windows 10.
Partly because I'm worried about messing up and having to hard reset, it's
probably not that big of a deal, but still.

I recently purchased an assembled unit from /r/mechmarket which has a
reversed PCB. I've downloaded the driver, reset the board, and determined
that I'm on COM3. I've installed WinAVR, but I'm not terribly sure what to
do now. I ran "make upload" and got "No rule to make target 'upload'". I'm
assuming I have to specify a file, and the port. Is it just "USB=COM3"?

My goal is to end up with hardware Dvorak. I downloaded a zip of the github
repo, cd'd there and ran "make jsonlayout LAYOUT=dvorak" but again, "No
rule to make target 'jsonlayout'"

What am I doing wrong?

Re: [atreus] Firmware on Windows

From:
Phil Hagelberg
Date:
2015-10-09 @ 03:51
Joe Fruchey <joe@fruchey.net> writes:

> I recently purchased an assembled unit from /r/mechmarket which has a
> reversed PCB. I've downloaded the driver, reset the board, and
> determined that I'm on COM3. I've installed WinAVR, but I'm not
> terribly sure what to do now. I ran "make upload" and got "No rule to
> make target 'upload'". I'm assuming I have to specify a file, and the
> port. Is it just "USB=COM3"?

I believe this is the correct way to specify USB on Windows, but if
you're having trouble with the upload specifically you can try using
AVRDUDESS (a gui wrapper) as listed here:

  https://github.com/technomancy/atreus-firmware#windows

However, this requires a compiled .hex file. If you are getting "No rule
to make target" then it sounds like you aren't running the command from
a working copy of the source.

> My goal is to end up with hardware Dvorak. I downloaded a zip of the
> github repo, cd'd there and ran "make jsonlayout LAYOUT=dvorak" but
> again, "No rule to make target 'jsonlayout'"

I'm thinking of deprecating the JSON layouts as they're a bit of a rube
goldberg machine and don't really buy you all that much over the .h
layouts. I've just checked in a `hardwaredvorak.h` file so you can use
that without invoking the "jsonlayout" make target. You should be able
to do `make upload SWAPCOLUMNS=yes USB=COM3 LAYOUT=hardwaredvorak`.

Can you just confirm that you're running from the directory that has
`atreus.c` and the proper `Makefile` in it? If you're having trouble
with the compilation I can upload a reversed hardwaredvorak .hex file,
but I think it would be preferable if you could get it compiling
yourself so you can make further changes in the future.

-Phil

Re: [atreus] Firmware on Windows

From:
Joe Fruchey
Date:
2015-10-09 @ 12:27
Thanks! I went ahead and tried running the make jsonlayout, but it requires
emacs, so no dice on Windows. But you're right, the raw .h file is very
straightforward.

Turns out, stupid me, I wasn't in the dir with atreus.c. I extracted the
zip and CD'd there, not realizing there was one more dir level.

I copied your hardwaredvorak.h to layout.h and tried the "make upload", but
no luck. I wasn't sure whether I was supposed to do this while the keyboard
was sitting idle, or immediately after a reset, so I tried normally first,
then reset and tried again. Since the reset way threw an error right away,
I'm assuming that was wrong.

>copy hardwaredvorak.h layout.h
        1 file(s) copied.

>make upload SWAPCOLUMNS=yes USB=COM3
avr-gcc -std=gnu99 -DSWAPCOLUMNS=yes -Os -D F_CPU=16000000UL
-mmcu=atmega32u4 -c -o atreus.o atreus.c
avr-gcc -std=gnu99 -DSWAPCOLUMNS=yes -Os -D F_CPU=16000000UL
-mmcu=atmega32u4 -c -o usb_keyboard.o usb_keyboard.c
avr-gcc -mmcu=atmega32u4 usb_keyboard.o atreus.o -o atreus
avr-size atreus
   text    data     bss     dec     hex filename
   3332     346     199    3877     f25 atreus
avr-objcopy -O ihex -R .eeprom atreus atreus.hex
while [ ! -r COM3 ]; do sleep 1; done; \
        avrdude -p atmega32u4 -c avr109 -U flash:w:atreus.hex -P COM3
      0 [main] sh 10832 sync_with_child: child 2844(0x1AC) died before
initialization with status code 0xC0000142
    721 [main] sh 10832 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
make: *** [upload] Error 128

*This next attempt is after hitting Reset and waiting for Device Manager to
refresh*

>make upload SWAPCOLUMNS=yes USB=COM3
while [ ! -r COM3 ]; do sleep 1; done; \
        avrdude -p atmega32u4 -c avr109 -U flash:w:atreus.hex -P COM3
      0 [main] sh 12540 sync_with_child: child 11260(0x1B4) died before
initialization with status code 0xC0000142
    783 [main] sh 12540 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
make: *** [upload] Error 128


On Thu, Oct 8, 2015 at 10:51 PM, Phil Hagelberg <phil@hagelb.org> wrote:

> Joe Fruchey <joe@fruchey.net> writes:
>
> > I recently purchased an assembled unit from /r/mechmarket which has a
> > reversed PCB. I've downloaded the driver, reset the board, and
> > determined that I'm on COM3. I've installed WinAVR, but I'm not
> > terribly sure what to do now. I ran "make upload" and got "No rule to
> > make target 'upload'". I'm assuming I have to specify a file, and the
> > port. Is it just "USB=COM3"?
>
> I believe this is the correct way to specify USB on Windows, but if
> you're having trouble with the upload specifically you can try using
> AVRDUDESS (a gui wrapper) as listed here:
>
>   https://github.com/technomancy/atreus-firmware#windows
>
> However, this requires a compiled .hex file. If you are getting "No rule
> to make target" then it sounds like you aren't running the command from
> a working copy of the source.
>
> > My goal is to end up with hardware Dvorak. I downloaded a zip of the
> > github repo, cd'd there and ran "make jsonlayout LAYOUT=dvorak" but
> > again, "No rule to make target 'jsonlayout'"
>
> I'm thinking of deprecating the JSON layouts as they're a bit of a rube
> goldberg machine and don't really buy you all that much over the .h
> layouts. I've just checked in a `hardwaredvorak.h` file so you can use
> that without invoking the "jsonlayout" make target. You should be able
> to do `make upload SWAPCOLUMNS=yes USB=COM3 LAYOUT=hardwaredvorak`.
>
> Can you just confirm that you're running from the directory that has
> `atreus.c` and the proper `Makefile` in it? If you're having trouble
> with the compilation I can upload a reversed hardwaredvorak .hex file,
> but I think it would be preferable if you could get it compiling
> yourself so you can make further changes in the future.
>
> -Phil
>

Re: [atreus] Firmware on Windows

From:
Phil Hagelberg
Date:
2015-10-10 @ 02:22
Joe Fruchey <joe@fruchey.net> writes:

> I copied your hardwaredvorak.h to layout.h and tried the "make
> upload", but no luck. I wasn't sure whether I was supposed to do this
> while the keyboard was sitting idle, or immediately after a reset, so
> I tried normally first, then reset and tried again. Since the reset
> way threw an error right away, I'm assuming that was wrong.

The board needs to be in "bootloader mode" for the upload to complete;
this happens for eight seconds after the reset is initiated. Sometimes
it takes a few tries for it to succeed on certain machines.

If you're still having trouble, you can remove the back panel--the LED
inside will gently pulse while it's in bootloader mode, so that's one
way you can tell whether it's in the right state while you do the upload.

-Phil

Re: [atreus] Firmware on Windows

From:
Joe Fruchey
Date:
2015-10-10 @ 15:54
I took the case off... Unfortunately, since the PCB is assembled backwards,
the LED is difficult to see, but I was able to reset the board, see the
pulsing LED, and reattempt the upload, but I'm still getting the same
"waiting for longjump" error. Perhaps "USB=COM3" isn't the right option?

Windows has like 80% market share, are there no Windows users on this list
that can weigh in?

I could try avrdudess, but ultimately I want to create my own custom
layout, which is not possible using that method.

On Fri, Oct 9, 2015 at 9:22 PM, Phil Hagelberg <phil@hagelb.org> wrote:

> Joe Fruchey <joe@fruchey.net> writes:
>
> > I copied your hardwaredvorak.h to layout.h and tried the "make
> > upload", but no luck. I wasn't sure whether I was supposed to do this
> > while the keyboard was sitting idle, or immediately after a reset, so
> > I tried normally first, then reset and tried again. Since the reset
> > way threw an error right away, I'm assuming that was wrong.
>
> The board needs to be in "bootloader mode" for the upload to complete;
> this happens for eight seconds after the reset is initiated. Sometimes
> it takes a few tries for it to succeed on certain machines.
>
> If you're still having trouble, you can remove the back panel--the LED
> inside will gently pulse while it's in bootloader mode, so that's one
> way you can tell whether it's in the right state while you do the upload.
>
> -Phil
>

Re: [atreus] Firmware on Windows

From:
Phil Hagelberg
Date:
2015-10-11 @ 01:47
Joe Fruchey <joe@fruchey.net> writes:

> I could try avrdudess, but ultimately I want to create my own custom
> layout, which is not possible using that method.

This isn't quite accurate--the advantage of avrdudess is that you *can*
use it without installing the full compiler toolchain, but if the
compiler is already installed then you have everything you need to build
new layouts. You can just grab the .hex file from the compilation
process and point avrdudess at that.

-Phil

Re: [atreus] Firmware on Windows

From:
Joe Fruchey
Date:
2015-10-12 @ 14:32
Ah! Thanks for the heads up. How do I generate a .hex file from a custom
layout with make?

On Sat, Oct 10, 2015 at 8:47 PM, Phil Hagelberg <phil@hagelb.org> wrote:

> Joe Fruchey <joe@fruchey.net> writes:
>
> > I could try avrdudess, but ultimately I want to create my own custom
> > layout, which is not possible using that method.
>
> This isn't quite accurate--the advantage of avrdudess is that you *can*
> use it without installing the full compiler toolchain, but if the
> compiler is already installed then you have everything you need to build
> new layouts. You can just grab the .hex file from the compilation
> process and point avrdudess at that.
>
> -Phil
>

Re: [atreus] Firmware on Windows

From:
Phil Hagelberg
Date:
2015-10-13 @ 04:46
Joe Fruchey <joe@fruchey.net> writes:

> Ah! Thanks for the heads up. How do I generate a .hex file from a
> custom layout with make?

Just running `make` with whatever arguments you like (layout, etc) will 
generate the .hex file.

-Phil

Re: [atreus] Firmware on Windows

From:
Joe Fruchey
Date:
2015-10-14 @ 20:56
Got it, typing this response on my new firmware. But, ah, just discovered
that this firmware is using home row for numbers instead of the numpad
layout. Now it's time to get my hands dirty!

On Mon, Oct 12, 2015 at 11:46 PM, Phil Hagelberg <phil@hagelb.org> wrote:

> Joe Fruchey <joe@fruchey.net> writes:
>
> > Ah! Thanks for the heads up. How do I generate a .hex file from a
> > custom layout with make?
>
> Just running `make` with whatever arguments you like (layout, etc) will
> generate the .hex file.
>
> -Phil
>

Re: [atreus] Firmware on Windows

From:
Phil Hagelberg
Date:
2015-10-15 @ 01:05
Joe Fruchey <joe@fruchey.net> writes:

> Got it, typing this response on my new firmware. But, ah, just
> discovered that this firmware is using home row for numbers instead of
> the numpad layout. Now it's time to get my hands dirty!

Wow, you're right--I hadn't realized the hardwaredvorak layout was so
old. Happy to take a patch for this to bring it back in line with the
standard layout.

-Phil