Goldilocks support

An advanced Arduino-compatible board with ATmega1284P and ATmega32u2 MCUs for experienced users. More RAM than a Mega, but in a convenient Uno-style form factor. [Product page]
User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Goldilocks support

Post by jonoxer » Thu Aug 22, 2013 12:50 am

If you backed Phillip Stevens' Pozible project for the Goldilocks (http://www.pozible.com/project/18609) your board is on its way to you now. All backers had their rewards shipped early this week: Australians may have already received them, but overseas backers will have to wait a little longer.

Goldilocks is a complex board with a huge number of new features, both in hardware and software, so at this stage we really only recommend it for experienced Arduino users. In particular it has totally new firmware in the ATmega32u2 performing the USB-serial conversion between your computer and the main ATmega1284P MCU. This new firmware is called U2Duino, and it was written by Dean Camera (author of LUFA, the basis of the USB-serial converter used by Arduino) and tuned and packaged up by Phillip Stevens for the Goldilocks. Goldilocks is the first board ever to use this new firmware so we're right on the bleeding edge here.

So if you have any issues with your Goldilocks board please post the details here, and we'll do our best to help you out.

These links may help you out if you're looking for general information / support about Goldilocks:

http://www.freetronics.com/goldilocks
http://www.freetronics.com/pages/goldil ... tart-guide
https://docs.google.com/document/d/1bCB ... edit?pli=1
--
Jon

techydude
Posts: 6
Joined: Wed Aug 21, 2013 12:45 pm

Re: Goldilocks support

Post by techydude » Sat Aug 31, 2013 3:28 pm

hi guys,
finally got a chance to play with Goldilocks today.

at first nothing happened when trying to upload a sketch - eventually i worked that out to be a borked microUSB cable (the one that came with it) - seems 3 of the 5 pins didn't survive the first insertion the other day where I checked that the pre-loaded Blink ran - they probably got crunched back into the back of the connector by the looks of their absence. Goldilocks was only getting power, no data.

a new microUSB solved that - at least now there's tx/rx activity :)

but even still, I've had only 1 successful sketch upload (Blink, with a shorter blink period), that was only after several attempts & various pressings of the 32u2 reset & retrying upload. but now, no successful uploads since then. the 32u2 appears to be resetting the 1284 & there's a bit of tx/rx activity, but it stalls & eventually times out. Avrdude verbose output:
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.5 (Mac OS X), Board: "Freetronics Goldilocks 22.1184MHz"
Binary sketch size: 1,176 bytes (of a 122,878 byte maximum)
/Applications/Arduino v1.0.5.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino v1.0.5.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1284p -cwiring -P/dev/tty.usbmodemfd121 -b38400 -D -V -Uflash:w:/var/folders/wv/tc0sg28s1fq1kdqltsmcx60w0000gn/T/build3275766764276246985.tmp/Blink_AM_Goldilocks.cpp.hex:i

avrdude: Version 5.11, compiled on Sep 2 2011 at 18:52:52
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/Applications/Arduino v1.0.5.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/anthony/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/tty.usbmodemfd121
Using Programmer : wiring
Overriding Baud Rate : 38400
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv: . [02]
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv: . [01]
avrdude: Recv: A [41]
avrdude: Recv: V [56]
avrdude: Recv: S [53]
avrdude: Recv: P [50]
avrdude: Recv: 2 [32]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv: . [01]
avrdude: Recv: . [00]
avrdude: Recv: . [0e]
avrdude: Recv: . [01]
avrdude: Recv: A [41]
avrdude: Recv: V [56]
avrdude: Recv: R [52]
avrdude: Recv: . [00]
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done. Thank you.
At first I did a 'manual' install of the Goldilocks stuff (boards.txt entries appended to the existing one, and all its associated subfolders (because I have non-standard Teensy stuff in my default 'hardware' location too), but then I RTFMd ;) & just made a 'hardware' folder in my Sketches folder (never had one before) & copied the Goldilocks-22.zip contents into it, restarted 1.0.5, selected the new "Freetronics Goldilocks 22.1184MHz" board (instead of the "Goldilocks @ 22MHz" name I gave that board profile originally) & correct usb.tty serial port, but got the same results (as posted above).

I did have a uSD card inserted for a while, but removed it, no change in symptoms.

Any suggestions?
Anthony

