librelist archives

« back to archive

Number of firmware programming attempts

Number of firmware programming attempts

From:
Drew Raines
Date:
2015-03-27 @ 14:24
I would really like to experiment a bit more with the firmware, but I'm
having quite the time getting the AVR incantation to work reliably.
Yesterday when uploading tmk I bet it took me thirty tries.  Then as I used
it I realized it has a bug that I couldn't work around and I went back to
OEM, that was at least fifty.

As I make my attempts I get a lot of different behavior.  Most of the time
it hangs on *Connecting to programmer:*, usually gets to *Programmer
supports the following devices:*, I also get *butterfly_recv(): programmer
is not responding* a lot.  At least once or twice I will get *Verify error
- unable to read lfuse properly. Programmer may not be reliable.*
Sometimes I don't notice that the USB port flipped to /dev/ttyACM1 from
/dev/ttyACM0. Then finally there's an iteration where I get to writing
flash but it fails somehow, I brick the ROM, and have to do many new
attempts with the aforementioned results.  At some point by what seems like
shear luck the flash gets written and I'm on my way.

I'm doing this on a modern desktop system with a Gigabyte Z97X mboard and
Ubuntu 14.04. I've tried multiple USB ports. I verify the A-Star is
actually in the bootloader from both syslog and the flashing LED. As far as
I can tell there's no discipline I can apply to the process that will make
it deterministic. The only consistency I've noticed is that it's
*usually* successful
after I replug the USB cable and try a few more times, like the power cycle
reset something that at least gives me a chance to be successful, but
unfortunately that isn't reliable enough to know when to do it. I also
haven't tried it on my MacBook Air, and I also haven't tried it on my
Thinkpad (NixOS), mainly because I'm in a hurry and don't want to track
down all the dependencies.

Do others have this much trouble?  Is this just life with AVR hacking?  Is
this why I dropped out of computer engineering and ended up in software?

Drew

Re: [atreus] Number of firmware programming attempts

From:
Phil Hagelberg
Date:
2015-03-28 @ 14:44
Drew Raines <aaraines@gmail.com> writes:

> I would really like to experiment a bit more with the firmware, but I'm
> having quite the time getting the AVR incantation to work reliably.
> Yesterday when uploading tmk I bet it took me thirty tries.  Then as I used
> it I realized it has a bug that I couldn't work around and I went back to
> OEM, that was at least fifty.

Wow, I'm sorry to hear you had trouble with this. That really sucks. I
have had a few times where it took two or three attempts to perform an
upload, but never anything close to this.

I looked into this and there are a few other options than avrdude; some
people suggest using dfu-programmer (which is already supported by TMK;
just run `make dfu`), and it looks like `avrp` and `avrprog` might work
too. Unfortunately I don't have an A-Star on hand right this minute to
test, but you might give it a try.

> I also haven't tried it on my MacBook Air, and I also haven't tried it
> on my Thinkpad (NixOS), mainly because I'm in a hurry and don't want
> to track down all the dependencies.

I would also give it a try on another machine just so you can try to
rule out a problem with the device itself vs the OS or USB host. I don't
think it's too difficult to get avrdude installed; you can compile the
.hex files on your primary machine and copy them over.

Hope that helps!

-Phil

Re: [atreus] Number of firmware programming attempts

From:
Aj Christensen
Date:
2015-03-27 @ 18:45
I needed to be in the uucp group to write to the serial port
yesterday. Took the TMK firmware on first try. I couldn't be fucked
setting up udev for uucp or re-logging my X session to get into the
uucp group so I just sudoed the avrdude command.

Not encountered any non-programmability as per your description. Happy
to try a few times today to see if I can repro. Even programming atmel
or silabs chips with hand made paperclip programming linkers isn't
that failure prone, IME.

cheers,

--aj

On Sat, Mar 28, 2015 at 3:24 AM, Drew Raines <aaraines@gmail.com> wrote:
> I would really like to experiment a bit more with the firmware, but I'm
> having quite the time getting the AVR incantation to work reliably.
> Yesterday when uploading tmk I bet it took me thirty tries.  Then as I used
> it I realized it has a bug that I couldn't work around and I went back to
> OEM, that was at least fifty.
>
> As I make my attempts I get a lot of different behavior.  Most of the time
> it hangs on Connecting to programmer:, usually gets to Programmer supports
> the following devices:, I also get butterfly_recv(): programmer is not
> responding a lot.  At least once or twice I will get Verify error - unable
> to read lfuse properly. Programmer may not be reliable.  Sometimes I don't
> notice that the USB port flipped to /dev/ttyACM1 from /dev/ttyACM0. Then
> finally there's an iteration where I get to writing fla sh but it fails
> somehow, I brick the ROM, and have to do many new attempts with the
> aforementioned results.  At some point by what seems like shear luck the
> flash gets written and I'm on my way.
>
> I'm doing this on a modern desktop system with a Gigabyte Z97X mboard and
> Ubuntu 14.04. I've tried multiple USB ports. I verify the A-Star is actually
> in the bootloader from both syslog and the flashing LED. As far as I can
> tell there's no discipline I can apply to the process that will make it
> deterministic. The only consistency I've noticed is that it's usually
> successful after I replug the USB cable and try a few more times, like the
> power cycle reset something that at least gives me a chance to be
> successful, but unfortunately that isn't reliable enough to know when to do
> it. I also haven't tried it on my MacBook Air, and I a lso haven't tried it
> on my Thinkpad (NixOS), mainly because I'm in a hurry and don't want to
> track down all the dependencies.
>
> Do others have this much trouble?  Is this just life with AVR hacking?  Is
> this why I dropped out of computer engineering and ended up in software?
>
> Drew
>

Re: [atreus] Number of firmware programming attempts

From:
Phil Hagelberg
Date:
2015-05-05 @ 01:18
Drew Raines <aaraines@gmail.com> writes:

> I would really like to experiment a bit more with the firmware, but I'm
> having quite the time getting the AVR incantation to work reliably.
> Yesterday when uploading tmk I bet it took me thirty tries.  Then as I used
> it I realized it has a bug that I couldn't work around and I went back to
> OEM, that was at least fifty.
>
> [...]
>
> I'm doing this on a modern desktop system with a Gigabyte Z97X mboard and
> Ubuntu 14.04.

Just as a follow-up here, I've confirmed that Ubuntu 14.04 definitely
has problems with avrdude over USB. One customer has reported that
upgrading to 15.04 fixed the issue; this link describes the same problem:

  
https://arduino.stackexchange.com/questions/1380/sketches-not-uploading-to-micro-from-ubuntu-14-04

Anyway, thought I'd mention it in case anyone else is having this same
problem. Right now it looks like upgrading is the only known fix.

-Phil

Re: [atreus] Number of firmware programming attempts

From:
Drew Raines
Date:
2015-05-05 @ 02:31
Phil Hagelberg <phil@hagelb.org> wrote:

> Just as a follow-up here, I've confirmed that Ubuntu 14.04 definitely
> has problems with avrdude over USB.


Good to know! I've since upgraded to 15.04 on the machine in question but
have not yet tried avrdude. However, I did try my MacBook Air finally and
it worked on the first or second try. Much better experience. :)

Drew