QSPIF is giving error -0x4002

Hi There,

I am working on custom hardware based on PSoC 6 Wi-Fi BT Prototyping Kit (CY8CPROTO-062-4343W) and working on Mbed OS 5.15.4.

In our custom hardware, we have used the S25FL064L chip as a QSPI flash.

We have an issue in init using QSPIFBlockDevice. When I have enabled traces, I got a print “Init - Verification of SFDP signature and version failed”. Also, a strange thing is this issue comes when we do init -> deinit ->init. So the first time the flash was successfully getting initialized, but after the deinit, when we do init again, it is having issues in SFDP header. I have printed the SFDP header for success as well as failure case, which will be in the log below.

Logs:
Mbed OS version 5.15.4
Initializing the block device…
e[2Ke[90m[DBG ][QSPIF]: QSPIFBlockDevice csel: 720898e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x9fh, addr: 18446744073709551615, tx length: 0, rx length: 3e[0m

e[2Ke[90m[DBG ][QSPIF]: Vendor device ID = 0x1 0x60 0x17e[0m

e[2Ke[90m[DBG ][QSPIF]: Init - Verification of SFDP signature and version succeedede[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[0] = 0x53e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[1] = 0x46e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[2] = 0x44e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[3] = 0x50e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[4] = 0x06e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[5] = 0x01e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[6] = 0x01e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[7] = 0xFFe[0m

e[2Ke[90m[DBG ][QSPIF]: Number of Param Headers: 2e[0m

e[2Ke[90m[DBG ][QSPIF]: Found Basic Param Table at Table: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Detected Page Size: 256e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x66h, addr: 18446744073709551615, tx length: 0, rx length: 0e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x99h, addr: 18446744073709551615, tx length: 0, rx length: 0e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Erase Type(A) 1 - Inst: 0xffffffffh, Size: 4096e[0m

e[2Ke[90m[DBG ][QSPIF]: Erase Type 1 - Inst: 0x20h, Size: 4096e[0m

e[2Ke[90m[DBG ][QSPIF]: Erase Type(A) 2 - Inst: 0xffffffffh, Size: 32768e[0m

e[2Ke[90m[DBG ][QSPIF]: Erase Type 2 - Inst: 0x52h, Size: 32768e[0m

e[2Ke[90m[DBG ][QSPIF]: Erase Type(A) 3 - Inst: 0xffffffffh, Size: 65536e[0m

e[2Ke[90m[DBG ][QSPIF]: Erase Type 3 - Inst: 0xd8h, Size: 65536e[0m

e[2Ke[90m[DBG ][QSPIF]: Erase Type(A) 4 - Inst: 0xffffffffh, Size: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Erase Type 4 - Inst: 0xffffffffh, Size: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Read Bus Mode set to 4-4-4, Instruction: 0xebhe[0m

e[2Ke[90m[DBG ][QSPIF]: Read Bus Mode set to 1-4-4, Instruction: 0xebhe[0m

e[2Ke[90m[DBG ][QSPIF]: Init - Setting Quad Enablee[0m

e[2Ke[90m[DBG ][QSPIF]: Setting QE Bit, Bit 1 of Status Reg 2e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Reading Status Register 1 Success: value = 0x0e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x35h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Reading Status Register 2 Success: value = 0x2e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x6h, addr: 18446744073709551615, tx length: 0, rx length: 0e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x1h, addr: 18446744073709551615, tx length: 2, rx length: 0e[0m

e[2Ke[90m[DBG ][QSPIF]: Writing Status Registers Success: reg 1 value = 0x0, reg 2 value = 0x2e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Reading Status Register 1 Success: value = 0x0e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x35h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Reading Status Register 2 Success: value = 0x2e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0xb7h, addr: 18446744073709551615, tx length: 0, rx length: 0e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Clearing block protection via status register protection bitse[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Reading Status Register 1 Success: value = 0x0e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x35h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Reading Status Register 2 Success: value = 0x2e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x6h, addr: 18446744073709551615, tx length: 0, rx length: 0e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x1h, addr: 18446744073709551615, tx length: 2, rx length: 0e[0m

e[2Ke[90m[DBG ][QSPIF]: Writing Status Registers Success: reg 1 value = 0x0, reg 2 value = 0x2e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m
OK
Deinitializing the block device…
e[2Ke[90m[DBG ][QSPIF]: Inst: 0x4h, addr: 18446744073709551615, tx length: 0, rx length: 0e[0m
OK
Mounting the filesystem…
e[2Ke[90m[DBG ][QSPIF]: QSPIFBlockDevice csel: 720898e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x9fh, addr: 18446744073709551615, tx length: 0, rx length: 3e[0m

e[2Ke[90m[DBG ][QSPIF]: Vendor device ID = 0x1 0x60 0x17e[0m

e[2Ke[31m[ERR ][QSPIF]: Init - Verification of SFDP signature and version failede[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[0] = 0xFFe[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[1] = 0x53e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[2] = 0x46e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[3] = 0x44e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[4] = 0x50e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[5] = 0x06e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[6] = 0x01e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[7] = 0x01e[0m

e[2Ke[31m[ERR ][QSPIF]: Init - Parse SFDP Headers Failede[0m
No filesystem found, formatting…
e[2Ke[90m[DBG ][QSPIF]: QSPIFBlockDevice csel: 720898e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1e[0m

e[2Ke[90m[DBG ][QSPIF]: Inst: 0x9fh, addr: 18446744073709551615, tx length: 0, rx length: 3e[0m

e[2Ke[90m[DBG ][QSPIF]: Vendor device ID = 0x1 0x60 0x17e[0m

e[2Ke[31m[ERR ][QSPIF]: Init - Verification of SFDP signature and version failede[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[0] = 0xFFe[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[1] = 0x53e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[2] = 0x46e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[3] = 0x44e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[4] = 0x50e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[5] = 0x06e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[6] = 0x01e[0m

e[2Ke[39m[INFO][QSPIF]: sfdp_header[7] = 0x01e[0m

e[2Ke[31m[ERR ][QSPIF]: Init - Parse SFDP Headers Failede[0m
Fail :frowning:

++ MbedOS Error Info ++
Error Status: 0x80FF0100 Code: 256 Module: 255
Error Message: Fatal Run-time error
Location: 0x100467F5
Error Value: 0x0
Current Thread: main Id: 0x802493C Entry: 0x10096BB5 StackSize: 0x1400 StackMem: 0x8007070 SP: 0x8008264
For more info, visit: https://mbed.com/s/error?error=0x80FF0100&tgt=CY8CPROTO_062_4343W_CUSTOM
– MbedOS Error Info –
error: Unknown error (-4002)

Any help would be appreciated.

Many thanks in advance.

Regards,
Ranjitsinh Rathod

I am working with Datahoist team and we are facing this issue.