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

Error when building the samples for beacon module using gcc

I tried to follow some tutorials on this site to build the samples for the beacon modules using gcc.

I am seeing this error:

Compiling file: bootloader_util_arm.c ../../../../../components/libraries/bootloader_dfu/bootloader_util_arm.c:48:10: error: expected '(' before 'static' asm static void bootloader_util_reset(uint32_t start_addr) ^ ../../../../../components/libraries/bootloader_dfu/bootloader_util_arm.c:56:20: error: stray '#' in program LDR R6, [R0, #0x04] ; Load Reset handler into register 6. ^

Can someone share some insights on what I may have done wrong?

  • @J Chui: Please use the bootloader_util.c file from nRF51 SDK v9.0. The file can be found at \components\libraries\bootloader_dfu.

    The assembly code in bootloader_util.c in the beacon SDK wasn't in the form for GCC, but KEIL. The file in nRF51 SDK support both.

    Note that you may have to add -fomit-frame-pointer in the compiler option if you get "error: r7 cannot be used in asm here".

  • Works great. Thanks!