NRF53 Netcore Flash Steraming to Appcore

I want to be able to perform a DFU entirely from the netcore for backup/reliability reasons.

I can flash stream from the netcore to flash1 using stream_flash_init with "device_get_binding(PM_APP_DEV_NAME)", which evaluates to "NRF_FLASH_DRV_NAME", which evaluates to flash1/flash_controller from "nrf5340_cpunet.dtsi".

There isn't enough room on the cpunet core; so, I need to store the image on the appcore flash, validate it there, then copy over the netcore application. However, there doesn't appear to be any way to stream to flash0 from the netcore.

I am currently sending messages via shared SRAM, which is quite hacky.

Is there any way to get stream to flash0 from the netcore?

Parents
  • Well it is preferable to use overlay files. So if you want to add this flash space to the flash controller you can try to add this as an overlay to your project:

    
    /{
    	chosen {
    		zephyr,flash0 = &flash0; 
    	};
    };
    
    &flash_controller {
        flash0: flash@0000000 { 
            reg = <0x00000000 DT_SIZE_K(1024)>;
            compatible = "soc-nv-flash";
            label = "NRF_FLASH_APP_l";
            erase-block-size = <2048>;
            write-block-size = <4>;
        };
    };
     

    If you want a separate binding/device pointer to that flash partition though, you need a separate flash controller. 

    /{
    	chosen {
    		zephyr,flash0 = &flash0; 
            zephyr,flash-controller0 = &flash_controller0; 
    
    	};
    	soc {
    		flash_controller0: flash-controller0@41080000 {
    			compatible = "nordic,nrf53-flash-controller";
    			reg = <0x41080000 0x1000>;
    			partial-erase;
    
    			#address-cells = <1>;
    			#size-cells = <1>;
    
    			label="NRF_FLASH_APP";
    			flash0: flash@0000000 { 
    				compatible = "soc-nv-flash";
    				label = "NRF_FLASH_0";
    				erase-block-size = <2048>;
    				write-block-size = <4>;
                    reg = <0x00000000 DT_SIZE_K(1024)>;
    			};
    		};
        };  
    };

    Regards,

    Elfving

Reply
  • Well it is preferable to use overlay files. So if you want to add this flash space to the flash controller you can try to add this as an overlay to your project:

    
    /{
    	chosen {
    		zephyr,flash0 = &flash0; 
    	};
    };
    
    &flash_controller {
        flash0: flash@0000000 { 
            reg = <0x00000000 DT_SIZE_K(1024)>;
            compatible = "soc-nv-flash";
            label = "NRF_FLASH_APP_l";
            erase-block-size = <2048>;
            write-block-size = <4>;
        };
    };
     

    If you want a separate binding/device pointer to that flash partition though, you need a separate flash controller. 

    /{
    	chosen {
    		zephyr,flash0 = &flash0; 
            zephyr,flash-controller0 = &flash_controller0; 
    
    	};
    	soc {
    		flash_controller0: flash-controller0@41080000 {
    			compatible = "nordic,nrf53-flash-controller";
    			reg = <0x41080000 0x1000>;
    			partial-erase;
    
    			#address-cells = <1>;
    			#size-cells = <1>;
    
    			label="NRF_FLASH_APP";
    			flash0: flash@0000000 { 
    				compatible = "soc-nv-flash";
    				label = "NRF_FLASH_0";
    				erase-block-size = <2048>;
    				write-block-size = <4>;
                    reg = <0x00000000 DT_SIZE_K(1024)>;
    			};
    		};
        };  
    };

    Regards,

    Elfving

Children
Related