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
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
Hi
You might want to look at Zephyr Flash sample that demonstrates the use of flash API:
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:
AKO said:I have checked this example but it didn't worked for me
What do you mean by "did not work"? Did it not compile well? Were you able to flash it? Did you get runtime error?
AKO said:but here I see that no function is assigned to api->erase
In the main, you will see that we are getting the flash device from the devicetree by calling DEVICE_DT_GET().
Therefore, the drivers configured for that device in the DTS would be used to connect to the flash api.
I have compiled the example for NRF52840, and I can see (in the DTS) that spi-flash0 is using QSPI-NOR driver from NORDIC (see compatible), and in the NRF_QSPI_NOR.C file we see that:
Hence the flash erase would eventually connect with qspi_nor_erase from this driver.
If you are unfamiliar with this then I would recommend you to go through the DevAcademy courses that would quickly ramp up expertise working with NCS/Zephyr.
Warm regards,
Naeem
There are no compilation error, and I am able to flash it. The example that you have shared worked fine with QSPI (where the Flash_Erase/Flash_Read API are connecting with Zephyr APIs) but I am using SPI-NOR where I am facing issue.
Also, I am able to get the flash device from the Device tree.
There are no compilation error, and I am able to flash it. The example that you have shared worked fine with QSPI (where the Flash_Erase/Flash_Read API are connecting with Zephyr APIs) but I am using SPI-NOR where I am facing issue.
Also, I am able to get the flash device from the Device tree.
I am using the following to the flash device from DT:
My Device Tree: