FreeRTOS BSP MX7: Unresolved References

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FreeRTOS BSP MX7: Unresolved References

跳至解决方案
1,781 次查看
demoniacmilk
Contributor IV

Hello community,

I have set up a build environment based on Eclipse and ARM MCU Plugins.
The IDE provides example projects for the STM32, including the STM HAL etc. I can successfully build these example projects, so my IDE and toolchain should be set up correctly.

To get some testing done on the MX7 I created a new project including the "blinking_mx_demo" and the freeRTOS source files from the MX7 FreeRTOS SDK.

projectStruct.PNG

On creating the elf file, a lot of errors are produced in the following files:

errorsInFiles.PNG

Console output:

Building target: MX7_M4_Test.elf
Invoking: GNU ARM Cross C Linker
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -g3 -Xlinker --gc-sections -Wl,-Map,"MX7_M4_Test.map" -o "MX7_M4_Test.elf" ./freeRTOS/portable/MemMang/heap_2.o ./freeRTOS/portable/GCC/ARM_CM4F/port.o ./freeRTOS/croutine.o ./freeRTOS/event_groups.o ./freeRTOS/list.o ./freeRTOS/queue.o ./freeRTOS/tasks.o ./freeRTOS/timers.o ./blinking_imx_demo/gpio_ctrl.o ./blinking_imx_demo/gpt_timer.o ./blinking_imx_demo/hardware_init.o ./blinking_imx_demo/main.o
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x16): undefined reference to `_exit'
./blinking_imx_demo/gpio_ctrl.o: In function `GPIO_Ctrl_InitKeyPin':
path_to_example/blinking_imx_demo/gpio_ctrl.c:81: undefined reference to `RDC_SEMAPHORE_Lock'
path_to_example/blinking_imx_demo/gpio_ctrl.c:83: undefined reference to `GPIO_Init'
path_to_example/blinking_imx_demo/gpio_ctrl.c:85: undefined reference to `RDC_SEMAPHORE_Unlock'
path_to_example/blinking_imx_demo/gpio_ctrl.c:90: undefined reference to `gpioKeyFunc1'
./blinking_imx_demo/gpio_ctrl.o: In function `GPIO_Ctrl_ToggleLed':
path_to_example/blinking_imx_demo/gpio_ctrl.c:112: undefined reference to `debug_printf'
./blinking_imx_demo/gpio_ctrl.o: In function `GPIO_Ctrl_WaitKeyPressed':
path_to_example/blinking_imx_demo/gpio_ctrl.c:127: undefined reference to `RDC_SEMAPHORE_Lock'
path_to_example/blinking_imx_demo/gpio_ctrl.c:132: undefined reference to `GPIO_SetPinIntMode'
path_to_example/blinking_imx_demo/gpio_ctrl.c:134: undefined reference to `RDC_SEMAPHORE_Unlock'
path_to_example/blinking_imx_demo/gpio_ctrl.c:139: undefined reference to `debug_printf'
path_to_example/blinking_imx_demo/gpio_ctrl.c:165: undefined reference to `gpioKeyFunc1'
./blinking_imx_demo/gpt_timer.o: In function `Hw_Timer_Init':
path_to_example/blinking_imx_demo/gpt_timer.c:58: undefined reference to `GPT_Init'
path_to_example/blinking_imx_demo/gpt_timer.c:61: undefined reference to `GPT_SetClockSource'
./blinking_imx_demo/gpt_timer.o: In function `Hw_Timer_Delay':
path_to_example/blinking_imx_demo/gpt_timer.c:94: undefined reference to `GPT_SetIntCmd'
./blinking_imx_demo/hardware_init.o: In function `hardware_init':
path_to_example/blinking_imx_demo/hardware_init.c:37: undefined reference to `BOARD_RdcInit'
path_to_example/blinking_imx_demo/hardware_init.c:39: undefined reference to `BOARD_ClockInit'
path_to_example/blinking_imx_demo/hardware_init.c:41: undefined reference to `dbg_uart_init'
path_to_example/blinking_imx_demo/hardware_init.c:59: undefined reference to `CCM_UpdateRoot'
path_to_example/blinking_imx_demo/hardware_init.c:71: undefined reference to `configure_gpio_pin'
path_to_example/blinking_imx_demo/hardware_init.c:72: undefined reference to `gpioKeyFunc1'
./blinking_imx_demo/main.o: In function `SwitchTask':
path_to_example//blinking_imx_demo/main.c:68: undefined reference to `debug_printf'
./blinking_imx_demo/main.o: In function `main':
path_to_example//blinking_imx_demo/main.c:92: undefined reference to `debug_printf'
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-abort.o): In function `abort':
abort.c:(.text.abort+0xa): undefined reference to `_exit'
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text._kill_r+0x10): undefined reference to `_kill'
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid'
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x12): undefined reference to `_write'
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text._close_r+0xc): undefined reference to `_close'
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text._fstat_r+0x10): undefined reference to `_fstat'
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text._isatty_r+0xc): undefined reference to `_isatty'
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text._lseek_r+0x12): undefined reference to `_lseek'
path/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libg.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text._read_r+0x12): undefined reference to `_read'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:47: MX7_M4_Test.elf] Error 1

These errors are interesting cause many of them refer to undefined references. Id assume this is due to missing header files, but include paths to these header files have been provided (otherwise, the build process would have stopped before attempting to build the .elf file).

Any idea what might be going wrong?

标签 (2)
标记 (5)
0 项奖励
回复
1 解答
1,583 次查看
demoniacmilk
Contributor IV

To close this:

I had added source files for RTOS and and an example to my project, then iterated through attempting to build and adding missing include paths until the compiler was able to find all header files.

Some source files were missing in the project tree (platform folder in my case) so the linker could not find the sources for e.g. foo(bar). The compiler beforehand did not complain, as a function prototype for foo(bar) was included in the header files.

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,584 次查看
demoniacmilk
Contributor IV

To close this:

I had added source files for RTOS and and an example to my project, then iterated through attempting to build and adding missing include paths until the compiler was able to find all header files.

Some source files were missing in the project tree (platform folder in my case) so the linker could not find the sources for e.g. foo(bar). The compiler beforehand did not complain, as a function prototype for foo(bar) was included in the header files.

0 项奖励
回复