NAND flash support in 1.54

This is how I understand it. Any of this could be wrong.

On the 1062 side
CAS is where the 1062 divides a 32 bit address into the column and the page.
The value in the LUT defines how many bits are actually sent, so if it's larger than CAS for a CADDR_SDR command (or larger than 32 - CAS for a ADDR_SDR) it will be 0 padded.

On the NAND side
Each page contains 2048 bytes of data plus 64 bytes of ECC data.
Any column address with bit 11 set isn't addressing data, it's addressing the ECC block after the data, so e.g.
address 2050 (0b1000 0000 0000 0010) isn't byte 2 in page 1, it's part of the page 0 ECC

If this is correct then any scheme that tries to use continuous addresses without some kind of accommodation for the ECC regions is going to break. By setting CAS to 11 I believe we can work around that, with the potential downside that we can't directly access the ECC data areas, but that shouldn't be necessary if the onboard ECC is enabled for the chip.

Ok you convinced me its back to 11 :)
 
Lots of chatter there ending in RTOS - that could just be an implementation detail.

just got adaF NRF's that have 2 MB QSPI NOR Flash - they seem to refer to littleFS usage - though no examples for Arduino yet detected on QSPI. Not sure if it is active in the adaPython? The sample I did find seems to use a 28KB area on the main flash? Of course their NRF Arduino code includes some part of RTOS - in order to use the MCU for radio tasks.
 
After my patented "see what's on GitHub" search process I also thought dhara looked interesting, but whatever Paul is planning in terms of the new file abstraction might make a big difference in the best way to approach a higher level NAND API.
 
I have also sort have been holding off on this, as again not sure where many of these things are going.

Hopefully we can come up with some maybe scalable ways of using more of these storage areas. Where hopefully some of them are KISS, but maybe allows the sketch an easy api to store and retrieve data, and maybe simple way to likewise save and retrieve the data over USB (in same sketch)... Also hopefully that some of this will be consistent for a few different memory options, like: in this case NAND and NOR (maybe SD?), also maybe for those of us who for example sketches may not exceed 4MB (probably less than 2), maybe a way to reserve a portion of the ROM (like we do for EEPROM) for extended storage...
 
Dhara is actually one of links in the second reference as well. I agree it does look interesting. But, as you said, think we have to wait until Paul decides on the abstraction layer he wants to use. In other reading saw that SPIFFs are probably not best suited for NAND's for a couple of reasons.
 
@KurtE
Agreed. So now time me to ramble.

Right now we showed accessing a NAND (1Gb) is possible and you can read and write to it. But with out a FS, in my opinion, its really not all that useable. NAND is going to be a challenge. For instance I tried writing to the same page 10 times using 20byte blocks of data but it will not work. If i write chunks of 512kb of data 4 times (4 subpages) to a single page it works. Writing larger data buffers across pages, works from what I can see. Then with NAND you have to worry about wear leveling and ECC handling. So for NAND not sure how simple we are going to be able to keep it without a FS. Guess it depends on you application. NOR is probably better for some cases.
 
Ok got the W25N01GV working with standard SPI. At least I think so :) Have fun testing.

Oh - one thing you can only write to page elements that have been previously erased. In other word you can't over write data that you already written to the memory.
 

Attachments

  • NAND_SPITEST.zip
    6.7 KB · Views: 75
Good work { finding bad news :) } @mjs513 - probably stuck on NOR and LittleFS a bit more as very close to something usable there for formatting space in advance of use to prevent 24ms pause on new each space alloc write. And more NOR flash inbound up to the 64MB chips to solder and test.
 
Confirmed, those are the NAND flash chips I bought. Digikey part number W25N01GVZEIGCT-ND.

I also have a few samples of W25N02KV. @wwatson - please email me directly and I'll arrange to send you a test board with one of those W25N02KV chips.
 
Good work { finding bad news :) } @mjs513 - probably stuck on NOR and LittleFS a bit more as very close to something usable there for formatting space in advance of use to prevent 24ms pause on new each space alloc write. And more NOR flash inbound up to the 64MB chips to solder and test.

