Can't Upload hex file that build for nrf9160 to thingy91

Hi there.

I am currently learning mqtt_simple from the nrf sdk example. So, I was trying to create a hex file that build using nrf9160, because I can't build it on thingy91, I got error.

Here it the error when I build it for thingy91. (Sorry I can't paste it in code section on the editor, so I just paste it below).

FAILED: zephyr/zephyr.elf zephyr/zephyr.map zephyr/zephyr.hex zephyr/zephyr.bin zephyr/zephyr.meta zephyr/zephyr.lst zephyr/zephyr.stat
cmd.exe /C "cd . && C:\src\nrf\toolchains\v2.1.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe zephyr/CMakeFiles/zephyr_final.dir/misc/empty_file.c.obj zephyr/CMakeFiles/zephyr_final.dir/dev_handles.c.obj zephyr/CMakeFiles/zephyr_final.dir/isr_tables.c.obj -o zephyr\zephyr.elf -Wl,-T zephyr/linker.cmd -Wl,-Map=C:/nrf/example/mqtt_simple/build_thingy91/mcuboot/zephyr/zephyr_final.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a zephyr/lib/libc/minimal/liblib__libc__minimal.a zephyr/lib/posix/liblib__posix.a zephyr/drivers/clock_control/libdrivers__clock_control.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/flash/libdrivers__flash.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/timer/libdrivers__timer.a zephyr/drivers/pinctrl/libdrivers__pinctrl.a modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a modules/mbedtls/libmodules__mbedtls.a modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj -L"c:/src/nrf/toolchains/v2.1.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/thumb/v8-m.main/nofp" -LC:/nrf/example/mqtt_simple/build_thingy91/mcuboot/zephyr -lgcc -Wl,--print-memory-usage zephyr/arch/common/libisr_tables.a -no-pie -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -Wl,-X -Wl,-N -Wl,--orphan-handling=warn C:/src/nrf/v2.1.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m33/soft-float/no-interrupts/libnrf_cc310_platform_0.9.15.a && cmd.exe /C "cd /D C:\nrf\example\mqtt_simple\build_thingy91\mcuboot\zephyr && C:\src\nrf\toolchains\v2.1.0\opt\bin\cmake.exe -E copy zephyr_final.map zephyr.map && C:\src\nrf\toolchains\v2.1.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-objcopy.exe --gap-fill 0xff --output-target=ihex --remove-section=.comment --remove-section=COMMON --remove-section=.eh_frame zephyr.elf zephyr.hex && C:\src\nrf\toolchains\v2.1.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-objcopy.exe --gap-fill 0xff --output-target=binary --remove-section=.comment --remove-section=COMMON --remove-section=.eh_frame zephyr.elf zephyr.bin && C:\src\nrf\toolchains\v2.1.0\opt\bin\python.exe C:/src/nrf/v2.1.0/zephyr/scripts/zephyr_module.py --zephyr-base C:/src/nrf/v2.1.0/zephyr --meta-out zephyr.meta && C:\src\nrf\toolchains\v2.1.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-objdump.exe -d -S zephyr.elf > zephyr.lst && C:\src\nrf\toolchains\v2.1.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-readelf.exe -e zephyr.elf > zephyr.stat""
Memory region Used Size Region Size %age Used
FLASH: 40140 B 48 KB 81.67%
SRAM: 27008 B 211736 B 12.76%
IDT_LIST: 0 GB 2 KB 0.00%
Traceback (most recent call last):
File "C:/src/nrf/v2.1.0/zephyr/scripts/zephyr_module.py", line 553, in <module>
main()
File "C:/src/nrf/v2.1.0/zephyr/scripts/zephyr_module.py", line 545, in main
meta = process_meta(args.zephyr_base, west_proj, modules,
File "C:/src/nrf/v2.1.0/zephyr/scripts/zephyr_module.py", line 319, in process_meta
if project.sha(MANIFEST_REV_BRANCH) != revision:
File "c:\src\nrf\toolchains\v2.1.0\opt\bin\Lib\site-packages\west\manifest.py", line 861, in sha
cp = self.git(f'rev-parse {rev}^{{commit}}', capture_stdout=True,
File "c:\src\nrf\toolchains\v2.1.0\opt\bin\Lib\site-packages\west\manifest.py", line 845, in git
raise subprocess.CalledProcessError(popen.returncode, cmd_list,
subprocess.CalledProcessError: Command '['rev-parse', 'manifest-rev^{commit}']' returned non-zero exit status 128.
ninja: build stopped: subcommand failed.
[61/298] Generating ../../tfm/CMakeCache.txt
-- The C compiler identification is GNU 10.3.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/src/nrf/toolchains/v2.1.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
-- Found Python3: C:/src/nrf/toolchains/v2.1.0/opt/bin/python.exe (found version "3.8.2") found components: Interpreter
-- Found Python3: C:/src/nrf/toolchains/v2.1.0/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
-- Cache files will be written to: C:/src/nrf/v2.1.0/zephyr/.cache
-- Configuring done
-- Generating done
-- Build files have been written to: C:/nrf/example/mqtt_simple/build_thingy91/tfm
[66/298] No configure step for 'tfm'
FAILED: modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-build mcuboot/zephyr/zephyr.hex mcuboot/zephyr/zephyr.elf
cmd.exe /C "cd /D C:\nrf\example\mqtt_simple\build_thingy91\mcuboot && C:\src\nrf\toolchains\v2.1.0\opt\bin\cmake.exe --build . --"
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'c:\src\nrf\toolchains\v2.1.0\opt\bin\cmake.EXE' --build 'c:\nrf\example\mqtt_simple\build_thingy91'

So I am planning to build it only for chip, but when I check it, it just give me this error.

Anybody has solution for this or what should I change in project configuration files? Thank you.

  • Hello,

    I didn't get you well. Are you trying to upload a hex file build on 9160dk to Thingy91? Or are you trying to build with thingy91_nrf9160_ns and it's not working? And can you paste the error using the option insert--> code in the editor (checked and it's working now). I am confused because if your build didn't went well then which file are you trying to upload?

    Kind Regards,

    Abhijith

  • Sorry, I mean I want to use gnss location example code on thingy91. But as you know that example are made for nrf9160, so I am trying to build it as thingy91, but I got that error message that I have shown in the first message.

    Sorry, I was trying to put it as code, but I can't do that, because the editor won't process that long message.

    So, I am build it as nrf9160 as well, but I can't upload it to the thingy91, it gives me that message.

  • Hello,

    Sorry it's bit confusing.

    Just to confirm, are you trying location sample (ncs\v2.1.0\nrf\samples\nrf9160) or gnss sample (ncs\v2.1.0\nrf\samples\nrf9160\gnss)?

    From the screenshot you shared, looks like you are trying to upload mqtt_simple example from the SDK. And other making the  thingy91 in bootloader  mode for uploading the image? Other wise you need to use an external debugger for doing this.

    Kind Regards,

    Abhijith

Related