feilipu
Posts: 52
Joined: Fri Jul 19, 2013 6:17 am

Re: Goldilocks support

Post by feilipu » Sun Sep 01, 2013 12:58 pm

Anthony,

how often have I seen the avrdude printout you just provided?
I can answer, quite a lot.

First, if you're using linux there is an enumeration problem between LUFA and linux. Just resetting the 32u2 doesn't achieve re-enumeration. You actually need to power cycle the interface. This doesn't seem to affect WinXP from what hiunino is reporting on another thread.

If the USB interface is not re-enumerated properly and you're using a serial console baud rate
that is not the same as the bootloader baud rate (38,400) this also causes bad karma as the LUFA code has then to readjust to the rate required by avrdude and therefore the 1284p is also not receiving the characters at the rate it expects.

If you have an oscilloscope, this is all easy to see. But if you don't it is just annoying and fickle.

So, how to fix this issue?

Firstly choose the serial rates with the lowest divergence from correctness. You've got a 22.1184MHz Goldilocks which is perfect, so it is only the 32u2 at 16MHZ that is causing problems. I've selected the best fast rate already, 38,400 baud, so there is nothing to do.

Secondly, if it won't program correctly, then power cycle the Goldilocks board by removing the USB connector. Check with

Code: Select all

dmesg | tail
that the Goldilocks re-enumerated correctly. Sometimes it will appear on /dev/ttyACM1 depending on how linux is feeling on the day.

Thirdly, set the serial monitor (in your sketches) on the same baud rate as the bootloader, so that the 32u2 doesn't have to change baud rate on the fly. This is the errata issue I was referring to in the manual, where if the serial monitor is on then the bootloader doesn't work correctly.

Fourth, just to check that the board is behaving correctly (remember that these boards were hand tested and there may be a hardware issue that slipped through the manual process) try to use the bootloader monitor. Connect a serial terminal to /dev/ttyACM0 at 38,400 baud, and type !!! within one second of pushing the 1284p RESET button. You should be able to enter the commands, and see what you've programmed into flash, etc. You should see this:
https://www.youtube.com/watch?v=sjqORbiJQh0

Fifth, ping back your results, please.

P.

techydude
Posts: 6
Joined: Wed Aug 21, 2013 12:45 pm

Re: Goldilocks support

Post by techydude » Wed Sep 04, 2013 2:28 pm

thanks for your reply, Philip,

all Mac here. tho i've got Win7 in a VM if necessary, but that makes me break out in spots.

i broke out my 2nd Goldilocks, & am getting identical results, so 99% this is environmental :-(

so i rebooted & repeated tests. no change.

before & after plugging in Goldilocks, the only additional devices (ls /dev) I get are these two:
cu.usbmodemfd121
tty.usbmodemfd121
...the latter being what I set the Arduino IDE to use.

Arduino serial-mon is set to 38k4, always has been while playing with Goldilocks. I noticed the 38k4 setting in the Goldilocks board definition file, contrary to the stock Arduino boards using 115k2. pondered why for a while, then recalled fond memories of calculating baud rate inaccuracies caused by standard integer-multiple MHz crystals I did back in the early 90s ;)

latest avrdude output:
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.5 (Mac OS X), Board: "Freetronics Goldilocks 22.1184MHz"
Binary sketch size: 1,176 bytes (of a 122,878 byte maximum)
/Applications/Arduino v1.0.5.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino v1.0.5.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1284p -cwiring -P/dev/tty.usbmodemfd121 -b38400 -D -V -Uflash:w:/var/folders/wv/tc0sg28s1fq1kdqltsmcx60w0000gn/T/build8412166227017793008.tmp/Blink_AM_Goldilocks.cpp.hex:i

avrdude: Version 5.11, compiled on Sep 2 2011 at 18:52:52
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/Applications/Arduino v1.0.5.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/anthony/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/tty.usbmodemfd121
Using Programmer : wiring
Overriding Baud Rate : 38400
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done. Thank you.
You refer to /dev/ttyACM0 & /dev/ttyACM1 - what's the difference? Trying to work out where I view the 1284's bootloader output per the youtube vid you linked...

I've had virtually zero issues programming Arduino Uno, Mega2560, & Teensy2.0 boards with this stock Arduino v1.0.5 installation. (I don't say that to point fingers, just to give background/history).

