PM after 2.0.1 is not recognizing the external flash area

Hi 
I am using the Zephyr code base after trying to update the ncs to 2.1.2 from 1.9.2
I notice that the function "flash_area_open" is returning a -2 error as it couldn't find this area ID
I am trying to open an area in the external flash.... no problem in opening any area in the internal flash 

Any tips of how i might overcome this problem ?
Thanks a lot 

 

  • Hi,

    The function flash_area_open() will return -ENOENT if the first parameter - ID - is unknown. I do not know enough about the issue to say more about what is happening in your case though. Perhaps you can elaborate a bit on your configuration and potential steps to reproduce?

    PS: Based on what you write it does not seem like you are seeing the same issue, but there is currently problems with external flash in the nRF Connect SDK 2.1.x releases that you may want to be aware of. See this post for more details.

  • 	chosen {
    		zephyr,sram = &sram0;
    		zephyr,flash = &flash0;
    		zephyr,code-partition = &slot0_partition;
    		nordic,pm-ext-flash = &augu_flash_w25n;
    	};
    .........
    .........
    &spi2 {
    		status = "okay";
    		sck-pin = <19>; // gpio 0 pin 19
    		mosi-pin = <32>; // gpio 1 pin 0
    		miso-pin = <22>; // gpio 0 pin 22
    		compatible = "nordic,nrf-spim";
    		cs-gpios = <&gpio0 17 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    		augu_flash_w25n: augu_flash_w25n@0 {
    			compatible = "wb,augu_flash_w25n";
    			reg = <0>;
    			label = "AUGU_FLASH_W25N";
    			power_resources = <&flash_on>;
    			spi-max-frequency = <8000000>;
    			size = <0x40000000>;
    			page_size = <2048>;
    			block_size = <131072>;
    			wp_gpios = <&gpio0 23 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    			hold_gpios = <&gpio0 21 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    		};
    	};
    	
    	
    	

    Hi Thank you for the quick replay ,
    Attached is my pm static file 
    also attached relevant  parts in the DTS 

    mcuboot:
      address: 0x0
      size: 0xc000
    
    mcuboot_primary:
      address: 0xc000
      orig_span: &id001
      - mcuboot_pad
      - app
      sharers: 0x1
      size: 0x76000
      span: *id001
    
    mcuboot_secondary:
      address: 0x82000
      size: 0x76000
    
    internal_flash_storage:
      address: 0xF8000
      size: 0x8000  
      
    external_flash:
      address: 0x0
      end_address: 0x40000000 
      device: augu_flash_w25n
      region: external_flash
      size: 0x40000000 
    
    littlefs_storage:
      address: 0x0
      region: external_flash
      size: 0x75c0000
    
    scratch_pad:
      address: 0x75c0000
      region: external_flash
      size: 0x3c0000
    
    reserved:
      address: 0x7980000
      region: external_flash
      size: 0x100000
    
    replace_blocks:
      address: 0x7A80000
      region: external_flash
      size: 0x560000
    
    params:
      address: 0x7FE0000
      region: external_flash
      size: 0x20000

  • Hi i found a change in this file flash_map_partition_manager.c

    /* The full list of partitions will be here cut down to partitions that
    * are defined over devices with drivers enabled in Kconfig.
    */

    Which make any partition without a defined driver in kconfig cut down
    My question is how to config a custom driver in Kconfig ?
    Thanks a lot 

  • Thanks for the help 
    Although now after adding the suggested CONFIG i am getting an error while compiling 
    /opt/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.bfd: zephyr/libzephyr.a(flash_map_partition_manager.c.obj):(.rodata.default_flash_map+0xc): undefined reference to `__device_dts_ord_92'
    Any idea why is that ? 
    Thanks a lot

Related