Closed
Description
The Arduino CLI compiles most firmware using the following parameter and an .ino
file.
-b, --fqbn string Fully Qualified Board Name, e.g.: arduino:avr:uno
For example:
arduino-cli compile -b arduino:avr:uno /home/user/Arduino/MySketch.ino
If I try this with an ST board I get the following error:
$ arduino-cli compile --fqbn STMicroelectronics:stm32:GenL4 /home/user/Arduino/MySketch.ino
In file included from /root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/stm32/stm32_def.h:48,
from /root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/stm32/clock.h:19,
from /root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/wiring_time.h:23,
from /root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/wiring.h:38,
from /root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/Arduino.h:36,
from /tmp/arduino-sketch-43EA3F8101597CC7E1F859A3B3B56A0F/sketch/MySketch.ino.cpp:1:
/root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h:175:3: error: #error "Please select first the target STM32L4xx device used in your application (in stm32l4xx.h file)"
175 | #error "Please select first the target STM32L4xx device used in your application (in stm32l4xx.h file)"
| ^~~~~
Error during build: exit status 1
I compiled the firmware in the Arduino IDE and I noticed the --fqbn
used is more complex.
-fqbn=STMicroelectronics:stm32:BluesW:pnum=SWAN_R5,upload_method=swdMethod,xserial=generic,usb=none,xusb=FS,opt=osstd,dbg=none,rtlib=nano
I tried to compile using the Arduino CLI with the more complex --fqbn
parameter, but I'm still hitting the same issue.
$ arduino-cli compile --fqbn STMicroelectronics:stm32:BluesW:pnum=SWAN_R5,upload_method=swdMethod,xserial=generic,usb=none,xusb=FS,opt=osstd,dbg=none,rtlib=nano /home/user/Arduino/MySketch.ino
In file included from /root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/stm32/stm32_def.h:48,
from /root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/stm32/clock.h:19,
from /root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/wiring_time.h:23,
from /root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/wiring.h:38,
from /root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/Arduino.h:36,
from /tmp/arduino-sketch-43EA3F8101597CC7E1F859A3B3B56A0F/sketch/MySketch.ino.cpp:1:
/root/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h:175:3: error: #error "Please select first the target STM32L4xx device used in your application (in stm32l4xx.h file)"
175 | #error "Please select first the target STM32L4xx device used in your application (in stm32l4xx.h file)"
| ^~~~~
Error during build: exit status 1
What am I missing? I have compiled sketches (including this one) for nearly every platform I can think of, but I cannot get ST to compile.