Hey, the board is alive again - thanks! Now the problem is my toolchain…
The merged hex file from nfed_v2 restores the board. Building my own, however, is no-work. A fault is happening from what I can tell from the map file, but I have no clue on why/what/where. The output from “west build” looks perfectly normal.
NCS v2.5.1. Same results with NCS v2.4.0.
blinky sample:
prj.conf
CONFIG_GPIO=y
CONFIG_NO_OPTIMIZATIONS=y
CONFIG_BOOTLOADER_MCUBOOT=y
west build
$ rm -rf build
$ west build -b circuitdojo_feather_nrf9160_ns
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky
-- CMake version: 3.28.3
-- Found Python3: /opt/homebrew/opt/python@3.11/bin/python3.11 (found suitable version "3.11.8", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: /Users/mikaelj/Library/Caches/zephyr
-- Zephyr version: 3.4.99 (/opt/nordic/ncs/v2.5.1/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: circuitdojo_feather_nrf9160_ns
-- Found host-tools: zephyr 0.16.1 (/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.1 (/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk)
-- Found Dtc: /opt/homebrew/bin/dtc (found suitable version "1.7.0", minimum required is "1.4.6")
-- Found BOARD.dts: /opt/nordic/ncs/v2.5.1/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_ns.dts
-- Generated zephyr.dts: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/zephyr/dts.cmake
Parsing /opt/nordic/ncs/v2.5.1/zephyr/Kconfig
Loaded configuration '/opt/nordic/ncs/v2.5.1/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_ns_defconfig'
Merged configuration '/Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/prj.conf'
Configuration saved to '/Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/zephyr/.config'
Kconfig header saved to '/Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/zephyr/include/generated/autoconf.h'
-- Found GnuLd: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Found Python3: /opt/homebrew/opt/python@3.11/bin/python3.11 (found version "3.11.8") found components: Interpreter
Changed board to secure circuitdojo_feather_nrf9160 (NOT NS)
=== child image mcuboot - begin ===
loading initial cache file /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/mcuboot/child_image_preload.cmake
Loading Zephyr default modules (Zephyr base).
-- Application: /opt/nordic/ncs/v2.5.1/bootloader/mcuboot/boot/zephyr
-- CMake version: 3.28.3
-- Found Python3: /opt/homebrew/opt/python@3.11/bin/python3.11 (found suitable version "3.11.8", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: /Users/mikaelj/Library/Caches/zephyr
-- Zephyr version: 3.4.99 (/opt/nordic/ncs/v2.5.1/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: circuitdojo_feather_nrf9160
-- Found host-tools: zephyr 0.16.1 (/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.1 (/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk)
-- Found Dtc: /opt/homebrew/bin/dtc (found suitable version "1.7.0", minimum required is "1.4.6")
-- Found BOARD.dts: /opt/nordic/ncs/v2.5.1/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160.dts
-- Found devicetree overlay: /opt/nordic/ncs/v2.5.1/bootloader/mcuboot/boot/zephyr/app.overlay
-- Generated zephyr.dts: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/mcuboot/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/mcuboot/zephyr/dts.cmake
warning: UART_CONSOLE (defined at drivers/console/Kconfig:43) was assigned the value 'y' but got the
value 'n'. Check these unsatisfied dependencies: CONSOLE (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_UART_CONSOLE and/or look up UART_CONSOLE in
the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.
Parsing /opt/nordic/ncs/v2.5.1/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration '/opt/nordic/ncs/v2.5.1/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_defconfig'
Merged configuration '/opt/nordic/ncs/v2.5.1/bootloader/mcuboot/boot/zephyr/prj.conf'
Merged configuration '/opt/nordic/ncs/v2.5.1/bootloader/mcuboot/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf'
Merged configuration '/opt/nordic/ncs/v2.5.1/nrf/modules/mcuboot/tfm.conf'
Merged configuration '/opt/nordic/ncs/v2.5.1/nrf/modules/mcuboot/fih_low_enable.conf'
Merged configuration '/opt/nordic/ncs/v2.5.1/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Merged configuration '/Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/mcuboot/zephyr/.config'
Kconfig header saved to '/Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/mcuboot/zephyr/include/generated/autoconf.h'
-- Found GnuLd: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
MCUBoot bootloader key file: /opt/nordic/ncs/v2.5.1/bootloader/mcuboot/root-ec-p256.pem
-- Configuring done (2.7s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/mcuboot
=== child image mcuboot - end ===
CMake Warning at /opt/nordic/ncs/v2.5.1/nrf/modules/mcuboot/CMakeLists.txt:320 (message):
---------------------------------------------------------
--- WARNING: Using default MCUBoot key, it should not ---
--- be used for production. ---
---------------------------------------------------------
CMake Warning at /opt/nordic/ncs/v2.5.1/nrf/cmake/partition_manager.cmake:79 (message):
---------------------------------------------------------------------
--- WARNING: Using a bootloader without pm_static.yml. ---
--- There are cases where a deployed product can consist of ---
--- multiple images, and only a subset of these images can be ---
--- upgraded through a firmware update mechanism. In such cases, ---
--- the upgradable images must have partitions that are static ---
--- and are matching the partition map used by the bootloader ---
--- programmed onto the device. ---
---------------------------------------------------------------------
Call Stack (most recent call first):
/opt/nordic/ncs/v2.5.1/zephyr/cmake/modules/kernel.cmake:247 (include)
/opt/nordic/ncs/v2.5.1/zephyr/cmake/modules/zephyr_default.cmake:138 (include)
/opt/nordic/ncs/v2.5.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
/opt/nordic/ncs/v2.5.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
CMakeLists.txt:6 (find_package)
Dropping partition 'nrf_modem_lib_trace' since its size is 0.
Dropping partition 'nonsecure_storage' since it is empty.
-- Configuring done (7.1s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build
-- west build: building application
[1/241] Preparing syscall dependency handling
[8/241] Performing build step for 'mcuboot_subimage'
[1/211] Preparing syscall dependency handling
[5/211] Generating include/generated/version.h
-- Zephyr version: 3.4.99 (/opt/nordic/ncs/v2.5.1/zephyr), build: v3.4.99-ncs1-1
[211/211] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 48484 B 48 KB 98.64%
RAM: 24584 B 32 KB 75.02%
IDT_LIST: 0 GB 2 KB 0.00%
[9/241] Generating include/generated/version.h
-- Zephyr version: 3.4.99 (/opt/nordic/ncs/v2.5.1/zephyr), build: v3.4.99-ncs1-1
[14/241] Generating ../../tfm/CMakeCache.txt
CMake Warning at cmake/version.cmake:22 (message):
Actual TF-M version is not available from Git repository. Settled to
v1.8.0
Call Stack (most recent call first):
CMakeLists.txt:22 (include)
-- Found Git: /opt/homebrew/bin/git (found version "2.42.0")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Found Python3: /opt/homebrew/opt/python@3.11/bin/python3.11 (found version "3.11.8") found components: Interpreter
CMake Deprecation Warning at /opt/nordic/ncs/v2.5.1/zephyr/cmake/modules/FindDeprecated.cmake:121 (message):
'PYTHON_PREFER' variable is deprecated. Please use Python3_EXECUTABLE
instead.
Call Stack (most recent call first):
/opt/nordic/ncs/v2.5.1/zephyr/cmake/modules/python.cmake:16 (find_package)
/opt/nordic/ncs/v2.5.1/zephyr/cmake/modules/user_cache.cmake:30 (include)
/opt/nordic/ncs/v2.5.1/zephyr/cmake/modules/extensions.cmake:5 (include)
/opt/nordic/ncs/v2.5.1/nrf/subsys/nrf_security/tfm/CMakeLists.txt:36 (include)
-- Found Python3: /opt/homebrew/opt/python@3.11/bin/python3.11 (found suitable version "3.11.8", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: /Users/mikaelj/Library/Caches/zephyr
-- Configuring done (1.3s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/tfm
[20/241] Performing build step for 'tfm'
[153/157] Linking C executable bin/tfm_s.axf
Memory region Used Size Region Size %age Used
FLASH: 31544 B 32256 B 97.79%
RAM: 18832 B 32 KB 57.47%
[157/157] Linking C static library secure_fw/libtfm_s_veneers.a
[24/241] Performing install step for 'tfm'
-- Install configuration: "RelWithDebInfo"
[232/241] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 61080 B 448 KB 13.31%
RAM: 4772 B 211608 B 2.26%
IDT_LIST: 0 GB 2 KB 0.00%
[236/241] Generating ../../zephyr/app_update.bin
image.py: sign the payload
[237/241] Generating ../../zephyr/app_signed.hex
image.py: sign the payload
[239/241] Generating ../../zephyr/app_test_update.hex
image.py: sign the payload
[241/241] Generating zephyr/merged.hex
$
debug zephyr.elf
$ /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb
GNU gdb (Zephyr SDK 0.16.1) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-host_apple-darwin --target=arm-zephyr-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://github.com/zephyrproject-rtos/sdk-ng/issues>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) target extended-remote /opt/bmp
Remote debugging using /opt/bmp
(gdb) monitor swd_scan
Target voltage: 3.3V
Available Targets:
No. Att Driver
1 Nordic nRF9160 M33
(gdb) att 1
Attaching to Remote target
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x00007b90 in ?? ()
(gdb) file build/zephyr/zephyr.elf
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from build/zephyr/zephyr.elf...
(gdb) load build/zephyr/zephyr.elf
Loading section rom_start, size 0x144 lma 0x18000
Loading section text, size 0xe6a0 lma 0x18144
Loading section .ARM.exidx, size 0x8 lma 0x267e4
Loading section initlevel, size 0x60 lma 0x267ec
Loading section device_area, size 0x64 lma 0x2684c
Loading section sw_isr_table, size 0x208 lma 0x268b0
Loading section log_const_area, size 0x60 lma 0x26ab8
Loading section rodata, size 0x278 lma 0x26b20
Loading section datas, size 0xb0 lma 0x26db0
Loading section device_states, size 0xa lma 0x26e60
Loading section k_heap_area, size 0x14 lma 0x26e6c
Loading section k_mutex_area, size 0x14 lma 0x26e80
Loading section .last_section, size 0x4 lma 0x26e94
Start address 0x000197d8, load size 61046
Transfer rate: 29 KB/sec, 836 bytes/write.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: .../blinky/build/zephyr/zephyr.elf
^C
Program received signal SIGINT, Interrupt.
0x00007b90 in ?? ()
(gdb) bt
#0 0x00007b90 in ?? ()
#1 0x00000530 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
Checking up the address of the crash. Looks like it’s in fatal.c (see below)
relevant parts of zephyr.map
.debug_info 0x0000000000005e57 0x2200 zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a(fatal.c.obj)
.debug_info 0x0000000000008057 0x995 zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a(irq_manage.c.obj)
debug merged.hex
(gdb) file build/zephyr/merged.hex
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from build/zephyr/merged.hex...
(No debugging symbols found in build/zephyr/merged.hex)
(gdb) load build/zephyr/merged.hex
Loading section .sec1, size 0xbd64 lma 0x0
Loading section .sec2, size 0x10000 lma 0x10000
Loading section .sec3, size 0x6f2f lma 0x20000
Start address 0x00000000, load size 142483
Transfer rate: 29 KB/sec, 962 bytes/write.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /Users/mikaelj/code/goride/centralstationen/nrf9160/vscode-nrf-sdk-test-2024-02-28/blinky/build/zephyr/merged.hex
Program received signal SIGSEGV, Segmentation fault.
0x00000002 in ?? ()
(gdb)
🙁
pre-built blinky (nfed_v2)
$ /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb
GNU gdb (Zephyr SDK 0.16.1) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-host_apple-darwin --target=arm-zephyr-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://github.com/zephyrproject-rtos/sdk-ng/issues>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) target extended-remote /opt/bmp
Remote debugging using /opt/bmp
(gdb) monitor swd_scan
Target voltage: 3.3V
Available Targets:
No. Att Driver
1 Nordic nRF9160 M33
(gdb) att 1
Attaching to Remote target
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x00007b90 in ?? ()
(gdb) file ~/Downloads/nfed_v2/blinky_circuitdojo_feather_nrf9160_ns_merged.hex
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from ~/Downloads/nfed_v2/blinky_circuitdojo_feather_nrf9160_ns_merged.hex...
(No debugging symbols found in ~/Downloads/nfed_v2/blinky_circuitdojo_feather_nrf9160_ns_merged.hex)
(gdb) load ~/Downloads/nfed_v2/blinky_circuitdojo_feather_nrf9160_ns_merged.hex
Loading section .sec1, size 0xad44 lma 0x0
Loading section .sec2, size 0xd4bf lma 0x10000
Start address 0x00000000, load size 98819
Transfer rate: 28 KB/sec, 968 bytes/write.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: .../Downloads/nfed_v2/blinky_circuitdojo_feather_nrf9160_ns_merged.hex
^C
Program received signal SIGINT, Interrupt.
0x00019192 in ?? ()
(gdb)
….and this is blinking happily.
I’m scratching my head.