micro-ROS / freertos_apps

Sample applications for FreeRTOS + micro-ROS
Apache License 2.0
81 stars 50 forks source link

undefined reference to HAL_ADC #74

Closed Nptw closed 3 years ago

Nptw commented 3 years ago

Issue template

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.

pablogs9 commented 3 years ago

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.