I want to interface a 16MB external flash (SPI) with nrf52832 on the development board.Suggest me how should I start with and if there is an example for external flash then let me know.
What kind of external flash device do you want to connect?
Are you planning to use a file system, or will you just access the flash using low level read/write/erase commands?
The usbd_msc example in the SDK allows you to access SD cards over the SPI interface, if you compile the example with the USE_SD_CARD define set to 1 (located on line 106 of main.c).
Unfortunately this example is designed for the nRF52840 only, since it uses the USB interface in the nRF52840 to enumerate the connected SD card as a flash drive when connected to a PC.
I want to interface MX25R1635F FLASH memory with nrf52832. And no file system but want to access its read,write and erase commands. I have seen the qspi example but got confused with it as my I have nrf52832 that does not support QSPI.
I don't think we have an example for this kind of flash device unfortunately.
You would have to set up the SPI interface yourself using the nrfx_spim driver ideally, and implement the functions you need from the device as described in the datasheet.
I suggest starting with the RDID command, as it lets you read a known value from the device which you can use to ensure that the SPI communication is working OK, that you are using the right SPI mode etc.
Hi , Torbjorn,
I tried interfacing the external flash with nrf52832. I a able to see the MOSI data which I send on Logic analyzer and it shows correct data but I am not able to get the data on MISO. it always gives 0xFF.
So what should I do now?
And I also referred the following link :https://devzone.nordicsemi.com/f/nordic-q-a/37196/spi-miso-data-is-not-reflecting-on-the-receive-buffer but still the same problem persists.
when I send write instruction - My tx buffer size is 20 bytes( 4 instruction byte and 16 data bytes) and I also kept by rx buffer size as 20
when I send read instruction -My tx buffer size is 4 bytes( 1 bytes opcode and 3 byte address to read from) and I also kept by rx buffer size as 20 still not getting data even though the data bytes is 16
Can you see on the logic analyzer what the MISO data actually is?
In other words, is the problem that the MISO data doesn't make it into the nRF52832, or is the problem that the external flash device doesn't output anything on MISO?
Did you try to issue the RDID command?
I am able to see only a high pulse on MISO line on logic analyser. I did try RDID command I am getting correct values but data which I get is always 0XFF.
I am able to read the data now.It was due to some hardware issues that I was not able to read on MISO line.But now I am facing issue in erasing the chip.what else do I need to send to erase chip/ sector/block with it's instruction command?
This should be described in the datasheet of your flash device.
If you can't find it there please share the datasheet with me, and I will have a look.
Ok sharing with you the datasheet and the code which I am using. I added delay after CS_LOW so I am able to get the chip erase done. but still the issue is that after sending chip erase function I am not abl to write it. Also sector earse is not working ,I think I am struggling with the timing issues. I will be grateful if you can help me with these issues and make my flash running propelry.MX25R1635F, Wide Range, 16Mb, v1.6.pdf