5 years, 10 months ago.

Errors: b'arm-none-eabi-objcopy: .application.hex 64-bit address out of range for Intel Hex

Hi there,

I'm using mbed-cli to compile my source code, this is the link, https://os.mbed.com/users/krenbluetoothsig/code/BluetoothLEGap/ I can use mbed online compiler to compile it.

Recently, I would like to use mbed-cli to compile it. After setting up mbed-cli dev environment, I believe that I can compile my source code. After checking out the source code and I tried to compile, but there was an error as mentioned on Subject: "Errors: b'arm-none-eabi-objcopy: .
BUILD
NRF52_DK
GCC_ARM
BluetoothLEGap_application.hex 64-bit address 0x4b4fa300023000 out of range for Intel He"

How can I solve this problem? I think there is memory mapping configuration error, but I don't know how to re-configure it.

Full compiling console is here:

C:\Users\xxx\work\Github\Mbed\BluetoothLEGap>mbed compile -t GCC_ARM -m NRF52_DK -v
[mbed] WARNING: If you're using Python 3 with Mbed OS 5.8 and earlier versions, Python errors will occur when compiling, testing and exporting
---
[mbed] Working path "C:\Users\xxx\work\Github\Mbed\BluetoothLEGap" (program)
[mbed] Exec "c:\python37\python.exe -u C:\Users\xxx\work\Github\Mbed\BluetoothLEGap\mbed-os\tools\make.py -t GCC_ARM -m NRF52_DK --source . --build .\BUILD\NRF52_DK\GCC_ARM -v" in "C:\Users\xxx\work\Github\Mbed\BluetoothLEGap"
[Warning] @,: Compiler version mismatch: Have 8.2.1; expected version >= 6.0.0 and < 7.0.0
Building project BluetoothLEGap (NRF52_DK, GCC_ARM)
Scan: BluetoothLEGap
Scan: FEATURE_BLE
Using ROM regions bootloader, application in this build.
  Region bootloader: size 0x23000, offset 0x0
  Region application: size 0x5d000, offset 0x23000
Macros: -DDEVICE_PWMOUT=1 -DFEATURE_BLE=1 -DTARGET_CORTEX -DTARGET_MCU_NRF52832 -DNRF52_PAN_58 -DDEVICE_SYSTICK_CLK_OFF_DURING_SLEEP=1 -DTARGET_NORDIC -DNRF52_PAN_20 -DARM_MATH_CM4 -DNRF52_PAN_15 -D__CORTEX_M4 -D__FPU_PRESENT=1 -DDEVICE_ANALOGIN=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_I2C=1 -DTARGET_SDK_14_2 -DDEVICE_ITM=1 -DDEVICE_PORTOUT=1 -DDEVICE_FLASH=1 -DDEVICE_USTICKER=1 -DCONFIG_GPIO_AS_PINRESET -DTARGET_NRF52_DK -DNRF52 -DDEVICE_SERIAL_FC=1 -DTARGET_LIKE_CORTEX_M4 -DTARGET_NRF52 -DDEVICE_LPTICKER=1 -DTARGET_NRF5x -DTARGET_M4 -DTARGET_SOFTDEVICE_S132_FULL -DDEVICE_SLEEP=1 -DTARGET_LIKE_MBED -DDEVICE_SPI_ASYNCH=1 -DMBED_TICKLESS -DCMSIS_VECTAB_VIRTUAL -DDEVICE_PORTINOUT=1 -DTOOLCHAIN_GCC_ARM -DTARGET_FF_ARDUINO -DNRF52_PAN_53 -DTOOLCHAIN_GCC -DNRF52_PAN_62 -DDEVICE_SERIAL=1 -DDEVICE_TRNG=1 -DDEVICE_PORTIN=1 -DTARGET_RELEASE -DTARGET_SOFTDEVICE_COMMON -DTARGET_CORTEX_M -DTARGET_RTOS_M4_M7 -D__MBED__=1 -D__MBED_CMSIS_RTOS_CM -DNRF52_PAN_54 -DNRF52_PAN_55 -DNRF52_PAN_63 -DNRF52_PAN_51 -DNRF52_PAN_30 -DNRF52_PAN_12 -DMBED_BUILD_TIMESTAMP=1546742727.6300192 -DDEVICE_SERIAL_ASYNCH=1 -DCMSIS_VECTAB_VIRTUAL_HEADER_FILE="cmsis_nvic.h" -DTARGET_NRF52832 -DBOARD_PCA10040 -DNRF52_PAN_36 -DNRF52_PAN_64 -DDEVICE_SPI=1 -DDEVICE_I2C_ASYNCH=1 -D__CMSIS_RTOS -DNRF52_PAN_31
Link: BluetoothLEGap_application
Preproc: arm-none-eabi-cpp -E -P .\mbed-os\targets\TARGET_NORDIC\TARGET_NRF5x\TARGET_NRF52\TARGET_MCU_NRF52832\device\TOOLCHAIN_GCC_ARM\NRF52832.ld -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -DSOFTDEVICE_PRESENT=1 -DMBED_APP_START=0x23000 -DMBED_APP_SIZE=0x5d000 -o .\BUILD\NRF52_DK\GCC_ARM\.link_script.ld
[DEBUG] Return: 0
Link: arm-none-eabi-gcc @.\BUILD\NRF52_DK\GCC_ARM\.link_options.txt
[DEBUG] Return: 0
Elf2Bin: BluetoothLEGap_application
FromELF: arm-none-eabi-objcopy -O ihex .\BUILD\NRF52_DK\GCC_ARM\BluetoothLEGap_application.elf .\BUILD\NRF52_DK\GCC_ARM\BluetoothLEGap_application.hex
[DEBUG] Return: 1
[DEBUG] Errors: b'arm-none-eabi-objcopy: .\\BUILD\\NRF52_DK\\GCC_ARM\\BluetoothLEGap_application.hex 64-bit address 0x4b4fa300023000 out of range for Intel Hex file'
[DEBUG] Errors: b'arm-none-eabi-objcopy:.\\BUILD\\NRF52_DK\\GCC_ARM\\BluetoothLEGap_application.hex: bad value'
Traceback (most recent call last):
  File "C:\Users\xxx\work\Github\Mbed\BluetoothLEGap\mbed-os\tools\make.py", line 71, in wrapped_build_project
    src_dir, build_dir, mcu, *args, **kwargs
  File "C:\Users\xxx\work\Github\Mbed\BluetoothLEGap\mbed-os\tools\build_api.py", line 543, in build_project
    binary, _ = toolchain.link_program(resources, build_path, name + "_application")
  File "C:\Users\xxx\work\Github\Mbed\BluetoothLEGap\mbed-os\tools\toolchains\__init__.py", line 644, in link_program
    self.binary(r, elf, bin)
  File "C:\Users\xxx\work\Github\Mbed\BluetoothLEGap\mbed-os\tools\hooks.py", line 34, in wrapper
    res = function(t_self, *args, **kwargs)
  File "C:\Users\xxx\work\Github\Mbed\BluetoothLEGap\mbed-os\tools\toolchains\gcc.py", line 289, in binary
    self.default_cmd(cmd)
  File "C:\Users\xxx\work\Github\Mbed\BluetoothLEGap\mbed-os\tools\toolchains\__init__.py", line 668, in default_cmd
    raise ToolException(_stderr)
