void spiffs_t4::printStatusRegs() {
[COLOR="#FF0000"]#if 1[/COLOR]
uint8_t val;
flexspi_ip_read(8, flashBaseAddr[_spiffs_region], &val, 1 );
Serial.print("Status 1:");
[COLOR="#FF0000"]Serial.println(val, BIN); //lets me see the bits more easily against the datasheet
[/COLOR]
// cmd index 9 = read Status register #2 SPI
flexspi_ip_read(9, flashBaseAddr[_spiffs_region], &val, 1 );
Serial.print("Status 2:");
[COLOR="#FF0000"]Serial.println(val, BIN); //lets me see the bits more easily against the datasheet[/COLOR]
#endif
}
//TODO!!!!! set QPI enable bit in status reg #2 if not factory set!!!!!
if( flashID[1] == 0x70){
uint8_t val;
flexspi_ip_read(9, flashBaseAddr[_spiffs_region], &val, 1 ); //read status Reg2
val |= 1<<1;
FLEXSPI2_LUT28 = LUT0(CMD_SDR, PINS1, 0x31) | LUT1(WRITE_SDR, PINS1, 1);
flexspi_ip_write(7, flashBaseAddr[_spiffs_region], val, 1);
}
That assessment agrees with what I said in an earlier post.
If i had the same setup I would look at the status registers using the printStatusRegs function call. Would make the follow
Code:void spiffs_t4::printStatusRegs() { [COLOR="#FF0000"]#if 1[/COLOR] uint8_t val; flexspi_ip_read(8, flashBaseAddr[_spiffs_region], &val, 1 ); Serial.print("Status 1:"); [COLOR="#FF0000"]Serial.println(val, BIN); //lets me see the bits more easily against the datasheet [/COLOR] // cmd index 9 = read Status register #2 SPI flexspi_ip_read(9, flashBaseAddr[_spiffs_region], &val, 1 ); Serial.print("Status 2:"); [COLOR="#FF0000"]Serial.println(val, BIN); //lets me see the bits more easily against the datasheet[/COLOR] #endif }
I would put it in eraseDevice and watFlash. You may get a lot of spew but you can put a test on it to print it periodically or just pull the usb cable.
Order the SIM chip from digikey earlier today, may have at end of week for testing.
EDIT:
Forgot to add - bits you want to check is that the chip is write enabled (WEL) and no protection bits are set.
if( flashID[1] == 0x70){
[COLOR="#FF0000"]uint8_t val[0];[/COLOR]
flexspi_ip_read(9, flashBaseAddr[_spiffs_region], &val, 1 );
[COLOR="#FF0000"]val[0] |= 1<<1;[/COLOR]
[COLOR="#FF0000"] FLEXSPI2_LUT28 = LUT0(CMD_SDR, PINS1, 0x50);
flexspi_ip_command(7, flashBaseAddr[_spiffs_region]);[/COLOR]
FLEXSPI2_LUT28 = LUT0(CMD_SDR, PINS1, 0x31) | LUT1(WRITE_SDR, PINS1, 1);
flexspi_ip_write(7, flashBaseAddr[_spiffs_region], val, 1);
}
C:\Users\issac\OneDrive\Documents\Arduino\libraries\SPIFFS_t4\examples\flashtest6\flashtest6.ino Jul 22 2020 11:42:10
PSRAM: 8 MB
Enter 'y' in 6 seconds to format FlashChip - other to skip
Status 1:1010000
Status 2:1010000
Status 1:1010101
Status 2:1010101
Status 1:10000
Status 2:1010111
Erasing... (may take some time)
Chip erased in 0 seconds.
Mount SPIFFS:
Status 1:1010000
Status 2:1010111
Status 1:1010101
Status 2:1010101
Status 1:1010000
Status 2:1010111
Mount ADDR 0x800000 with res: 0
Write file:
Hello World! What a wonderful World :)
errno -10010
Directory contents:
Read file:
errno -10010
ERAM ========== memory map ===== array* ======== check24() : WRITE !!!!
ERAM length 0x7FFFFE element size of 1
took 241413 elapsed us
ERAM ============================ check24() : COMPARE !!!!
took 225148 elapsed us
Good, Found 24 in ERAM 7FFFFE Times
Mount SPIFFS:
Mount ADDR 0x800000 with res: 0
Directory contents:
@Han
Sorry for the delay in getting back to you but got sidetracked. Can you give this a try, it doesn't hang my T4.1
Before you unsolder the chip, the version i think you are using, isn't the latest so cant guarantee all examples or that it still works. The most current branch is: https://github.com/PaulStoffregen/teensy41_extram/tree/SPIFFS-FLASH-ONLY.
C:\Users\issac\OneDrive\Documents\Arduino\libraries\SPIFFS_t4\examples\flashtest6\flashtest6.ino Jul 22 2020 12:41:10
PSRAM: 8 MB
Enter 'y' in 6 seconds to format FlashChip - other to skip
Status 1:1110001
Status 2:1110001
Status 1:10000
Status 2:10010
Status 1:10000
Status 2:10010
Erasing... (may take some time)
...............................................................
Chip erased in 31 seconds.
Mount SPIFFS:
Status 1:1010000
Status 2:1010010
Status 1:1010000
Status 2:1010010
Status 1:1010000
Status 2:1010010
Mount ADDR 0x800000 with res: 0
Write file:
Hello World! What a wonderful World :)
Directory contents:
my_file1 [0001] size:38
Read file:
Hello World! What a wonderful World :)
ERAM ========== memory map ===== array* ======== check24() : WRITE !!!!
ERAM length 0x7FFFFE element size of 1
took 232263 elapsed us
ERAM ============================ check24() : COMPARE !!!!
took 225149 elapsed us
Good, Found 24 in ERAM 7FFFFE Times
Mount SPIFFS:
Mount ADDR 0x800000 with res: 0
Directory contents:
my_file1 [0001] size:38
It is but we were making changes to our local copies so just want to make sure we are both on the same page. Once we get th Q version working I will push the update to github
Mike