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.
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.
Ext_flash.h you can remove it and instead of it add external_flash.h
Hi
I set up my own little test based no ble_app_uart, and it seems to work fine.
I have tested most of the core commands, including Sector Erase, Chip Erase, Program, Read, Write Enable and RDSR.
I set up a small state machine that runs through a read - erase - read - program - read loop every time I reset the code, and the results look OK.
When I run this on an nRF52840 DK I get the following UART output:
UART started.
Reading REMS. Man id: c2, Dev id: 17
Status: 0
Config: 0
Reading address 00001000: FF-FF-FF-FF-00-01-02-03-04-05-06-07-08-09-0A-0B-
Running write enable
Running sector erase at address 0x1000
Status: 0
Reading address 00001000: FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-
Running write enable
Programming data at address 00001004
Status: 0
Reading address 00001000: FF-FF-FF-FF-00-01-02-03-04-05-06-07-08-09-0A-0B-
I have updated the nRF52832 project also. It compiles and runs nicely, but doesn't show any output since I don't have a flash device connected.
Can you take a look at my code and see what might be different?
I put all the flash functionality in the spi_flash.c/h files, and the test state machine can be found towards the bottom of main.c
Best regards
Torbjørn
Thank you soo much Torbjorn.
U really made my work easier and also cleared my few doubts.
I tested your code with my flash device and its working properly. But now when I want to write the full page what which is 256 bytes I am not able to do it. I tested first by sending sector erase and the if I read 256 bytes I get the following results which is wrong. ryt?? for full sector earse and fullpage write for 256 what should i add?
I need this because I want to write and read full sectors.
Reading address 00001000: 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-000000000000000000000000000
One more thing and if I want to erase :
sector 0 do i have to give address as 0x000000,
sector 1 as 0x008000
sector 2 as 0x010000 ????
This flash driver here is quite easy to use and works with almost all SPI Flash.
https://github.com/IOsonata/IOsonata/blob/master/include/diskio_flash.h
usage example
https://github.com/IOsonata/IOsonata/blob/master/exemples/misc/flash_memory_demo.cpp