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 Reply
  • 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

Children
  • Hi Einar

    another problem is, when I try to flash with "west flash" the following error occurs:

    -- runners.nrfutil: Flashing file: ....../build/net_provision.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
     * 600104758: Device error: Address range 0x000085a8..0x000085c8 is outside the memory ranges defined for programming through the Network core (Generic)
    

    The provision_partition in the cpunet core is defined like this:

    bl_storage: provision_partition: partition@8580 {
    	label = "b0-provision-data";
    	reg = <0x8580 0x280>;
    };

    Where does the wrong address range come from?!

    Cheers
    Thilo

  • Hi Thilo,

    The merged.hex from older SDK releases is generated by the partition manager. If you are not using the partition manager, that will not be generated in the same way. However, you can enable a similar mechanism by adding SB_CONFIG_MERGED_HEX_FILES=y to your sysbuild.conf. Then you will for instance get merged_nrf5340dk_nrf5340_cpuapp.hex for the app core if you were building for the DK.

    The error with bl_storage for the netcore is likely also related to differences when not using the partition manager. Then when the devicetree is used, you must update that to reflect the address in the network core, and the network core is offset by 0x01000000, so that must be added to the address range.

    Br,

    Einnar

  • 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

Related