Hello Team,
We are interfacing nRF52832 with an external flash for data storage. Could you please point to the right document/link/code reference on how to interface external flash (on SPI) with nRF52832 on nRF Connect SDK 1.8.0?
Thanks!
Hello Team,
We are interfacing nRF52832 with an external flash for data storage. Could you please point to the right document/link/code reference on how to interface external flash (on SPI) with nRF52832 on nRF Connect SDK 1.8.0?
Thanks!
Hi,
embeddedER said:and also when we connect power to the board for the first time
This is interesting. It does sound like a timing issue.
Could you scope the SPI lines, VDD_NRF and VDD_SPI, to see if the "time delay before write instruction" (tPUW in the flash datasheet) of 5 ms is honored on the very first run?
If you are unsure on how to test the above, or do not have such equipment available, you could (only for testing purposes!!) try to add a k_sleep delay before this sequence:
https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.0-ncs1/drivers/flash/spi_nor.c#L1037-L1055
Kind regards,
Håkon
Hi Hakon,
Thanks for the response. I added 6 ms delay in the code before reading the JEDEC ID.
With this change, now when I flash the device or power the board, it works (first time as well).
Can there be a cleaner way the this? Or we can use this workaround?
TIA!
Hi,
Great to hear that you found the root-cause of the issue!
embeddedER said:Can there be a cleaner way the this? Or we can use this workaround?
You could make your own board file, add a board.c file, similar to this:
https://github.com/nrfconnect/sdk-zephyr/blob/main/boards/arm/thingy52_nrf52832/board.c
where you add a 5 ms delay in case SPI_NOR is selected, and also add a check if the init priority is lower than the spi_nor library.
Kind regards,
Håkon
Thanks, Hakon. I'll check this option.
Really appreciate your support..!!