November 07, 2024, 11:44:51 PM

AVR-T32U4 not uploading code

Started by TreeGrower, December 09, 2012, 01:59:54 PM

Previous topic - Next topic

TreeGrower

I have just purchased this board and when using arduino ide 1.0.1 or eclipse it does not finish uploading code. I have tried reset after starting code upload but no luck. Does the board need reflashing with new code ?

LubOlimex

Hey TreeGrower,

It is quite possible the board you have received to have the older bootloader which made it impossible to upload code on the board (since some identification numbers where adjusted). The issue is described on pages 8 and 9 of the user's manual in "first steps with Android" chapter: https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-32U4/resources/OLIMEXINO-32U4-Revision-B.pdf.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

TreeGrower

I've had it confirmed by olimex uk that these are pre 1.0.1 boards I have.

I've tried using arduino ide 1.0.0 and the example - blink demo with led changed to 14. The sketch uploads but the led doesn't blink ?

Any help would be greatly appreciated.

David Fisher

LubOlimex

Hey Dave,

Please try with D7 or D9 LEDs since TX and RX LEDs are used to show communication activity.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

TreeGrower

Got led blink working on D7 using 1.0.0 .many thanks.

Is there a way to update the bootloader using another Arduino as the ISP ?

I have tried and had no luck.

LubOlimex

Hey TreeGrower,

Yes, of course. The ISP of T32U4 follows the standard layout. Any board that follows the standard ISP hardware layout can program it. Make sure the other board is programmed with the proper firmware to work as ISP.

Check if the programming frequency is not very high. By the way instead of left-clicking over the link and then saving the content from a web page, left-click over the link and "click save link as...". The correct elf file is located in the software section https://www.olimex.com/Products/Duino/AVR/AVR-T32U4/.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

TreeGrower

When ever I try to update the board this is the error I get

avrdude: stk500_recv(): programmer is not responding

Do you have some instructions to follow i.e. which versions of software to use and in which order. My other board is a mega 2560.

thanks for all the help.

TreeGrower

having followed the instructions at http://zhehaomao.com/2012/07/25/programming-avr.html I get the following error. Any help greatly appreciated.


david@david-desktop:~/Downloads$ avr-objcopy -O ihex -R .eeprom avr32u4_bootlader_blink_demo_leonardo_v2_ard101.elf avr32u4_bootlader_blink_demo_leonardo_v2_ard101.hex
david@david-desktop:~/Downloads$ avrdude -p atmega32u4 -P /dev/ttyACM0 -c arduino -b 19200 -U flash:w:avr32u4_bootlader_blink_demo_leonardo_v2_ard101.hex
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9587
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "avr32u4_bootlader_blink_demo_leonardo_v2_ard101.hex"
avrdude: input file avr32u4_bootlader_blink_demo_leonardo_v2_ard101.hex auto detected as Intel Hex
avrdude: ERROR: address 0x820003 out of range at line 2050 of avr32u4_bootlader_blink_demo_leonardo_v2_ard101.hex
avrdude: write to file 'avr32u4_bootlader_blink_demo_leonardo_v2_ard101.hex' failed

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

LubOlimex

Hey,

Well it seems your avrdude does strange things... The file you have is .elf - it has everything - the program, the bootloader and the correct fuses. Avrdude first tries to program the whole .elf into the eeprom and then creates some (!) .hex which tries to store in the flash memory... Try to program with the other hex (Caterina-Leonardo.hex) the flash and set the fuses manually for the eeprom if it is possible. Refer to "Note on how to make the elf.txt" to get the idea.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

TreeGrower

I have found out to use a mega2560 as an ISP programmer you need a 10uf capacitor from reset to gnd. This has allowed me to successfully program my t32u4 using the mega2560 and arduino 1.0.3 as a leonardo. I can now use arduino 1.0.3 to program my t32u4. However I still can't manage to use avrdude on its own or from avr eclipse plugin I just get a

stk500_2_ReceiveMessage(): timeout

Is there some thing I need to do in order to make this work ?

thanks

LubOlimex

Hey TreeGrower,

It is hard to give you a proper answer since it can be anything but a good idea would be to check the Arduino forums since a lot of people are using their Arduino boards as ISP programmers. I'd suggest posting there also providing more details about the exact steps you take.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

TreeGrower

I am not talking about programming a bootloader. I have successfully done that.

Just uploading a regular program.

The arduino 1.0.3 can now do this but using avrdude from eclipse does not work with the error

stk500_2_ReceiveMessage(): timeout




JohnS

#13
Many people have reported that message.  Most are not using Olimex boards so it's some generic problem.

Without posting such as avrdude version, command line etc people have no chance to help.

It does seem some versions of avrdude are broken and of the others require exactly the right parameters as well as fuse etc values.

John