Welcome, Guest

Author Topic: AVR-T32U4 not uploading code  (Read 7391 times)

TreeGrower

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
AVR-T32U4 not uploading code
« on: December 09, 2012, 01:59:54 PM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1713
  • Karma: +43/-2
Re: AVR-T32U4 not uploading code
« Reply #1 on: December 11, 2012, 01:55:51 PM »
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

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: AVR-T32U4 not uploading code
« Reply #2 on: December 13, 2012, 02:02:59 AM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1713
  • Karma: +43/-2
Re: AVR-T32U4 not uploading code
« Reply #3 on: December 13, 2012, 04:09:45 PM »
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

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: AVR-T32U4 not uploading code
« Reply #4 on: December 15, 2012, 11:01:13 AM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1713
  • Karma: +43/-2
Re: AVR-T32U4 not uploading code
« Reply #5 on: December 15, 2012, 03:06:42 PM »
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

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: AVR-T32U4 not uploading code
« Reply #6 on: December 16, 2012, 12:10:57 AM »
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

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: AVR-T32U4 not uploading code
« Reply #7 on: December 16, 2012, 02:07:37 AM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1713
  • Karma: +43/-2
Re: AVR-T32U4 not uploading code
« Reply #8 on: December 17, 2012, 12:07:09 PM »
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

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: AVR-T32U4 not uploading code
« Reply #9 on: December 19, 2012, 06:31:31 PM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1713
  • Karma: +43/-2
Re: AVR-T32U4 not uploading code
« Reply #10 on: December 20, 2012, 08:47:26 AM »
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

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: AVR-T32U4 not uploading code
« Reply #11 on: December 20, 2012, 10:16:28 PM »
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



d4

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: AVR-T32U4 not uploading code
« Reply #12 on: December 18, 2017, 09:55:28 AM »

JohnS

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +33/-45
Re: AVR-T32U4 not uploading code
« Reply #13 on: December 18, 2017, 01:59:35 PM »
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
« Last Edit: December 18, 2017, 02:04:45 PM by JohnS »