Problems building an example (matter light bulb) on a "custom board" that is identically configured as the dev kit nRF54L15DK

Hi everyone,

I'm using the nRF Connect SDK 3.0.2 and the nRF Connect Toolchain 3.0.1 with the matter ‘light_bulb’ example.

I just want to do the following:

1) Get exactly the same binary file merged.hex, but created with my own custom board files, e.g. board ‘myDK’.
2) As a second step, disable the use of the external flash memory mx25r64, creating a new partition table (just 2 smaller partitions inside the internal flash)

Sounds simple, but I'm having problems with it.

My first steps with the SDK were really promising. The examples work right away, but every change led to errors.

I've tried a lot:
Create my own board files (with VSCode-Wizzard) – within the project, outside in a separate directory. Change/create overlays and pm_static* but in the end all failed with errors regarding the mcuboot partition settings, missing arguments für --size and --offset, missing FLASH_DEVICE_ID etc.

I was working in bare metal projects for years now and wanted to see how a "state-of-the-art" SDK feel like, but it's very frustrating ...

What is the easiest way to accomplish this? Is shouldn't be that much of actions necessary!? The first part took only 2 minutes, but it does not build.

Thank you for your help!

/NoRG

Parents
  • Yes, these are the detailed steps:

    - create an application by copying the light_bulb example
    - create build config "build" -> works
    - create board "mydk" in an external folder, added path to BOARD_ROOT (settings of VS-Extension)
    - create build config "myDKConf" wit board "mydk", base config: prj.conf

    [11/23] Generating new Factory Data...
    FAILED: light_bulb_mydk/zephyr/factory_data.hex ... nrfconnect/nrfconnect_factory_data.schema --offset  --size
    generate_nrfconnect_chip_factory_data.py: error: argument --offset: expected one argument

    - pm_static_nrf54l15dk_nrf54l15_cpuapp.yml nach pm_static_mydk_nrf54l15_cpuapp.yml kopiert

    -> Partition manager failed: Incorrect amount of gaps found in static configuration. There must be exactly one gap in the static configuration to support placing the dynamic partitions (such as 'app'). Gaps found (2):0xd800-0x165000 0x17d000-0x172000 The most common solution to this problem is to fill the smallest of these gaps with statically defined partition(s) until there is only one gap left. Alternatively re-order the already defined static partitions so that only one gap remains.
    Failed to partition region flash_primary, size of region: 1462272

    (base) xxx:projects/nordic/light_bulb_mydk $ find . -name \*.overlay       
    ./sysbuild/mcuboot/app.overlay
    ./sysbuild/mcuboot/boards/nrf7002dk_nrf5340_cpuapp.overlay
    ./sysbuild/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay
    ./sysbuild/mcuboot/boards/nrf52840dk_nrf52840.overlay
    ./sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp.overlay
    ./boards/nrf7002dk_nrf5340_cpuapp.overlay
    ./boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay
    ./boards/nrf5340dk_nrf5340_cpuapp.overlay
    ./boards/nrf21540dk_nrf52840.overlay
    ./boards/nrf52840dk_nrf52840.overlay
    ./boards/nrf54l15dk_nrf54l15_cpuapp.overlay

    Where shall I put what overlay?

    I did:

    - sysbuild/mcuboot/boards $ cp nrf54l15dk_nrf54l15_cpuapp.conf mydk_nrf54l15_cpuapp.conf
    - sysbuild/mcuboot/boards $ cp nrf54l15dk_nrf54l15_cpuapp.overlay mydk_nrf54l15_cpuapp.overlay

    -> 

    - Found devicetree overlay: projects/nordic/light_bulb_mydk/sysbuild/mcuboot/boards/mydk_nrf54l15_cpuapp.overlay
    devicetree error: projects/nordic/light_bulb_mydk/sysbuild/mcuboot/boards/mydk_nrf54l15_cpuapp.overlay:23 (column 1): parse error: undefined node label 'mx25r64'
    CMake Error at /opt/nordic/ncs/v3.0.2/zephyr/cmake/modules/dts.cmake:305 (execute_process):
      execute_process failed command indexes:

    Whatever I do, I get always new funny error messages ...

    No idea what to do. And this is only part 1 where I just want get a clone of my DK.

    /NoRG

  • Hi,

    Can you share the complete build log?

    Please also share your board files and project so I can test it on my side.

    Best regards,
    Marte

  • Hi Marte,

    thanks for the quick reply. I would say it's easier to do these few steps in a clean SDK environment:

    - Create a custom board
    - Generate a new app as a copy of the Matter light_bulb app
    - build it with the new custom board

    I've tried so many versions, but without success. I'd be surprised if it works for you in first place ;-)

    But of course, I can send you my project and the board directory. Can I send you a PM?

    Best regards

    /NoRG

Reply
  • Hi Marte,

    thanks for the quick reply. I would say it's easier to do these few steps in a clean SDK environment:

    - Create a custom board
    - Generate a new app as a copy of the Matter light_bulb app
    - build it with the new custom board

    I've tried so many versions, but without success. I'd be surprised if it works for you in first place ;-)

    But of course, I can send you my project and the board directory. Can I send you a PM?

    Best regards

    /NoRG

Children
  • Hi,

    I have made a version of the light bulb and a custom nRF54L15 board that builds. Please check if this fixes your problem, and let me know if you have any issues.

    Here are the things I did.

    Light bulb sample:

    • Added board Kconfig and overlay file under boards/
    • Added board Kconfig and overlay file under sysbuild/mcuboot/boards/
    • Added static partition file

    Board files

    • Generated the board with "create new board" in VS Code
    • Created the following files:
      • custom_nrf54l15dk_common.dtsi: copied everything from nrf54l15dk_common.dtsi
      • custom_nrf54l15dk_cpuapp.dtsi: copied everything from nrf54l_05_10_15_cpuapp_common.dtsi
    • Modified the following files: 
      • custom_nrf54l15dk_nrf54l15_cpuapp.dts: included custom_nrf54l15dk_cpuapp.dtsi
      • custom_nrf54l15dk-pinctrl.dtsi: copied everything from nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi
      • Kconfig.defconfig: added that ROM_START_OFFSET is 0 if MCUboot is not enabled 

    Please note that I have not enabled serial, console, or GPIO in custom_nrf54l15dk_nrf54l15_cpuapp_defconfig. If you plan to use these, I recommend adding them as in custom_nrf54l15dk_nrf54l15_cpuapp_defconfig.

    I have not tested the sample, only that it builds successfully.

    To build for a custom board, you need to set the board root. You can set this in settings in VS Code like this:

    You can also add it as a part of the build command, e.g.:

    west build -b custom_nrf54l15dk/nrf54l15/cpuapp -- -DBOARD_ROOT=<my_board_root>

    Please note that the board root is where the 'boards' directory is located. So, if you for example have a board under /home/username/nordic/boards/vendorname/custom_nrf54l15dk, then the board root is /home/username/nordic.

    Best regards,
    Marte

    custom_nrf54l15dk.zip6825.light_bulb.zip

Related