tools.utils.ToolException: b'arm-none-eabi-objcopy: .\\BUILD\\NRF52_DK\\GCC_ARM\\BluetoothLEGap_application.hex 64-bit address 0x4b4fa300023000 out of range for Intel Hex file\r\narm-none-eabi-objcopy:.\\BUILD\\NRF52_DK\\GCC_ARM\\BluetoothLEGap_application.hex: bad value\r\n'
[mbed] ERROR: "c:\python37\python.exe" returned error.
       Code: 1
       Path: "C:\Users\xxx\work\Github\Mbed\BluetoothLEGap"
       Command: "c:\python37\python.exe -u C:\Users\xxx\work\Github\Mbed\BluetoothLEGap\mbed-os\tools\make.py -t GCC_ARM -m NRF52_DK --source . --build .\BUILD\NRF52_DK\GCC_ARM -v"
       Tip: You could retry the last command with "-v" flag for verbose output
---
[mbed] WARNING: Using Python 3 with Mbed OS 5.8 and earlier can cause errors with compiling, testing and exporting

In a word, the errror is: [DEBUG] Return: 1 [DEBUG] Errors: b'arm-none-eabi-objcopy: .
BUILD
NRF52_DK
GCC_ARM
BluetoothLEGap_application.hex 64-bit address 0x4b4fa300023000 out of range for Intel Hex file' [DEBUG] Errors: b'arm-none-eabi-objcopy:.
BUILD
NRF52_DK
GCC_ARM
BluetoothLEGap_application.hex: bad value' Traceback (most recent call last):

posted by Kai Ren 06 Jan 2019

1 Answer

5 years, 10 months ago.

Hi Kai,

We've taken the liberty to edit your post to include the <<code>> and <</code>> tags to improve the legibility. You can check the "Editing tips" for ways to improve formatting.

We think the underlying problem is here:

[Warning] @,: Compiler version mismatch: Have 8.2.1; expected version >= 6.0.0 and < 7.0.0

Officially Mbed supports gcc v6. Could you try dropping down to version 6? It's not clear how 64-bit addresses are being formed - we really doubt a v8-A compiler could get this far building for Mbed, but perhaps.

Here is a link where you can find the v6 2017 Q2 update:

Regards,

Ralph, Team Mbd

Accepted Answer

Thanks Ralph, the version of GCC compiler is the problem, following your suggestion, I just fixed it, thanks. I also close this issue on Github, https://github.com/ARMmbed/mbed-os/issues/9265

posted by Kai Ren 08 Jan 2019