Well may not be too bad. Basically what seems to be happening is that all operations are done on using the buffer. So you have to load the buffer, write data to the buffer and execute a transfer command to move the data from the buffer to the physical memory. So as long as you do the transfer you can fill up the entire 2048 byte buffer (as long as it was erased first) and then write the data to the physical memory. Unfortunately it doesn't seem like you can reload the data into the buffer and change it. Also the erase isn't on a page but on a block of pages (64x2048 -- note the 2048 assumes you have ecc turned on). Not sure how all this will fit into LittleFS - looks like it can be done but no one is really giving alot of details from what I saw in the PRs on the LittleFS github.

EDIT: This might be interest to keep in mind when trying to use LittleFS with NAND: https://github.com/littlefs-project/littlefs/issues/277/
NOTE - putting it here so I don't loose it.
 
Last edited:
@defragster - @KurtE - and all interested folks
I updated SPI driver for the Winbond N01 and N02 (lower 1GB only) chips. Still need to add the conditionals for using the full 2GB of the N02 and need to experiment a bit more.

If you want to play and try it out, here is what I have so far:

View attachment NAND_SPITEST2.zip
 
Funny ... "array loaded in FRAM chip"

Runs here on cs#3 - restart and it looks to be okay - not sure what I'm seeing - the 0xFF's all went away after first half of first run, but the above is not right :)
Code:
EF
AA
21
Status of reg 0xa0: 
(HEX: ) 0x00, (Binary: )0
...

And on cs#4:
Code:
EF
AA
22
Status of reg 0xa0: 
(HEX: ) 0x00, (Binary: )0

0
Status of reg 0xb0: 
(HEX: ) 0x18, (Binary: )11000

Tried to change mydata.datastruct.data_0 = true; to false and the block of course is fixed now with true.

But POWER OFF and values are there on power up to both chips.

This is " byte data_4; " - not sure where the 'quick brown fox' was supposed to go?
Code:
T:\tCode\littleFS\NAND_SPITEST2\NAND_SPITEST2.ino:125:45: warning: invalid conversion from 'byte {aka unsigned char}' to 'char*' [-fpermissive]
   string_test.toCharArray(mydata.datastruct.data_4,string_test.length()+1);
 
@degragster morning
Funny ... "array loaded in FRAM chip"
Oops - thats what happens when you do a copy and paste from other examples :)

Runs here on cs#3 - restart and it looks to be okay - not sure what I'm seeing - the 0xFF's all went away after first half of first run, but the above is not right
The first dump of the memory is prior to storing the data structure. The FF's showing you have an erased chip. The second memory dump is after you have written the data to the NAND. On power off and power on the first memory dump shows the data that you wrote as a verification that write to the NAND was successful.

Code:
EF
AA
22
Status of reg 0xa0: 
(HEX: ) 0x00, (Binary: )0

0
Status of reg 0xb0: 
(HEX: ) 0x18, (Binary: )11000
This is correct. First 3 bytes are showing the JEDEC. The first status register printout was some debug I forgot to comment out. It says that the protection bits were cleared while the second shows the config register is set to BUF=1 (buffered read/writes) and ECC-E = 1 (ECC enabled.

Actually - no where. Not used since I basically forgot to copy that piece of code in the example sketch for this test. Guess next update.
 
Appears to run :D Looks like you have been busy! Will have to get one of those FRAM chips :D

successfull ;)

Code:
EF
AA
21
Status of reg 0xa0: 
(HEX: ) 0x00, (Binary: )0

0
Status of reg 0xb0: 
(HEX: ) 0x18, (Binary: )11000

On Start Read Done - array loaded with read data
...... ...... ......
Data_0: true
Data_1: nan
Data_2: -1
Data_3: -1
Data_4: 0xFF
...... ...... ......
Read Write test done - check data if successfull
...... ...... ......
...... Read Array on Start ......


0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 

Data_0: true
Data_1: 1.3574999571
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......

