Skip to content

Problem flashing Riot to Arduino UNO/Mega2560 boards #6535

@yijiazi

Description

@yijiazi

Hi,

I'm trying to flash Riot to Arduino boards -- however, I need very good luck to flash the Riot OS to the UNO board, because most of the time, I got error messages like (it might stop at any point):

(I'm using the Ubuntu VM downloaded from vagrant https://github.com/RIOT-OS/RIOT/tree/master/dist/tools/vagrant running on a Mac OS host.)

avrdude -p atmega328p -c arduino -P /dev/ttyACM0 -b 115200 -F -D -U flash:w:bin/arduino-uno/Task01.hex

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "bin/arduino-uno/Task01.hex"
avrdude: input file bin/arduino-uno/Task01.hex auto detected as Intel Hex
avrdude: writing flash (5676 bytes):

Writing | ############################### | 62% 0.69s
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x00
Writing | ################################ | 64% 1.84savrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync

If I was in luck (after 20~ retries), I will be able to see:

avrdude -p atmega328p -c arduino -P /dev/ttyACM0 -b 115200 -F -D -U flash:w:bin/arduino-uno/Task01.hex

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "bin/arduino-uno/Task01.hex"
avrdude: input file bin/arduino-uno/Task01.hex auto detected as Intel Hex
avrdude: writing flash (5676 bytes):

Writing | ################################################## | 100% 1.11s

avrdude: 5676 bytes of flash written
avrdude: verifying flash memory against bin/arduino-uno/Task01.hex:
avrdude: load data flash data from input file bin/arduino-uno/Task01.hex:
avrdude: input file bin/arduino-uno/Task01.hex auto detected as Intel Hex
avrdude: input file bin/arduino-uno/Task01.hex contains 5676 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.92s

avrdude: verifying ...
avrdude: 5676 bytes of flash verified

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done. Thank you.

I tried different kinds of Arduino UNO R3 boards, including the original Arduino version, but still hard to get the Riot OS uploaded.
It seems to be problem related to avrdude -- but without knowing detail of it, I have no idea what's wrong.

When I try with Arduino Mega2560, I will also get error message like:

/home/vagrant/Tutorials/task-01/bin/arduino-mega2560/Task01.elf
avrdude -p m2560 -c stk500v2 -P /dev/ttyACM0 -b 115200 -F -D -U flash:w:bin/arduino-mega2560/Task01.hex

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: reading input file "bin/arduino-mega2560/Task01.hex"
avrdude: input file bin/arduino-mega2560/Task01.hex auto detected as Intel Hex
avrdude: writing flash (6230 bytes):

Writing | ###################### | 44% 0.48savrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
^C/home/vagrant/RIOT/Makefile.include:330: recipe for target 'flash' failed
make: *** [flash] Interrupt

Any idea what's wrong?

thanks in advance

Metadata

Metadata

Assignees

Labels

Platform: AVRPlatform: This PR/issue effects AVR-based platformsType: questionThe issue poses a question regarding usage of RIOT

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions