Firstly my dev setup is as follows…
Mac OS 10.10.5
vsCode Version 1.19.3 (1.19.3)
PlatformIO, version 4.0.3 Board
ST Nucleo F103RB Framework
libOpenCM3
test.c main
int main(void)
{
}
I am trying to create a Dev environment using libOpenCM3
So I created a new project in PlatformIO
Project Name = xxx
Board = ST Nucleo F103RB
Framework = libOpenCM3
Project is created and initialised without errors.
I use an empty main { } then compile.
I get a massive list of errors e.g.
error “stm32 family not defined.”
error: ‘ADC_CR2_ADON’ undeclared
etc…
There are loads of undeclared’s (first use in this function)
If I create the exact same project except select Arduino
for the framework instead, everything compiles and links perfectly.
Can someone tell me why all these errors are occurring?
#if defined(STM32F0)
# include <libopencm3/stm32/f0/adc.h>
#elif defined(STM32F1)
# include <libopencm3/stm32/f1/adc.h>
#elif defined(STM32F3)
# include <libopencm3/stm32/f3/adc.h>
#elif defined(STM32F4)
# include <libopencm3/stm32/f4/adc.h>
#elif defined(STM32L1)
# include <libopencm3/stm32/l1/adc.h>
#else
# error "stm32 family not defined."
#endif
But the board JSON file doesn’t declare it in the flags / macros
Thanks,
I added that line and the “family not defined” error has now gone.
But I am having the following errors
Compiling .pio/build/nucleo_f103rb/src/PWM.o
arm-none-eabi-gcc: error: unrecognized command line option '-mlongcalls';
did you mean '-mlong-calls'?
arm-none-eabi-gcc: error: unrecognized command line option '-mtext-section-literals';
did you mean '-fext-numeric-literals'?
Compiling .pio/build/nucleo_f103rb/FrameworkLibOpenCM3/lib/stm32/f1/adc.o
arm-none-eabi-gcc: error: unrecognized command line option '-mlongcalls';
did you mean '-mlong-calls'?
arm-none-eabi-gcc: error: unrecognized command line option '-mtext-section-literals';
did you mean '-fext-numeric-literals'?
Compiling .pio/build/nucleo_f103rb/FrameworkLibOpenCM3/lib/stm32/common/adc_common_v1.o
arm-none-eabi-gcc: error: unrecognized command line option '-mlongcalls';
did you mean '-mlong-calls'?
arm-none-eabi-gcc: error: unrecognized command line option '-mtext-section-literals';
did you mean '-fext-numeric-literals'?
Compiling .pio/build/nucleo_f103rb/FrameworkLibOpenCM3/lib/stm32/can.o
arm-none-eabi-gcc: error: unrecognized command line option '-mlongcalls';
did you mean '-mlong-calls'?
arm-none-eabi-gcc: error: unrecognized command line option '-mtext-section-literals';
did you mean '-fext-numeric-literals'?
*** [.pio/build/nucleo_f103rb/src/PWM.o] Error 1
*** [.pio/build/nucleo_f103rb/FrameworkLibOpenCM3/lib/stm32/f1/adc.o] Error 1
*** [.pio/build/nucleo_f103rb/FrameworkLibOpenCM3/lib/stm32/common/adc_common_v1.o] Error 1
*** [.pio/build/nucleo_f103rb/FrameworkLibOpenCM3/lib/stm32/can.o] Error 1