Request: Thingy-91x support in DevAcademy Intermediate Exercise 3 – DFU with external flash

https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-9-bootloaders-and-dfu-fota/topic/exercise-3-dfu-with-external-flash/

I have this exercise building under SDKv3.0.2/Windows11/VScode and running on a nrf5340dk board.

thingy-x91 (an active nRF product with an nRF5340 & spi external flash) is not listed on the exercise web page above as supported

>would it be possible to add thingy-91x or better time wise for you to reply here with the necessary changes?

https://www.nordicsemi.com/Products/Development-hardware/Nordic-Thingy-91-X

https://docs.nordicsemi.com/bundle/ug_thingy91x/page/UG/thingy91x/hw_description/ext_memory.html 

I have tried to make it work but keep running into failures after 'add build configuration' - generate phase with errors like;

error: Aborting due to Kconfig warnings

-- Configuring incomplete, errors occurred!
See also "C:/Nordic/myapps/blinky_external_flash/build/CMakeFiles/CMakeOutput.log"

That log file contains only one line;

The system is: Windows - 10.0.26100 - AMD64

I am still learning how to troubleshoot generate phase problems.  It's not like traditional build/compiler/linker error troubleshooting.

It's not clear where some of the symbols come from in build\_sysbuild\autoconf.h for instance.

This file for thingy:91x/nrf5340/app is created with many changes vs a working build for the 5340dk/nrf5340/app, with it not being clear to me yet where the changes originate and how to control using prj.conf/, sysbuild.conf, sysbuild/mcuboot..conf files even after completing all devAcademy exercises thus far.

Some tips on how to setup thingx-91x for this exercise would be very helpful and time saving.

Thanks in advance.

Parents
  • Hi again Richard,

    The DevAcademy team has clarified that the nRF Connect SDK Intermediate course is intentionally limited to Nordic DKs. Their reasoning is that many exercises depend on features like the onboard debugger, which Thingy devices lack. Supporting Thingies would require adding extra logic and exceptions throughout the course content, making the exercises more complex and less focused. The goal is to keep the material simple and easy to follow, and adding support for Thingy devices would make it more complicated.

Reply
  • Hi again Richard,

    The DevAcademy team has clarified that the nRF Connect SDK Intermediate course is intentionally limited to Nordic DKs. Their reasoning is that many exercises depend on features like the onboard debugger, which Thingy devices lack. Supporting Thingies would require adding extra logic and exceptions throughout the course content, making the exercises more complex and less focused. The goal is to keep the material simple and easy to follow, and adding support for Thingy devices would make it more complicated.

