If your code doesn't upload on your board

this is a message when i couldn't upload my code on arduino from online ide

Error Code: /usr/local/bin/arduino-cli compile --fqbn arduino:avr:uno --libraries /home/builder/opt/libraries/latest --build-cache-path /tmp --output-dir /tmp/125229010/build --build-path /tmp/arduino-build-4A14368B1CC0B95AACF0030F65371E70 /tmp/125229010/sketch_feb7b

Linking everything together...

/home/builder/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o /tmp/arduino-build-4A14368B1CC0B95AACF0030F65371E70/sketch_feb7b.ino.elf /tmp/arduino-build-4A14368B1CC0B95AACF0030F65371E70/sketch/sketch_feb7b.ino.cpp.o /tmp/arduino-build-4A14368B1CC0B95AACF0030F65371E70/../core/core_arduino_avr_uno_f1d675a35cb302d87396e400c56d2f7e.a -L/tmp/arduino-build-4A14368B1CC0B95AACF0030F65371E70 -lm

/tmp/ccyfxzbU.ltrans0.ltrans.o: In function `main':

/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino/main.cpp:43: undefined reference to `setup'

/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino/main.cpp:46: undefined reference to `loop'

collect2: error: ld returned 1 exit status

Error during build: exit status 1

it's the same in desktop ide.
There are steps for how to fix it:

  1. first, plugin the board to the pc
  2. right click on my computer and select manager
    Screenshot 2023-10-02 220033
  3. from device manager select ports then select the Arduino port and uninstall device
  4. plug out the Arduino and plug it in again, the pc will detect the board automatically
  5. try to upload any example

hope you find it useful

That is not an upload problem and re-installing device drivers does not solve that problem.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.