b-g431-esc1Arduino Compile Problem

Hi,

I started to test my board with arduino. I opened example sketch, but it is compile error. I did not change anything.
Here is my output.

c:/users/administrator/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: libraries\Simple_FOC\current_sense\hardware_specific\stm32\b_g431\b_g431_mcu.cpp.o: in function _configureOPAMP(OPAMP_HandleTypeDef*, OPAMP_TypeDef*)': b_g431_mcu.cpp:(.text._Z15_configureOPAMPP19OPAMP_HandleTypeDefP13OPAMP_TypeDef+0x22): undefined reference to HAL_OPAMP_Init’
c:/users/administrator/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: libraries\Simple_FOC\current_sense\hardware_specific\stm32\b_g431\b_g431_mcu.cpp.o: in function _configureADCInline(void const*, int, int, int)': b_g431_mcu.cpp:(.text._Z19_configureADCInlinePKviii+0x6c): undefined reference to HAL_OPAMP_Start’
c:/users/administrator/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: b_g431_mcu.cpp:(.text._Z19_configureADCInlinePKviii+0x72): undefined reference to HAL_OPAMP_Start' c:/users/administrator/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: b_g431_mcu.cpp:(.text._Z19_configureADCInlinePKviii+0x78): undefined reference to HAL_OPAMP_Start’
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Discovery.

What can be the reason ?

Ok. I resolved it by adding -D HAL_ADC_MODULE_ONLY -D HAL_OPAMP_MODULE_ENABLED flags to boards.txt.

1 Like