Begin Init
Found W25N01G Flash Chip
0
Status of reg 0xa0:
(HEX: ) 0x00, (Binary: )0
18
Status of reg 0xb0:
(HEX: ) 0x18, (Binary: )11000
w25n01g_programDataLoad
w25n01g_programExecute
Reading Data
Write Page Addr Complete
READING DATA START
Command 14 Complete
CHECKING ECC-CODE
[B]0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, [/B]
DEADBEEFdeadbeef
w25n01g_programDataLoad
w25n01g_programExecute
Reading Data
READING DATA START
Command 14 Complete
CHECKING ECC-CODE
[B]0x44[D], 0x45[E], 0x41[A], 0x44[D], 0x42[B], 0x45[E], 0x45[E], 0x46[F], 0x64[d], 0x65[e], 0x61[a], 0x64[d], 0x62[b], 0x65[e], 0x65[e], 0x66[f], 0x0a
], 0x00[[[/B]
@defragster
After corrections:
Code:Begin Init ... [B]0x44[D], 0x45[E], 0x41[A], 0x44[D], 0x42[B], 0x45[E], 0x45[E], 0x46[F], 0x64[d], 0x65[e], 0x61[a], 0x64[d], 0x62[b], 0x65[e], 0x65[e], 0x66[f], 0x0a ], 0x00[[[/B]
@defragster - thanks. But the credit for finding the issue that resulted in getting it to work goes to @ecurtz with the bug to writeRegisterFunction and correction for the addr's.
Doing some clean up now. Still have no clue on bad block management and how to use - its clear as mud
In file included from T:\tCode\T_4.1\extNAND_t41\NAND_SPI_TEST.ino:1:0:
T:\TEMP\arduino_build_NAND_SPI_TEST.ino\sketch\defines.h:112:5: error: 'flashSector_t' does not name a type
flashSector_t sectors; // Count of the number of erasable blocks on the device
^
T:\tCode\T_4.1\extNAND_t41\driver.ino: In function 'bool w25n01g_startup()':
T:\tCode\T_4.1\extNAND_t41\driver.ino:98:14: error: 'flashGeometry_t {aka struct flashGeometry_s}' has no member named 'sectors'
geometry.sectors = 1024; // Blocks
^
T:\tCode\T_4.1\extNAND_t41\driver.ino:103:57: error: 'flashGeometry_t {aka struct flashGeometry_s}' has no member named 'sectors'
geometry.totalSize = geometry.sectorSize * geometry.sectors;
^
T:\tCode\T_4.1\extNAND_t41\driver.ino: In function 'void w25n01g_deviceErase()':
T:\tCode\T_4.1\extNAND_t41\driver.ino:139:47: error: 'flashGeometry_t {aka struct flashGeometry_s}' has no member named 'sectors'
for (uint32_t block = 0; block < geometry.sectors; block++) {
^
T:\tCode\T_4.1\extNAND_t41\driver.ino: In function 'void w25n01g_randomProgramDataLoad(uint16_t, const uint8_t*, int)':
T:\tCode\T_4.1\extNAND_t41\driver.ino:172:68: warning: invalid conversion from 'const void*' to 'void*' [-fpermissive]
flexspi_ip_read(14, flashBaseAddr + columnAddress, data, length);
^
T:\tCode\T_4.1\extNAND_t41\NAND_SPI_TEST.ino:71:6: note: initializing argument 3 of 'void flexspi_ip_read(uint32_t, uint32_t, void*, uint32_t)'
void flexspi_ip_read(uint32_t index, uint32_t addr, void *data, uint32_t length)
^
exit status 1
Begin Init
Found W25N01G Flash Chip
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
DEADBEEFdeadbeef80085
0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0xff[�], 0x00[
Got github updated file. Extended the beefy[] as it was less than 20 so compiler warning.
And in either case it isn't reading it back right - but it compiles.
w25n01g_writeEnable(true); //sets the WEL in Status Reg to 1 (bit 2)
w25n01g_programDataLoad(W25N01G_LINEAR_TO_COLUMN(4000), buffer, 20);
//w25n01g_randomProgramDataLoad(W25N01G_LINEAR_TO_COLUMN(40000), buffer, 16);
w25n01g_programExecute(W25N01G_LINEAR_TO_PAGE(4000));
//w25n01g_pageProgram(4000, buffer, 20);
Begin Init
Found W25N01G Flash Chip
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
DEADBEEFdeadbeef
0x44[D], 0x45[E], 0x41[A], 0x44[D], 0x42[B], 0x45[E], 0x45[E], 0x46[F], 0x64[d], 0x65[e], 0x61[a], 0x64[d], 0x62[b], 0x65[e], 0x65[e], 0x66[f], 0x0a[
], 0x00[
w25n01g_randomProgramDataLoad
w25n01g_pageProgram
Begin Init
Found W25N01G Flash Chip
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
DEADBEEFdeadbeef80085
0x44[D], 0x45[E], 0x41[A], 0x44[D], 0x42[B], 0x45[E], 0x45[E], 0x46[F], 0x64[d], 0x65[e], 0x61[a], 0x64[d], 0x62[b], 0x65[e], 0x65[e], 0x66[f], 0x38[8], 0x30[0], 0x30[0], 0x38[8], 0x00[
static const uint32_t flashBaseAddr = 0x01000000u;
static const uint32_t psramAddr = 0x70000000;
Yes its running at the same clock speed as the PSRAM. If i remember right the max speed is 104Mhz.It is running on the same slower 88 MHz PSRAM clock speed?
Same same for start address.Might modify Paul's PSRAM test? What is the start address the nandFlash?: flashBaseAddr = 0x01000000
Should still work with a PSRAM installed.so that would still work with PSRAM?
Begin Init
Found W25N01G Flash Chip
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
DEADBEEFdeadbeef
0x44[D], 0x45[E], 0x41[A], 0x44[D], 0x42[B], 0x45[E], 0x45[E], 0x46[F], 0x64[d], 0x65[e], 0x61[a], 0x64[d], 0x62[b], 0x65[e], 0x65[e], 0x66[f], 0x0a[
], 0x00[
NAND ========== memory map ====== ====== check42() : WRITE !!!!
NAND length 0x8000000 element size of 1
took 5222454 elapsed us
NAND ============================ check42() : COMPARE !!!!
took 4752294 elapsed us
Good, Found 42 in NAND 0x8000000 Times
Begin Init
Found W25N01G Flash Chip
[B] NAND ============================ check42() : COMPARE !!!!
took 4752784 elapsed us
Good, Found 42 in NAND 0x8000000 Times[/B]
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
DEADBEEFdeadbeef4321
0x44:D 0x45:E 0x41:A 0x44:D 0x42:B 0x45:E 0x45:E 0x46:F 0x64:d 0x65:e 0x61:a 0x64:d 0x62:b 0x65:e 0x65:e 0x66:f 0x34:4 0x33:3 0x32:2 0x31:1 0x00: 0x00: 0x00: 0x00: 0x00: 0x00: 0x00: 0x00: 0x00: 0x00: 0x00: 0x00:
NAND ========== memory map ====== ====== check42() : WRITE !!!!
NAND length 0x8000000 element size of 1
took [B]5222452 elapsed us[/B]
NAND ============================ check42() : COMPARE !!!!
took [B]4752878 elapsed us[/B]
Good, Found 42 in NAND 0x8000000 Times