This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Missing symbols when linking

Hi all,

I'm having problems when linking my code intended for use on the nRF51822. For some reason there are missing symbols that are needed. I've traced the dependencies back to the linker script file "gcc_nrf51_common.ld".

Where are these definitions found and what do I need to do to include them?

Output of linking can be seen below.

Linking object files: -Xlinker -Map=bin/main.map -mcpu=cortex-m0 -mthumb -mabi=aapcs -Tlib/nrf51sdk/Nordic/nrf51822/Source/templates/gcc/gcc_nrf51_s110_xxaa.ld -L/opt/arm-2013.05/arm-none-eabi/lib/armv6-m -L/opt/arm-2013.05/lib/gcc/arm-none-eabi/4.7.2/armv6-m -Llib/nrf51sdk/Nordic/nrf51822/Source/templates/gcc/ -Llinker "/opt/arm-2013.05/bin/arm-none-eabi-gcc" -Xlinker -Map=bin/main.map -mcpu=cortex-m0 -mthumb -mabi=aapcs -Tlib/nrf51sdk/Nordic/nrf51822/Source/templates/gcc/gcc_nrf51_s110_xxaa.ld -L"/opt/arm-2013.05/arm-none-eabi/lib/armv6-m" -L"/opt/arm-2013.05/lib/gcc/arm-none-eabi/4.7.2/armv6-m" -Llib/nrf51sdk/Nordic/nrf51822/Source/templates/gcc/ -Llinker obj/main.o obj/led.o obj/app_button.o obj/app_fifo.o obj/app_gpiote.o obj/app_scheduler.o obj/app_timer.o obj/app_uart.o obj/ble_dis.o obj/ble_bas.o obj/ble_hrs.o obj/ble_hts.o obj/ble_conn_params.o obj/ble_advdata.o obj/ble_srv_common.o obj/ble_stack_handler.o obj/ble_flash.o obj/ble_radio_notification.o obj/system_nrf51.o obj/nrf_delay.o obj/ble_2way_stream.o obj/compass.o obj/flash.calib.o obj/magnetometer.o obj/simple_uart.o obj/I2C_BUS.o obj/acc_array_2x2.o obj/proximity.o obj/die_temp.o obj/int_math.o obj/gcc_startup_nrf51.o -Wl,--start-group -lgcc -lc -Wl,--end-group -o build/main.out /opt/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol Reset_Handler; defaulting to 00014000 obj/gcc_startup_nrf51.o:(.cs3.interrupt_vector+0x0): undefined reference to __cs3_stack' obj/gcc_startup_nrf51.o:(.cs3.interrupt_vector+0x4): undefined reference to__cs3_reset' obj/gcc_startup_nrf51.o: In function __cs3_reset_cortex_m': (.cs3.reset+0x1c): undefined reference to__cs3_start_asm' collect2: error: ld returned 1 exit status

Parents
  • Based on your errors, it seems that you are mixing Makefiles and linker scripts from different versions of the SDK. A few versions ago we switched the officially supported GCC version from the CodeSourcery one to the one available here, and the errors you see seems likely to occur if you mix files between them.

    I'd recommend you to make sure to upgrade to the latest SDK, use the Launchpad toolchain, and write your Makefile again, based on one from the latest SDK.

Reply
  • Based on your errors, it seems that you are mixing Makefiles and linker scripts from different versions of the SDK. A few versions ago we switched the officially supported GCC version from the CodeSourcery one to the one available here, and the errors you see seems likely to occur if you mix files between them.

    I'd recommend you to make sure to upgrade to the latest SDK, use the Launchpad toolchain, and write your Makefile again, based on one from the latest SDK.

Children
No Data
Related