Init Done - array loaded
...... ...... ......
Write Done - array loaded in FRAM chip
...... ...... ......
Read Done - array loaded with read data
            at Address (0)
...... ...... ......
Data_0: true
Data_1: 1.3574999571
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......
Read Write test done - check data if successfull
...... ...... ......
Write Done - array loaded in FRAM chip
...... ...... ......


0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
Powered off and then back on...
Code:
EF
AA
21
Status of reg 0xa0: 
(HEX: ) 0x00, (Binary: )0

0
Status of reg 0xb0: 
(HEX: ) 0x18, (Binary: )11000

On Start Read Done - array loaded with read data
...... ...... ......
Data_0: true
Data_1: 1.3574999571
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......
Read Write test done - check data if successfull
...... ...... ......
...... Read Array on Start ......


0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 

Data_0: true
Data_1: 1.3574999571
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......

Init Done - array loaded
...... ...... ......
Write Done - array loaded in FRAM chip
...... ...... ......
Read Done - array loaded with read data
            at Address (0)
...... ...... ......
Data_0: true
Data_1: 1.3574999571
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......
Read Write test done - check data if successfull
...... ...... ......
Write Done - array loaded in FRAM chip
...... ...... ......


0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
 
@KurtE - @defragster
Looks like I got it working now to address the upper - used check42 as a quick test (yes I still have Fram in there - keep forgetting to fix :) ). Have some clean up to do then will post the update.
Code:
EF
AA
22
Status of reg 0xa0: 
(HEX: ) 0x00, (Binary: )0

0
Status of reg 0xb0: 
(HEX: ) 0x18, (Binary: )11000

On Start Read Done - array loaded with read data
...... ...... ......
Data_0: true
Data_1: 1.3574999571
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......
Read Write test done - check data if successfull
...... ...... ......
...... Read Array on Start ......


0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 

Data_0: true
Data_1: 1.3574999571
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......

Init Done - array loaded
...... ...... ......
Write Done - array loaded
...... ...... ......
Read Done - array loaded with read data
            at Address (0)
...... ...... ......
Data_0: true
Data_1: 1.3574999571
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......
Read Write test done - check data if successfull
...... ...... ......
Write Done - array loaded in FRAM chip
...... ...... ......


0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
.
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
................................................................................................................................
...............................................................................................................................

[COLOR="#FF0000"]    NAND ========== memory map ======  ====== check42() : WRITE !!!!
		NAND length 0x10000000 element size of 1
	 took 64387402 elapsed us
    NAND ============================ check42() : COMPARE !!!!
	 took 63310892 elapsed us
Good, 	Found 42 in NAND 0x10000000 Times[/COLOR]
 
@KurtE - @defragster - @PaulStoffregen

Attached is the updated sketch/lib for the W25N0X NAND flash chips. Cheers.
 

Attachments

  • NAND_SPITEST2.zip
    8.5 KB · Views: 102
It ran successful ... Have not looked much yet :D
Code:
EF
AA
22
Status of reg 0xa0: 
(HEX: ) 0x00, (Binary: )0

0
Status of reg 0xb0: 
(HEX: ) 0x18, (Binary: )11000

On Start Read Done - array loaded with read data
...... ...... ......
Data_0: true
Data_1: nan
Data_2: -1
Data_3: -1
Data_4: 0xFF
...... ...... ......
Read Write test done - check data if successfull
...... ...... ......
...... Read Array on Start ......


0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 

Data_0: true
Data_1: 1.3574999571
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......

Init Done - array loaded
...... ...... ......
Write Done - array loaded
...... ...... ......
Read Done - array loaded with read data
            at Address (0)
...... ...... ......
Data_0: true
Data_1: 1.3574999571
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......
Read Write test done - check data if successfull
...... ...... ......
Write Done - array loaded!
...... ...... ......


0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 
0x01, 0x00, 0x00, 0x00, 0x8f, 0xc2, 0xad, 0x3f, 0x2f, 0xcb, 0x04, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
 
Back
Top