micro-ROS/freertos_apps

undefined reference to HAL_ADC

Nptw opened this issue · 1 comments

Nptw commented

Issue template

  • Hardware description: STM32 Nucleo-F746ZG
  • RTOS: FreeRTOS
  • Installation type: micro_ros_setup
  • Version or commit hash: Ubuntu 20.04, ROS 2, Foxy

Additional information

I would like to use micro-ROS to read a value of resistance.
On the STM32CubeIDE, program can run smoothly but micro-ROS can not.

Expected behavior

Get an output as resistance value measured via micro-ROS.

Actual behavior

~/firmware/freertos_apps/microros_nucleo_f746zg_extensions/build/main.o: in function `MX_ADC1_Init':
~/firmware/freertos_apps/microros_nucleo_f746zg_extensions/Src/main.c:286: undefined reference to `HAL_ADC_Init'
~/firmware/toolchain/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: ~/firmware/freertos_apps/microros_nucleo_f746zg_extensions/Src/main.c:294: undefined reference to `HAL_ADC_ConfigChannel'
~/firmware/toolchain/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: ~/firmware/freertos_apps/microros_nucleo_f746zg_extensions/build/app.o: in function `appMain':
~/firmware/freertos_apps/apps/int32_publisher/app.c:92: undefined reference to `HAL_ADC_Start'
~/firmware/toolchain/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: ~/firmware/freertos_apps/apps/int32_publisher/app.c:93: undefined reference to `HAL_ADC_PollForConversion'
~/firmware/toolchain/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: ~/firmware/freertos_apps/apps/int32_publisher/app.c:94: undefined reference to `HAL_ADC_GetValue'
collect2: error: ld returned 1 exit status
make: *** [Makefile:383: ~/firmware/freertos_apps/microros_nucleo_f746zg_extensions/build/micro-ROS.elf] Error 1

The program can not successfully build due to undefined reference. Also hal_adc file is included and located at the same containing file as others hal files. I did not change any directories stucture in micro-ROS's workspace.

Thanks.

Please integrate micro-ROS with STM32CubeIDE using https://github.com/micro-ROS/micro_ros_stm32cubemx_utils#using-this-package-with-stm32cubeide.
Let us know if you have any problems by opening an issue there.