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

Issue in building nrf51 application using GNU ARM toolchain

I'm trying to build our application using GNU Toolchain and currently facing compilation issue with __asm directive; the error thrown is:

../../NRF51_SDK_v6_1/nrf51822/Source/bootloader_dfu/bootloader_util_arm.c:30:7: error: expected '(' before 'void'
 __asm void isr_abort(uint32_t reset_handler)
       ^
../../NRF51_SDK_v6_1/nrf51822/Source/bootloader_dfu/bootloader_util_arm.c:74:19: error: stray '#' in program
     LDR   R0,[R0, #0x04]        ; Load Reset handler into register 0.
                   ^
../../NRF51_SDK_v6_1/nrf51822/Source/templates/gcc/Makefile.common:128: recipe for target '_build/bootloader_util_arm.o' failed
make: *** [_build/bootloader_util_arm.o] Error 1 

The error is coming from line #30 bootloader_util_arm.c:

__asm void isr_abort(uint32_t reset_handler)

I'm using the Makefile.common, Makefile.posix under ~/NRF51_SDK_v6_1/nrf51822/Source/templates/gcc/ and application specific Makefile. More about the compiler, linker etc below:

Toolchain: gcc-arm-none-eabi-4_9-2015q2

Host: x86_64 system running 64bit Linux

Target: NRF51822_QF_AA

SDK: v6.1

$ make echostuff

C_OBJECTS: [_build/main.o _build/ble_srv_common.o _build/ble_advdata.o _build/ble_sensorsim.o _build/softdevice_handler.o _build/ble_debug_assert_handler.o _build/ble_error_log.o _build/ble_conn_params.o _build/pstorage.o _build/crc16.o _build/app_timer.o _build/app_scheduler.o _build/app_button.o _build/app_gpiote.o _build/accelerometer.o _build/ble_cts.o _build/ble_ps.o _build/bluetooth.o _build/debug.o _build/gsm.o _build/gps.o _build/nrf_pwm.o _build/pwm.o _build/rtc.o _build/scheduler.o _build/sd_twi_hw_master.o _build/spi.o _build/spiflash.o _build/stm_uart.o _build/uart_comm.o _build/utils.o _build/vehicle.o _build/nrf_delay.o _build/uart.o _build/ble_dis.o _build/spi_master.o _build/bootloader_util_arm.o _build/dfu_app_handler.o _build/ble_dfu.o _build/system_nrf51.o]

C_SOURCE_FILES: [main.c ble_srv_common.c ble_advdata.c ble_sensorsim.c softdevice_handler.c ble_debug_assert_handler.c ble_error_log.c ble_conn_params.c pstorage.c crc16.c app_timer.c app_scheduler.c app_button.c app_gpiote.c accelerometer.c ble_cts.c ble_ps.c bluetooth.c debug.c gsm.c gps.c nrf_pwm.c pwm.c rtc.c scheduler.c sd_twi_hw_master.c spi.c spiflash.c stm_uart.c uart_comm.c utils.c vehicle.c nrf_delay.c uart.c ble_dis.c spi_master.c bootloader_util_arm.c dfu_app_handler.c ble_dfu.c system_nrf51.c]

C_SOURCE_PATHS: [../../NRF51_SDK_v6_1/nrf51822/Source/nrf_delay ../../NRF51_SDK_v6_1/nrf51822/../../custom_sdk ../ ../../NRF51_SDK_v6_1/nrf51822/Source/ ../../NRF51_SDK_v6_1/nrf51822/Source/templates/gcc/ ../../NRF51_SDK_v6_1/nrf51822/Source/nrf_delay/ ../../NRF51_SDK_v6_1/nrf51822/Source/keil_arm_uv4.lnt ../../NRF51_SDK_v6_1/nrf51822/Source/templates/ ../../NRF51_SDK_v6_1/nrf51822/Source/gzp/ ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ ../../NRF51_SDK_v6_1/nrf51822/Source/console/ ../../NRF51_SDK_v6_1/nrf51822/Source/simple_uart/ ../../NRF51_SDK_v6_1/nrf51822/Source/serialization/ ../../NRF51_SDK_v6_1/nrf51822/Source/app_common/ ../../NRF51_SDK_v6_1/nrf51822/Source/spi_slave/ ../../NRF51_SDK_v6_1/nrf51822/Source/nrf_assert/ ../../NRF51_SDK_v6_1/nrf51822/Source/twi_master/ ../../NRF51_SDK_v6_1/nrf51822/Source/bootloader_dfu/ ../../NRF51_SDK_v6_1/nrf51822/Source/sd_common/ ../../NRF51_SDK_v6_1/nrf51822/Source/nrf_ecb/ ../../NRF51_SDK_v6_1/nrf51822/Source/spi_master/ ../../NRF51_SDK_v6_1/nrf51822/Source/ext_sensors/ ../../NRF51_SDK_v6_1/nrf51822/Source/nrf_nvmc/ ../../NRF51_SDK_v6_1/nrf51822/Source/sdk_soc/ ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_flash.c ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_sensorsim.c ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_conn_params.c ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_debug_assert_handler.c ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_error_log.c ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_advdata.c ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_db_discovery.c ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_services/ ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_racp.c ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_radio_notification.c ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_advdata_parser.c ../../NRF51_SDK_v6_1/nrf51822/Source/ble/device_manager/ ../../NRF51_SDK_v6_1/nrf51822/Source/ble/ble_dtm.c]

INCLUDE_PATHS: [-I../../NRF51_SDK_v6_1/nrf51822/Include -I../../NRF51_SDK_v6_1/nrf51822/Include/s110 -I../../NRF51_SDK_v6_1/nrf51822/Include/ble -I../../NRF51_SDK_v6_1/nrf51822/Include/ble/ble_services -I../../NRF51_SDK_v6_1/nrf51822/Include/app_common -I../../NRF51_SDK_v6_1/nrf51822/Include/sd_common -I../../NRF51_SDK_v6_1/nrf51822/Include/sdk -I../../NRF51_SDK_v6_1/nrf51822/Include/bootloader_dfu -I../../NRF51_SDK_v6_1/nrf51822/../../custom_sdk -I../../NRF51_SDK_v6_1/nrf51822/../../ARM/CMSIS/Include -I../../NRF51_SDK_v6_1/nrf51822/Device/ARM/ARMCM0/Include -I../../tools/gcc-arm-none-eabi-4_9-2015q2/arm-none-eabi/include -I../ -I../../NRF51_SDK_v6_1/nrf51822/Include/gcc]

LDFLAGS: [-Wl,--gc-sections -L../../tools/gcc-arm-none-eabi-4_9-2015q2/arm-none-eabi/lib/armv6-m -L../../tools/gcc-arm-none-eabi-4_9-2015q2/lib/gcc/arm-none-eabi/4.9.3/armv6-m -Xlinker -Map=_build/mybleapp_s110_xxaa.map -mcpu=cortex-m0 -mthumb -mabi=aapcs -L../../NRF51_SDK_v6_1/nrf51822/Source/templates/gcc/ -Tgcc_nrf51_s110_xxaa.ld --specs=nano.specs ]

CFLAGS: [-DDEBUG_NRF_USER -DBLE_STACK_SUPPORT_REQD -DSPI_MASTER_0_ENABLE -DNRF51 -DTOOLCHAIN_GCC_ARM -DARM_MATH_CM0 -ffunction-sections -mcpu=cortex-m0 -mthumb -mabi=aapcs -DNRF51 -DBOARD_NRF6310 -DNRF51822_QFAA_CA --std=gnu99 -Wall -fno-common -fmessage-length=0 -mfloat-abi=soft -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer --specs=nano.specs ] LIBRARIES: [-lm]

Note:

1: Without the DFU-OTA specific files(bootloader_util_arm, dfu_app_handler.c, ble_dfu.c), I'm able to successfully build and flash(using JLinkExe for Linux), but I need the support for DFU-OTA in my application.

Parents Reply Children
Related