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

nRF9160 Asset Tracker: cannot compile with SES

I followed strictly all steps of the nRF Connect SDK Getting Started Assistant. However, the code doesn't compile:

(...)

9> Compiling ‘reboot.c’
1> In file included from C:/Nordic/nRF9160/ncs/zephyr/include/toolchain.h:21:0,
1> from zephyr/misc/generated/configs.c:7:
1> C:/Nordic/nRF9160/ncs/zephyr/include/toolchain/gcc.h:325:51: error: expected expression before ')' token
1> zephyr/misc/generated/configs.c:22:1: note: in expansion of macro 'GEN_ABSOLUTE_SYM'
1> C:/Nordic/nRF9160/ncs/zephyr/include/toolchain/gcc.h:325:51: error: expected expression before ')' token
1> zephyr/misc/generated/configs.c:29:1: note: in expansion of macro 'GEN_ABSOLUTE_SYM'
10> Compiling ‘policy_residency.c’
11> Compiling ‘uart_console.c’
Build failed

The problem appears to be in assembly of  the following:

#if defined(CONFIG_ARM)

/*
* GNU/ARM backend does not have a proper operand modifier which does not
* produces prefix # followed by value, such as %0 for PowerPC, Intel, and
* MIPS. The workaround performed here is using %B0 which converts
* the value to ~(value). Thus "n"(~(value)) is set in operand constraint
* to output (value) in the ARM specific GEN_OFFSET macro.
*/

#define GEN_ABSOLUTE_SYM(name, value) \
__asm__(".globl\t" #name "\n\t.equ\t" #name \
",%B0" \
"\n\t.type\t" #name ",%%object" : : "n"(~(value)))

The error is marked at the last line because ~(value) is not recognised. How can I solve?

Parents
  • I tried installing gcc-arm-none-eabi-8-2018-q4-major-win32-sha1 and now it is possible to compile, although it till fails on the creation of the hex file:

    1> Post-link command
    1> C:\gnuarmemb\bin\arm-none-eabi-objcopy.exe: zephyr.hex 64-bit address 0x4b4fa300008000 out of range for Intel Hex file
    1> C:\gnuarmemb\bin\arm-none-eabi-objcopy.exe:zephyr.hex: bad value
    Build failed

    Any tips?

    According to the documentation, this gcc version had a bug and we should use the previous one... which one should we use?

    Help is highly appreciated.

Reply
  • I tried installing gcc-arm-none-eabi-8-2018-q4-major-win32-sha1 and now it is possible to compile, although it till fails on the creation of the hex file:

    1> Post-link command
    1> C:\gnuarmemb\bin\arm-none-eabi-objcopy.exe: zephyr.hex 64-bit address 0x4b4fa300008000 out of range for Intel Hex file
    1> C:\gnuarmemb\bin\arm-none-eabi-objcopy.exe:zephyr.hex: bad value
    Build failed

    Any tips?

    According to the documentation, this gcc version had a bug and we should use the previous one... which one should we use?

    Help is highly appreciated.

Children
Related