This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf5340 qspi flash dma

Dear nordic engineers:

The only example I can find about flash is under zephyr/samples/drivers/spi_flash. However, the flash writing is pretty slow, and the MCU is halting while waiting for writing result. 

If dma buffer is available, I can send the command to write dma data to flash and do other time consuming task. The status of the flash writing can be checked in the next MCU loop.

As I understand there is no dma available in any of the zephyr flash api(flash.h). Do you have examples from nordic internal?  I found a post here https://devzone.nordicsemi.com/f/nordic-q-a/72045/flash-filing-system-for-nrf-connect-sdk  , at least someone in nordic has aware of the useful feature (in the marked answer the config file include "help
Enable support for nrfx QSPI driver with EasyDMA.") 

If there is no available example, I would like to implement it but need some guide on how to change nrf_qspi_nor.c and nrfx_qspi and make it accessible from my main.c.  Please provide some hint how I can proceed. 

Parents
  • Hi

    Normally the higher level flash driver will use the Nordic SPI drivers under the hood, and these drivers will utilize the EasyDMA controller by default. 

    In the nRF5340 there is no option to disable EasyDMA in the SPI master peripheral, and DMA will always be used. 

    Have you tried to run the flash writing from a different thread to see if it will still block the system?
    Even if the flash API is a blocking API, as long as DMA is used under the hood other threads should still be able to run. 

    Are you testing this using the external memory chip on the nRF5340DK?

    Best regards
    Torbjørn

Reply
  • Hi

    Normally the higher level flash driver will use the Nordic SPI drivers under the hood, and these drivers will utilize the EasyDMA controller by default. 

    In the nRF5340 there is no option to disable EasyDMA in the SPI master peripheral, and DMA will always be used. 

    Have you tried to run the flash writing from a different thread to see if it will still block the system?
    Even if the flash API is a blocking API, as long as DMA is used under the hood other threads should still be able to run. 

    Are you testing this using the external memory chip on the nRF5340DK?

    Best regards
    Torbjørn

Children
No Data
Related