I have a very crusty old Tek CRO left over from the last ice age (hoping to spring for a Rigol 2xxx soon) - what should I be looking for?

Also, kinda related but unrelated, I'm looking to blow this Arduino IDE & toolchain. Where the hell do I start? ;) I assume many others have trodden this path & documented it, but can you point me to any specific examples, preferably Mac oriented?

Anthony.

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Re: Goldilocks support

Post by jonoxer » Thu Sep 05, 2013 12:50 am

I'm sorry to hear you're having issues with it, Anthony.

Phillip's reference to /dev/ttyACM0 for connecting to the bootloader is just the different way the Linux kernel refers to USB serial devices compared to the MacOS X kernel. Just follow his instructions but use "/dev/tty.usbmodemfd121" (in your case) in place of /dev/ttyACM0. I'm really interested to know if you can connect to the serial monitor successfully.

If you want to bypass the Arduino toolchain (which Phillip himself hardly uses) there are a couple of paths you can take. It's a big subject best discussed in a different thread I think, and I don't have a lot of expertise myself, but in terms of how you do the upload to the board you can either continue working with a bootloader and using avrdude or similar to do the upload independently of the Arduino IDE, or you can use an ICSP programmer to install straight into the MCU without any bootloader required. Phillip normally uses the second method I think. We've just released an ICSP programmer specifically for that purpose (http://www.freetronics.com/usbasp) which we also use internally for installing the bootloader on all our boards before they ship.
--
Jon

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Re: Goldilocks support

Post by jonoxer » Thu Sep 05, 2013 12:54 am

Oh, and I forgot to mention, I'm sorry you ended up with a dud USB cable. Unfortunately that's one thing we don't explicitly test: all the boards themselves are tested when the bootloaders are installed, but the USB cables come from a cable supplier and we don't unwrap them before packaging.

If you like I can put a replacement USB cable in the mail to you.
--
Jon

techydude
Posts: 6
Joined: Wed Aug 21, 2013 12:45 pm

Re: Goldilocks support

Post by techydude » Thu Sep 05, 2013 3:00 am

hey Jon, thanks.
jonoxer wrote: Phillip's reference to /dev/ttyACM0 for connecting to the bootloader is just the different way the Linux kernel refers to USB serial devices compared to the MacOS X kernel. Just follow his instructions but use "/dev/tty.usbmodemfd121" (in your case) in place of /dev/ttyACM0. I'm really interested to know if you can connect to the serial monitor successfully.
Sure, but Philip's reply also mentioned /dev/ttyACM1, as well as /dev/ttyACM0...? Wondering if there's a difference, or some randomness to the Linux enumeration process? Or is this the same diff as my cu.usbmodemfd121 & tty.usbmodemfd121 devices? i know what the tty. is, but what's the cu. ? Is tty. the serial-mon, & cu. the device-programming interface?

So was Philip simply asking me to connect to the traditional Arduino serial-mon, @ 38k4, & type !!! ? I tried that a few times within a second of resetting the 1284p (or should it have been the 32u2 reset?), but no reply from it. But that was last thing last night, so I'll try again later.

The whole boot-loader setup of dual-AVR Arduino boards is still quite unclear to me... I think I understand the 32u2 is doing "USB-to-serial" & "USB-to-SPI for programming the main host", right? If so, then I'm just not sure about the time-sequence of when the main AVR (1284p on a Goldilocks) becomes available on the serial-mon (ie. through the 32u2)...
jonoxer wrote: If you want to bypass the Arduino toolchain (which Phillip himself hardly uses) there are a couple of paths you can take. It's a big subject best discussed in a different thread I think, and I don't have a lot of expertise myself, but in terms of how you do the upload to the board you can either continue working with a bootloader and using avrdude or similar to do the upload independently of the Arduino IDE, or you can use an ICSP programmer to install straight into the MCU without any bootloader required. Phillip normally uses the second method I think. We've just released an ICSP programmer specifically for that purpose (http://www.freetronics.com/usbasp) which we also use internally for installing the bootloader on all our boards before they ship.
ack. perhaps i'll start a new thread on that once i've done a little more googling...

