-1

I want to upload hex file from Raspberry Pi to Arduino connected via USB. I am using avrdude but I fail.

pi@raspberrypi:~/test $ ls
beeop  led_test.ino.hex

As it can be seen I have this led_test.ino.hex file in the folder. The command I use next is

pi@raspberrypi:~/test $ avrdude -v -p atmega328p -c arduino -P /dev/ttyACM0 -b 57600 -D -U flash:w:/home/pi/avrdude/led_test.ino.hex:i

And the result I get is

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

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

         Using Port                    : /dev/ttyACM0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x29
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xec
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x0c
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x0c
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xc8
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x0a
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xec
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xa5
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x4c
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xff

avrdude done.  Thank you.


I have read having no user configuration is not the isssue.

But how shall I resolve the error shown above. Thanking you

2
  • 1
    are you sure you have a bootloader on that arduino? Commented Feb 5, 2022 at 19:14
  • What Pi? What OS? What Arduino? Have you installed the Arduino app? Commented Feb 5, 2022 at 21:50

1 Answer 1

0

I am sorry for late response, pi is raspberry pi, arduino is arduino uno (Atmega328P) and my operating system on raspberry pi is raspbian.

To solve the issue just increase the baudrate from 57600 to 115200 and your binary file (Hex) from raspberry will be uploaded to arduino connected to it via USB cable. I used to the following command to upload hex file successfully

pi@raspberrypi:~/test $ avrdude -v -p atmega328p -c arduino -P /dev/ttyACM0 -b 115200 -D -U flash:w:/home/pi/avrdude/led_test.ino.hex:i

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.