CONFIG_SPI_NOR was assigned the value y, but got the value n.

Hello,

I am trying to implement littlefs in my external flash memory. I am using nrf52832 and try to implement the littlefs sample code. 

When I am trying to enable Config_spi_nor then I found CONFIG_SPI_NOR was assigned the value y, but got the value n. Could you please help me how I can enable this configuration? 

I am also attaching my overlay file and prj file. Please have a look. 

 

Thank you.

Best regards

FS

CONFIG_FLASH=y
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096

CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y

CONFIG_MAIN_STACK_SIZE=4096

# Let __ASSERT do its job
CONFIG_DEBUG=y

CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y

CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y

CONFIG_SETTINGS=y
CONFIG_SETTINGS_FS=y
CONFIG_SETTINGS_FS_DIR="/lfs/settings"
CONFIG_SETTINGS_FS_FILE="/lfs/settings/run"

  • // To get started, press Ctrl+Space to bring up the completion menu and view the available nodes.
    
    // You can also use the buttons in the sidebar to perform actions on nodes.
    // Actions currently available include:
    
    // * Enabling / disabling the node
    // * Adding the bus to a bus
    // * Removing the node
    // * Connecting ADC channels
    
    // For more help, browse the DeviceTree documentation at https://docs.zephyrproject.org/latest/guides/dts/index.html
    // You can also visit the nRF DeviceTree extension documentation at https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/ncs_configure_app.html#devicetree-support-in-the-extension
    &spi2 {
        IS25LP128: IS25LP128@0 {
           compatible = "jedec,spi-nor";
           label = "25LP128";
           reg = <0>;
           spi-max-frequency = <40000000>; /* Adjust based on your flash specifications *//* Adjust based on your flash JEDEC ID */
           size = <0x8000000>; /* Adjust based on your flash size */
           has-dpd;
           t-enter-dpd = <3000>;
           t-exit-dpd = <3000>;
           jedec-id = [9d 60 18]; 
           partitions {
               compatible = "fixed-partitions";
               #address-cells = <1>;
               #size-cells = <1>;
    
              lfs1_part: partition@0 {
              label = "littlefs_storage";
              reg = <0x00000000 0x01000000>;
           };
        };  
      };
    };
     
    
     / {
         fstab {
             compatible = "zephyr,fstab";
             lfs1: lfs1 {
                 compatible = "zephyr,fstab,littlefs";
                 mount-point = "/lfs1";
                 partition = <&lfs1_part>;
                 automount;
                 read-size = <16>;
                 prog-size = <16>;
                 cache-size = <64>;
                 lookahead-size = <32>;
                 block-cycles = <512>;
             };
         };
     };
    
    /{
       chosen {
           nordic,pm-ext-flash = &IS25LP128;
       };
     };

  • Hi,

    Which board are you using?

    Does this board have an external flash on it?

    Is the SPI DTS node you use enabled (status = "okay")?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    I am using nrf52832 board. I connect one external flash (IS25LP128) and try to implement littlefs on it. 

    In my prj.config file, I enabled 

    CONFIG_SPI=y
    Is there any other way to enable the SPI DTS node? 
    Thank you 
    Regards
    Farhan
  • In zephyr.dts, the &spiX node must have

    status = "okay";

    for it to be enabled in DTS. Check out build/zephyr/zephyr.dts to see how the full DTS for you build looks. This is both to check what the SPI is set to, and to see examples of how other nodes do it.

  •  The status is ok in zephyr.dts. 

    still the same error I am getting.

Related