Dear Sir/madam,
I am using the B-G431B-ESC1 with the PlatformIO, and I’ve been able to get closed-loop control to work decently well. Next step, I wanted to implement current sensing and the foc_current torque controller. When i compile and updating the current sensor code. I still get the following compile error:
c:/users/daniel_huynh/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: .pio/build/disco_b_g431b_esc1/lib2e5/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/daniel_huynh/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: .pio/build/disco_b_g431b_esc1/lib2e5/Simple FOC/current_sense/hardware_specific/stm32/b_g431/b_g431_mcu.cpp.o: in function `_configureADCLowSide(void const*, int, int, int)':
b_g431_mcu.cpp:(.text._Z20_configureADCLowSidePKviii+0x7a): undefined reference to `HAL_OPAMP_Start'
c:/users/daniel_huynh/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: b_g431_mcu.cpp:(.text._Z20_configureADCLowSidePKviii+0x80): undefined reference to `HAL_OPAMP_Start'
c:/users/daniel_huynh/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: b_g431_mcu.cpp:(.text._Z20_configureADCLowSidePKviii+0x86): undefined reference to `HAL_OPAMP_Start'
I try to add the build flags option " -D HALL_OPAMP_MODULE_ENABLED" and “-D HAL_ADC_MODULE_ONLY”. Same error above.
This is my platformio.ini
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:disco_b_g431b_esc1]
platform = ststm32
board = disco_b_g431b_esc1
framework = arduino
upload_protocol = stlink
monitor_speed = 115200
build_flags =
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D PIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF
-D HALL_OPAMP_MODULE_ENABLED
-D HAL_ADC_MODULE_ONLY
lib_deps =
https://github.com/simplefoc/Arduino-FOC.git
SPI
Wire
lib_archive = false
Noted: When i used the Arduino IDE. It’s working very well with -DHAL_OPAMP_MODULE_ENABLED
flag.
With PlatformIO, I commented out the line “lib_archive = false”. There are no errors reported. However, the code doesn’t seem to be functioning properly.
Do you know this issue from platformIO?