Children
  • Thanks for the update.

    I should have mentioned, am using an external JTAG/SWD adapter (Segger) with the Thingy-91x to flash and debug - via the nice front panel connection on the board provided for this essential tool.  This works very well.

    It would be reasonable to note in dev acadamy that non DK Nordic products are supported this way and that flashing using other means is out of scope for the course (or link to instructions you have elsewhere on the site)

    BTW, I found a work around by modifying a copy of the thingy-91x board directory as below;

    ncs/v3.0.2/nrf/boards/nordic/thingy91x/Kconfig.defconfig.nrf5340

    Change 'y' to 'n' below.

    config BOOTLOADER_MCUBOOT
    default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS

    This works but is there a better way to override this in the application configuration?  My newbie attempts to change the config result in configuration/build failures as you see up thread.

  • The recommended way of modifying Kconfig symbols is in the prj.conf file. The application configuration always takes precedence. Did you manage to do this exercise on the Thingy91:X? I guess porting the configuration files is a good exercise in itself.

  • >The recommended way of modifying Kconfig symbols is in the prj.conf file.

    I tried that and got build configuration errors.

    For MCUBOOT I've learned you need to add sysbuild.conf file and discover certain settings.

    In the below log, I do this for nrf5340dk board just fine, but when I try with thingy91x the build fails with config errors.  This is when I had to make a copy of the thingy-91x an make the change above to work around the problem.

    ----

    Test MCU boot options using standard blinky example with no changes or added configuration files.

    west build -b thingy91x/nrf5340/cpuapp --build-dir build_thingy91x_nrf5340_cpuapp --pristine

      Ok with no changes to prj.conf

    west flash –erase --build-dir build_thingy91x_nrf5340_cpuapp

    Modify flash rate in main.c, rebuild (no pristine), reflash - works

    west build -b thingy91x/nrf5340/cpuapp --build-dir build_thingy91x_nrf5340_cpuapp

    west flash --build-dir build_thingy91x_nrf5340_cpuapp

    Check partitions. Shows has mcu boot by default, only 272KB available for app code.

    rgjones@thelio:~/nordic/blinky$ 

    west build --build-dir build_thingy91x_nrf5340_cpuapp -t partition_manager_report 

    -- west build: running target partition_manager_report

    [1/1] cd /home/rgjones/nordic/blinky/build_thingy91x...build_thingy91x_nrf5340_cpuapp/partitions_CPUNET.yml

      <<Not sure why it says CPUNET above, the build was for cpuapp>>

      flash_primary (0x100000 - 1024kB): 

    +--------------------------------------------------+

    +---0x0: b0_container (0x8000 - 32kB)--------------+

    | 0x0: b0 (0x8000 - 32kB)                          |

    +---0x8000: s0 (0x14000 - 80kB)--------------------+

    | 0x8000: s0_pad (0x200 - 512B)                    |

    +---0x8200: s0_image (0x13e00 - 79kB)--------------+

    | 0x8200: mcuboot (0x13e00 - 79kB)                 |

    +---0x1c000: s1 (0x14000 - 80kB)-------------------+

    | 0x1c000: s1_pad (0x200 - 512B)                   |

    | 0x1c200: s1_image (0x13e00 - 79kB)               |

    +---0x30000: mcuboot_primary (0x44000 - 272kB)-----+

    | 0x30000: mcuboot_pad (0x200 - 512B)              |

    +---0x30200: app_image (0x43e00 - 271kB)-----------+

    +---0x30200: mcuboot_primary_app (0x43e00 - 271kB)-+

    | 0x30200: app (0x43e00 - 271kB)                   |

    +--------------------------------------------------+

    | 0x74000: mcuboot_secondary (0x44000 - 272kB)     |

    | 0xb8000: mcuboot_secondary_1 (0x40000 - 256kB)   |

    | 0xf8000: settings_storage (0x8000 - 32kB)        |

    +--------------------------------------------------+

    try same thing on nrf5340dk board (works fine)- default has no MCU boot, full 1M available for app code.

    west build -b nrf5340dk/nrf5340/cpuapp --build-dir build_5340dk_nrf5340_cpuapp --pristine

    west flash --erase --build-dir build_5340dk_nrf5340_cpuapp

    west build --build-dir build_5340dk_nrf5340_cpuapp -t partition_manager_report 

    -- west build: running target partition_manager_report

    [1/1] cd /home/rgjones/nordic/blinky/build_5340dk_nr...ic/blinky/build_5340dk_nrf5340_cpuapp/partitions.yml

      flash_primary (0x100000 - 1024kB): 

    +------------------------------+

    | 0x0: app (0x100000 - 1024kB) |

    +------------------------------+

    No MCUBOOT by default - lets add it in to make sure have the config files correct.

    Add sysbuild.conf (suggest include this file with comments in examples -saves time for new users)

    rgjones@thelio:~/nordic/blinky$ cat sysbuild.conf 

    # MCUboot

    SB_CONFIG_BOOTLOADER_MCUBOOT=y

    # single image override, default is two images

    SB_CONFIG_MCUBOOT_MODE_SINGLE_APP=y

    Pristine build, flash (works), check partitions - has mcuboot and single section 975K for app code

    rgjones@thelio:~/nordic/blinky$ west build --build-dir build_5340dk_nrf5340_cpuapp -t partition_manager_report 

    -- west build: running target partition_manager_report

    [1/1] cd /home/rgjones/nordic/blinky/build_5340dk_nr...ic/blinky/build_5340dk_nrf5340_cpuapp/partitions.yml

      flash_primary (0x100000 - 1024kB): 

    +-------------------------------------------------+

    | 0x0: mcuboot (0xc000 - 48kB)                    |

    +---0xc000: mcuboot_primary (0xf4000 - 976kB)-----+

    | 0xc000: mcuboot_pad (0x200 - 512B)              |

    +---0xc200: mcuboot_primary_app (0xf3e00 - 975kB)-+

    | 0xc200: app (0xf3e00 - 975kB)                   |

    +-------------------------------------------------+

    Same setup - build for thingy91x - should get same partition?  - instead build fails

    west build -b thingy91x/nrf5340/cpuapp --build-dir build_thingy91x_nrf5340_cpuapp --pristine

    Log output;

    rgjones@thelio:~/nordic/blinky$ west build -b thingy91x/nrf5340/cpuapp --build-dir build_thingy91x_nrf5340_cpuapp --pristine
    -- west build: making build dir /home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp pristine
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /home/rgjones/ncs/toolchains/7cbc0036f4/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /home/rgjones/.cache/zephyr
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: thingy91x, qualifiers: nrf5340/cpuapp
    Parsing /home/rgjones/ncs/v3.0.2/zephyr/share/sysbuild/Kconfig
    Loaded configuration '/home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/_sysbuild/empty.conf'
    Merged configuration '/home/rgjones/nordic/blinky/sysbuild.conf'
    Configuration saved to '/home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/zephyr/.config'
    Kconfig header saved to '/home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/_sysbuild/autoconf.h'
    --
    *****************************
    * Running CMake for mcuboot *
    *****************************

    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: /home/rgjones/ncs/toolchains/7cbc0036f4/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /home/rgjones/.cache/zephyr
    -- Zephyr version: 4.0.99 (/home/rgjones/ncs/v3.0.2/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: thingy91x, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 0.17.0 (/home/rgjones/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/rgjones/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk)
    -- Found Dtc: /home/rgjones/ncs/toolchains/7cbc0036f4/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/rgjones/ncs/v3.0.2/nrf/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp.dts
    -- Found devicetree overlay: /home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/app.overlay
    -- Found devicetree overlay: /home/rgjones/ncs/v3.0.2/nrf/modules/mcuboot/flash_sim.overlay
    -- Generated zephyr.dts: /home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/mcuboot/zephyr/zephyr.dts
    -- Generated pickled edt: /home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/mcuboot/zephyr/edt.pickle
    -- Generated zephyr.dts: /home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/mcuboot/zephyr/dts.cmake

    warning: BOOT_SERIAL_IMG_GRP_IMAGE_STATE (defined at
    /home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/Kconfig.serial_recovery:204) was assigned
    the value 'y' but got the value 'n'. Check these unsatisfied dependencies:
    (!SINGLE_APPLICATION_SLOT) (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look
    up BOOT_SERIAL_IMG_GRP_IMAGE_STATE 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.


    warning: UPDATEABLE_IMAGE_NUMBER (defined at
    /home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/Kconfig:933,
    /home/rgjones/ncs/v3.0.2/nrf/boards/nordic/thingy91x/Kconfig.defconfig.nrf5340:92,
    /home/rgjones/ncs/v3.0.2/nrf/samples/common/mcumgr_bt_ota_dfu/Kconfig:99, subsys/dfu/Kconfig:96) was
    assigned the value '2' but got the value '1'. See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    UPDATEABLE_IMAGE_NUMBER 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.


    warning: UART_NRFX (defined at drivers/serial/Kconfig.nrfx:6) was assigned the value 'y' but got the
    value 'n'. Check these unsatisfied dependencies: (DT_HAS_NORDIC_NRF_UART_ENABLED ||
    DT_HAS_NORDIC_NRF_UARTE_ENABLED) (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up UART_NRFX 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.


    warning: LOG_DEFAULT_LEVEL (defined at subsys/logging/Kconfig.filtering:13) was assigned the value
    '0' but got the value ''. Check these unsatisfied dependencies: LOG (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    LOG_DEFAULT_LEVEL 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.


    warning: The choice symbol BOOT_UPGRADE_ONLY (defined at
    /home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/Kconfig:495) was selected (set =y), but no
    symbol ended up as the choice selection. See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    BOOT_UPGRADE_ONLY 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.


    warning: The choice symbol MCUBOOT_LOG_LEVEL_INF (defined at
    subsys/logging/Kconfig.template.log_config:17) was selected (set =y), but no symbol ended up as the
    choice selection. See docs.zephyrproject.org/.../kconfig.html
    and/or look up MCUBOOT_LOG_LEVEL_INF 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.


    warning: The choice symbol LOG_MODE_MINIMAL (defined at subsys/logging/Kconfig.mode:29) was selected
    (set =y), but no symbol ended up as the choice selection. See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    LOG_MODE_MINIMAL 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.


    warning: Deprecated symbol SOC_DCDC_NRF53X_APP is enabled.


    warning: Deprecated symbol SOC_DCDC_NRF53X_NET is enabled.


    warning: Deprecated symbol NFCT_PINS_AS_GPIOS is enabled.


    warning: Deprecated symbol DEPRECATED_UART_NRFX_UARTE_LEGACY_SHIM is enabled.


    warning: user value 2 on the int symbol UPDATEABLE_IMAGE_NUMBER (defined at /home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/Kconfig:933, /home/rgjones/ncs/v3.0.2/nrf/boards/nordic/thingy91x/Kconfig.defconfig.nrf5340:92, /home/rgjones/ncs/v3.0.2/nrf/samples/common/mcumgr_bt_ota_dfu/Kconfig:99, subsys/dfu/Kconfig:96) ignored due to being outside the active range ([1, 1]) -- falling back on defaults
    Parsing /home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration '/home/rgjones/ncs/v3.0.2/nrf/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration '/home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/boards/thingy91x_nrf5340_cpuapp.conf'
    Merged configuration '/home/rgjones/ncs/v3.0.2/nrf/subsys/bootloader/image/log_minimal.conf'
    Merged configuration '/home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/external_crypto.conf'
    Merged configuration '/home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/mcuboot/zephyr/.config.sysbuild'

    error: Aborting due to Kconfig warnings

    CMake Error at /home/rgjones/ncs/v3.0.2/zephyr/cmake/modules/kconfig.cmake:396 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    /home/rgjones/ncs/v3.0.2/nrf/cmake/modules/kconfig.cmake:36 (include)
    /home/rgjones/ncs/v3.0.2/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
    /home/rgjones/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    /home/rgjones/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:18 (find_package)


    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
    CMake configure failed for Zephyr project: mcuboot

    Location: /home/rgjones/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/
    Call Stack (most recent call first):
    cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
    cmake/modules/sysbuild_default.cmake:21 (include)
    /home/rgjones/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
    /home/rgjones/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    /home/rgjones/ncs/v3.0.2/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
    template/CMakeLists.txt:10 (find_package)


    -- Configuring incomplete, errors occurred!
    See also "/home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: /home/rgjones/ncs/toolchains/7cbc0036f4/usr/local/bin/cmake -DWEST_PYTHON=/home/rgjones/ncs/toolchains/7cbc0036f4/usr/local/bin/python3.12 -B/home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp -GNinja -DBOARD=thingy91x/nrf5340/cpuapp -S/home/rgjones/ncs/v3.0.2/zephyr/share/sysbuild -DAPP_DIR:PATH=/home/rgjones/nordic/blinky

    rgjones@thelio:~/nordic/blinky$ cat /home/rgjones/nordic/blinky/build_thingy91x_nrf5340_cpuapp/CMakeFiles/CMakeOutput.log
    The system is: Linux - 6.14.0-24-generic - x86_64

  • I'll give a general overview:

    When building an application in Zephyr, the build system uses the .config file to determine all configuration symbols. This file is generated from a combination of board-specific KConfig files and the project's prj.conf file.

    For hardware descriptions, the final device tree is represented in zephyr.dts. This file is composed of board-specific device tree files and any user-defined overlay files.

    Porting this exercise to the Thingy board isn't straightforward. The device tree overlays must be modified, as it won't match what is used in the exercise (e.g., external flash, buttons, etc.).

    It's also difficult for me to analyze your build log without knowing what changes you've made. If you have further questions, feel free to upload your application files and I can take a closer look.

    Note on autoconf.h:
    This is a C header file containing preprocessor definitions derived from the .config file.

Related