Porting child image based project to sysbuild

Hi

We are currently porting a project with a custom board and custom netcore image to sysbuild.

My current problem is, that we have a custom project for the netcore image which was added to the appcore project via CMakeLists.txt and add_child_image.

How is this done via sysbuild nowadays?

The former child image needs to be build during appcore build and added to the domain netcore so sysbuild recognizes it.

I tried it with the sysbuild cmake file:

ExternalZephyrProject_Add(
    APPLICATION net_core
    SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../netcore-project"
    BOARD pan_ng_module/nrf5340/cpunet
)

set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET net_core)
set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION net_core CACHE INTERNAL "")

add_dependencies(${DEFAULT_IMAGE} net_core)


But then there is the net_provision.hex which I don't know why it is produced!
Do I need to define the image for the netcore domain differently?

Thanks for any hint!


Cheers,
Thilo

Parents
  • Hi Thilo,

    You normally only need to add a kconfig.sysbuild as explained under Adding custom network core images.

    The creation of net_provision.hex does not indicate an issue I believe, as that is generated if you have secure boot for the net core enabled. See Migrating from multi-image builds to sysbuild. You do not get it if you disable secure boot for the network core with SB_CONFIG_SECURE_BOOT_NETCORE=n in sysbuild.conf.

  • Hi Einar

    thank you for your answer!
    Then I will ignore net_provision.hex, cause we need the b0n bootloader to be able to update the net-core.

    Another question is, why the merged.hex is not generated anymore?

    The Build works and it generates the zephyr.hex files for mcuboot, cpuapp app, b0n and cpunet app (and net_provision.hex). So usually I would expect the merged.hex files. Was the generating of the merged.hex files remove?

    Thank you for your time!

    Cheers,
    Thilo

  • Hi Einnar

    when I offset my dts for flash1 with 0x0100000, then I get, when executing west flash:
    [error] [ Client] - Encountered error -173: Command erase_file executed for 4 milliseconds with result -173
    [error] [ Worker] - Address 0x02008800 does not map to a known memory.

    I figured, when I use 0x8800, the flash1 is automatically offset with 0x1000000, therefore I used the offsets instead of absoulte.

    so, thats my cpunet dtsi for the partitioning:

    &flash1 {
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    		b0n_partition: partition@0 {
    			label = "b0n";
    			reg = <0x0 0x8580>;
    		};
    
    		bl_storage: provision_partition: partition@8580 {
    			label = "b0-provision-data";
    			reg = <0x8580 0x280>;
    		};
    
    		cpunet_app_partition: s0_partition: partition@8800 {
    			label = "cpunet_app";
    			reg = <0x8800 0x37800>;
    		};
    	};
    };
    
    



    When I activate SB_CONFIG_MERGED_HEX_FILES=y, I get an build error regarding net_provision hex missing:

    -- Configuring done (29.7s)
    -- Generating done (0.0s)
    -- Build files have been written to: ...... /build
    -- west build: building application
    ninja: error: 'net_provision/zephyr/zephyr.hex', needed by 'merged_...._nrf5340_cpunet.hex', missing and no known rule to make it
    


    Am I missing something here?

    Thanks!

    Cheers,
    Thilo

  • Hi

    I think there are some problems regarding the move from pm_static.yml to devicetree.

    for flash one (cpunet) partition definiton, I need to define the partition offsets with an offset of 0x1000000.

    NRF/subsys/pcd/CMakeLists.txt:22
    math(EXPR s0_offset_address "${s0_partition_address} - ${flash_address}" OUTPUT_FORMAT HEXADECIMAL)

    s0_partition_address: 0x8800
    flash_address: 0x1000000

    s0_offset_address is then negative value. So I need to remove "- ${flash_address}" to have the correct offset here.


    The other part is the net_provision which simple uses 0x8800 but needs to use the 0x1008800 when creating the net_provision.hex to have the correct offset.
    the script NRF/scripts/bootloader/provision.py should add the offset of the dts parent in my case flash1 or the cmake script which is calling the provision.py

    I need to change these two positions to have a working fw.

    Cheers,
    Thilo


  • Hi Thilo,

    One thing first that I shoudl have asked about before. Which exact SDK version are you using?

    That said, assuming 3.4.0-rc1 or main, where there has been some significant changes. A key here, si how flash1 is defined for cpunet, with a range. See here

  • Hi Einar

    sorry I should have mentioned the sdk version we use.

    we use 3.3.0 currently.

    Cheers,
    Thilo

  • Hi Thilo,

    I see. Then I would recommend continuing with the partiion manager for now (but consider removing it if you later move to NCS 3.4.0).

Reply Children
No Data
Related