Use of Zephyr inbuilt APIs to Use External Flash with nRF9160

I am using MX25 external flash with nRF9160. I am unable to find the configuration to use the Zephyr APIs to access the flash. I am able to access it when I am using 

spi_write_dt funtion but for this I have to do some SPI configuration using the following structs
struct spi_config spi_cfg;
struct spi_cs_control cs_control;
My configuration for Flash in prj.conf

# SPI
CONFIG_SPI=y
CONFIG_SPI_NOR=y

# FLASH
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
Need some insight on how to use the zephyr-based APIs without doing any other configuration other than DT.
Parents Reply
  • I have checked this example but it didn't worked for me. When I was calling the flash_erase I was getting some wierd observation. 

    This functions calls the following code:

    static inline int z_impl_flash_erase(const struct device *dev, off_t offset,
                         size_t size)
    {
        const struct flash_driver_api *api =
            (const struct flash_driver_api *)dev->api;
        int rc;

        rc = api->erase(dev, offset, size);

        return rc;
    }
    but here I see that no function is assigned to api->erase 
Children
No Data
Related