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 

 

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

  • 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

  • Hi,

    I am not able to make sense of this error, unfortunately. Have you had any progress on your side? Can you share a bit more context and/or perhaps your project?

    PS: I am sorry for the delay. I will most likely not be able to get back to you tomorrow for any follow-up, but early next week.

  • No problem 
    Is it possible to make this card private 
    So I may share the project with you 
    Thanks a lot

  • Found this link
    which is similar to my issue 
    Please see the bellow
    CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK has been used to override the driver check for the external flash driver, but no driver is actually compiled for the region. Disabling the option removes partitions without device drivers from the flash map
    How may I add the a driver to the region ?
    Thanks

  • To add the driver add a config similar to this (from bootloader/mcuboot/boot/zephyr/boards/nrf52840dk_qspi_nor.conf):

    CONFIG_NORDIC_QSPI_NOR=y
    CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
    CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

Reply Children
No Data
Related