I do have a 'USBtinyISP' from Adafruit, but that, for reasons I haven't looked into yet, doesn't support >64k-Flash AVRs.
And I have a BusPirate v3...
Both are also quite recent arrivals & not had much time to play with them yet :-(

BTW, I'm not stressed about this, not 'anxious' for a fix - the process of working through it is proving to be 'instructive' :). & don't worry about the dud USB cable, I know stuff happens.

A

feilipu
Posts: 52
Joined: Fri Jul 19, 2013 6:17 am

Re: Goldilocks support

Post by feilipu » Sat Sep 07, 2013 5:21 am

Anthony,

with the two different /ttyACM0 and /ttyACM1 I was referring to Linux randomness. Sometimes if you power cycle quickly the PC doesn't have enough time to delete the first reference so it creates a new one, before it destroys the old one. That's caught me sometimes, so I always check using dmesg before I get angry about wasting my time.

A key milestone is to be able to connect to the bootloader monitor. If you can achieve this, then you're actually talking to the 1284p. You need to have a serial terminal (I like Cutecom) attached to the right USB port at the 38k4 rate, and enter !!! with a return within 1 second of resetting the 1284p. You should see a whole bunch of !!!!!!!! coming at you, then the prompt like in the video above.

The 32u2 is just performing a conversion from USB to serial for the 1284p. The one other function is to pull the 1284p RESET down at the right time, initiated by a DTR command from the PC, to enter the bootloader. The DTR (RESET) toggle is the one thing that differentiates stk500v2 from wiring protocol for avrdude.

The next test is to use avrdude without the arduino IDE, just from the command line. Try to use the avrdude command WITHOUT any .hex file and with a -c wiring -D (don't erase first), with the right port for you, and it should just make a connection, say it is ready, then terminate. This tests the proper connection.

Code: Select all

avrdude -p m1284p -b 38400 -P /dev/ttyACM0 -c wiring -D -v -v

Code: Select all

phillip:~/arduino_goldilocks_20130818/production_firmware$ avrdude -p m1284p -b 38400 -P /dev/ttyACM0 -c wiring -D -v -v

avrdude: Version 5.11.1, compiled on Mar 24 2013 at 00:54:55
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/phillip/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : wiring
         Overriding Baud Rate          : 38400
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
         AVR Part                      : ATMEGA1284P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
           flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : Wiring
         Description     : Wiring
         Programmer Model: AVRISP
         Hardware Version: 15
         Firmware Version Master : 2.10
         Vtarget         : 0.0 V
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9705
avrdude: safemode: lfuse reads as D7
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as D7

avrdude: safemode: lfuse reads as D7
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as D7
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

The stk500v2 (called wiring with the DTR signal for RESET) protocol is much more robust than the avr109 (called arduino with DTR) so you actually get proper communication and responses happening before and during flashing so you should see successful information about the 1284p chip being printed if all is working well.

To the point of using a normal tool chain without the arduino goodness (tongue in cheek), all you need are the packages for avr-gcc and avr-libc to get started. It is good to have the latest avr-gcc 4.7.2 and avr-libc 1.8.0 as always issues get fixed along the way. Arduino seems to stay too long on older stuff and work around the bugs, rather than just moving on, in my opinion.

You can then just compile C code stuff off flat files and command line, which I did for some time to learn what was going on. Now I use the Eclipse IDE with the CDT tools and the AVR-CDT extensions. This is a great environment. It has hover expansion so you can see the definition of functions without digging through file systems, and macro live expansion. Its all a bit daunting at the start (coming from a command line world) but after a while its irreplaceable and just excellent.

I've got some posts on http://feilipu.me/2011/09/22/freertos-a ... vr-atmega/ relating to how to go down this path, so I won't rant on too much here.

Phillip.

techydude
Posts: 6
Joined: Wed Aug 21, 2013 12:45 pm

Re: Goldilocks support

Post by techydude » Sun Sep 08, 2013 12:49 pm

thanks Phillip,

i discovered Homebrew, "the missing OS X package manager", and with that was able to get avrdude 5.11.1 without breaking a sweat (i have no experience compiling my own apps/utils on desktop OS systems).

then with that, i've had "intermittent success" getting the bootloader to respond to !!!<cr>, and once at that stage similarly intermittent success getting avrdude to do its thing as per the cmdline you gave me:

Code: Select all

airgeek:~ anthony$ avrdude -p m1284p -b 38400 -P /dev/tty.usbmodemfd121 -c wiring -D -v -v

avrdude: Version 5.11.1, compiled on Sep  7 2013 at 23:13:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/local/Cellar/avrdude/5.11.1/etc/avrdude.conf"
         User configuration file is "/Users/anthony/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbmodemfd121
         Using Programmer              : wiring
         Overriding Baud Rate          : 38400
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
         AVR Part                      : ATMEGA1284P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
           flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : Wiring
         Description     : Wiring
         Programmer Model: AVRISP
         Hardware Version: 15
         Firmware Version Master : 2.10
         Vtarget         : 0.0 V
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9705
avrdude: safemode: lfuse reads as D7
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as D7

avrdude: safemode: lfuse reads as D7
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as D7
avrdude: safemode: Fuses OK

avrdude done.  Thank you.
The only difference I see to yours is the 'Chip Erase Delay' value - mine's 9000us, yours is 55000us. What is this?

But it's very difficult to get this far. So often it just doesn't see the !!!<cr>. After releasing 1284p reset button, sometimes it's already running the default blink sketch before I can finish typing & look back to Goldilocks, other times Blink isn't running, and it just appears to be listening to serial (the RX led blinks with each keypress) but not responding. If I stop typing long enough, it times out & runs the sketch. A complete unplug/replug/re-enumeration & reconnection of the serial terminal doesn't guarantee it'll respond, but if I've connected once, it can be difficult to get it to respond again without another power-cycle. Most of the time, even if I get a response from the bootloader, I just get this:

Code: Select all

airgeek:~ anthony$ avrdude -p m1284p -b 38400 -P /dev/tty.usbmodemfd121 -c wiring -D -v -v

avrdude: Version 5.11.1, compiled on Sep  7 2013 at 23:13:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/local/Cellar/avrdude/5.11.1/etc/avrdude.conf"
         User configuration file is "/Users/anthony/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbmodemfd121
         Using Programmer              : wiring
         Overriding Baud Rate          : 38400
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done.  Thank you.
I haven't seen any sign of corrupted serial comms.
This happens on both my Goldilocks.

I'm working on the assumption that my experience thus far is fairly unique, so tomorrow I'll try to get everything installed on a different computer & see if that makes any difference.

Anthony.

feilipu
Posts: 52
Joined: Fri Jul 19, 2013 6:17 am

Re: Goldilocks support

Post by feilipu » Sun Sep 08, 2013 3:05 pm

Anthony,

ok. Looks like there might be some kind of time out issue, related to Mac in particular or your set up. The bootloader initialise timing IS tight. There is plenty of time for a machine to hit the bootloader following the DTR (RESET) pulse, but for a human it is tight. In the normal case this is ok, but it can make for annoying testing.

You shouldn't need to power cycle. That is just time consuming. Resetting the 32u2 won't achieve anything. I use a terminal that has history, so use the up arrow or similar to get the !!! ready, then the right technique is to hold thumb on 1284p reset and finger on Enter with that !!! already typed. That should get the best success.

The "Chip Erase delay" that you caught is referred to in my blog, along with how to fix it in Step 3.
http://feilipu.me/2011/09/22/freertos-a ... vr-atmega/
I'm pretty sure it is not the cause of your issue though, as we've not gotten that far yet.

Also, I'm not even sure that the "Chip Erase delay" issue on 1284p is even an issue. I sometimes just do things I find on the Internet, and then never go back to check the counter-factual.

Let's keep at it. Might be an underlying issue that you're exposing.

Also, have a look at the USBtinyISP that you bought. Personally, I find serial bootloaders painful. Even the AVRISP mk2 factory item from ATMEL is relatively cheap.
http://store.atmel.com/PartDetail.aspx?q=p:10500054
And as Jon said, Freetronics an AVRISP now too.
http://www.freetronics.com/collections/ ... vr-arduino

The USBtinyISP will be OK with the 1284p. The 64k limit referred to is for WORDS of flash, which is 128kB. Beyond this there is a 3 byte program counter issue that is only relevant with the 2560 in the Arduino Mega.

I'll be going back to have a look at Dean Camera's LUFA AVRISP code shortly (could be some months) http://www.fourwalledcubicle.com/AVRISP.php to get it integrated with his LUFA USB-Serial code, and then put the result on the 32u2. This will be the perfect answer (unless you have another cunning plan for the 32u2) for the Goldilocks.

Phillip

Post Reply