Just installed the Arduino IDE v2.01, installed the Seeeduino board manager and plugged the XIAO RP2040 board in the USB port.
When compiling the Blinky example from
I get this error:
C:\Users\Owner\AppData\Local\Temp\arduino-sketch-45C0AB0A11055BE710021EA51AA35BFB/…\arduino-core-cache\core_Seeeduino_rp2040_Seeed_XIAO_RP2040_293ba2af266b39bba83d02e0dbdc7b12.a(Serial.cpp.o): In function arduino::UART::operator bool()': C:\Users\Owner\AppData\Local\Arduino15\packages\Seeeduino\hardware\rp2040\2.7.2\cores\arduino\USB/PluggableUSBSerial.h:272: undefined reference to delay’
C:\Users\Owner\AppData\Local\Temp\arduino-sketch-45C0AB0A11055BE710021EA51AA35BFB/…\arduino-core-cache\core_Seeeduino_rp2040_Seeed_XIAO_RP2040_293ba2af266b39bba83d02e0dbdc7b12.a(USBSerial.cpp.o): In function arduino::USBSerial::operator bool()': C:\Users\Owner\AppData\Local\Arduino15\packages\Seeeduino\hardware\rp2040\2.7.2\cores\arduino\USB/PluggableUSBSerial.h:272: undefined reference to delay’
C:\Users\Owner\AppData\Local\Temp\arduino-sketch-45C0AB0A11055BE710021EA51AA35BFB/…\arduino-core-cache\core_Seeeduino_rp2040_Seeed_XIAO_RP2040_293ba2af266b39bba83d02e0dbdc7b12.a(USBSerial.cpp.o): In function waitForPortClose()': C:\Users\Owner\AppData\Local\Arduino15\packages\Seeeduino\hardware\rp2040\2.7.2\cores\arduino\USB/USBSerial.cpp:35: undefined reference to millis’
C:\Users\Owner\AppData\Local\Arduino15\packages\Seeeduino\hardware\rp2040\2.7.2\cores\arduino\USB/USBSerial.cpp:39: undefined reference to delay' C:\Users\Owner\AppData\Local\Arduino15\packages\Seeeduino\hardware\rp2040\2.7.2\cores\arduino\USB/USBSerial.cpp:37: undefined reference to millis’
C:\Users\Owner\AppData\Local\Arduino15\packages\Seeeduino\hardware\rp2040\2.7.2\variants\SEEED_XIAO_RP2040/libs/libmbed.a(mbed_boot_gcc_arm.o): In function __wrap_main': mbed_boot_gcc_arm.c:(.text.__wrap_main+0x2): undefined reference to main’
Some common fixes for avoiding compilation errors are mentioned below:
Carefully follow the syntax of the programing language
The most common error that is seen while compiling the Arduino code is the error number 4, 5 and 6 in the above given list and it is encountered due to the following reasons:
Missing semicolon at the end of any statement
Missing bracket either at the end or start of the loop or statement
These errors can be avoided in such a way that whenever writing any loop,always write in between the start and end brackets from the beginning. Also, when writing the code in Arduino IDE keep checking if there is any code line highlighted in red and if there is rectify it first before compiling.
Declare variables that are to be used in Arduino code
Another error that is mostly seen while compiling the Arduino code is the incorrect use of variables in the code by not giving the data types and the error number 3 in the list above is encountered. There are two reasons for such type of error that are:
Calling local variables in any function
Using undefined variables in a function
The variables that are defined outside the setup and loop functions are the global variables that can be accessed anywhere in the Arduino sketch. Whereas the variables declared either in the loop section or in the setup function are called the local variables as they cannot be accessed from outside the respective functions.
I loaded the same code and libraries into the old IDE 1.8.19 and it works there (on the same computer).
I completely uninstalled 2.0.1 because I had an old 2.0 Beta copy installed previously and reinstalled it after a reboot. I get the same error after a fresh install of 2.0.1, so the issue seems to be with 2.0.1 (even though 2.0.1 works with a Uno, so maybe it’s the gcc-arm installation that is incomplete).
Not a show stopper, I wanted to try 2.0.1 because it is advertised as having debug capability but reading the info about it, it is the command line gdb interface, not my cup of tea… so 1.8.19 will do for now.