Cannot flash to QSPI NVM on custom LS1012A board (?)

Showing results for 
Search instead for 
Did you mean: 

Cannot flash to QSPI NVM on custom LS1012A board (?)

Contributor I


I'm currently bringing up a custom LS1012A board that references the FRDM-LS1012A design.

Major differences/similarities of the custom board are:

  • Removal of K20 used for CMSIS DAP
  • Near-identical DDR3L SDRAM (AS4C512M16D3L used in place of MT41K256M16)
  • Same QSPI flash NVM (S25FS512SAGNFI011)
  • Similar reset switch circuit


CodeWarrior Flash Programmer always fails when attempting to write to QSPI flash memory. It will get stuck on "Erasing..." and fail after a while.

This is done with the same procedure that I've successfully used to flash RCW and U-Boot binaries into FRDM-LS1012A boards (some previously bricked by bad RCWs) with the CodeWarrior TAP. 


Thing's I've Tried (To No Avail)

  • Enable hard-coded RCW with USE_SAFE_RCW = True
  • Enable hard-coded RCW with CLK_OUT pin
  • Connect DUT_PORST_B signal to SDRAM Reset
  • Adjust the JTAG speed
  • Verified correct voltages to all components

If anyone can shed some light on the problem or suggest something to try or double-check, I'd really appreciate it.


0 Kudos
3 Replies

Contributor I


Upon capturing and decoding the QSPI transactions to the Cypress S25FS512S QSPI flash memory device, I've discovered why the Flash Programmer fails.


A Write Enable (WREN) instruction is sent to the device, attempting to set the Write Enable Latch (WEL) bit in  Status Register 1 (SR1V[1]). This WEL bit must be set to a 1 to enable write, program, and erase commands.

A subsequent Read Status Register 1 (RDSR1) instruction checks whether the WEL bit is set. However, the data returned is 0x0, indicating that the WEL bit hasn't been set.

The Flash Programmer will then keep repeat that process, trying to set the WEL bit and seeing that it hasn't been set, until timing out.

Note: I've slightly simplified the algorithm used by the Flash Programmer in order to plainly describe the problem.

Question: Is the problem with my component, its initialization, or its configuration? Suggestions on anything in particular to check?

Speaking of configuration, that leads into my next question. The S25FS512S QSPI NOR Flash Memory device has several registers that are non-volatile + one time programmable (OTP). In particular, there are Configuration Registers 1-4 Non-Volatile that have initial delivery states of 0h, 8h, 0h, and 10h respectively. When reading from these registers on the FRDM-LS1012A board, I noticed that they had values of 0h, 8h, 8h, and 10h, with Configuration Register 3 Non-Volatile (CR3NV) having a non-default value.

Question: Were the S25FS512S flash memory components used on FRDM-LS1012A boards pre-programmed?

0 Kudos

NXP TechSupport
NXP TechSupport

Hello Alex Jee,

I also encountered similar problem on LS1012AFDM, please try the procedure which I provided in, if your problem remains please feel free to let me know.

Have a great day,

Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos

Contributor I

I had previously found your post and attempted it with no success. I repeated it just now to double-check.

It works on my FRDM boards but not on my custom LS1012A board; the behavior of the latter is consistent with what I described in the first half of my update.

Here are captures from a logic analyzer showing that behavior:

1) RDAR instruction with address of CR3NV.


2) WREN instruction to set WEL bit (SR1V[1]) to a 1.


3) CLSR instruction to reset SR1V[5] and SR1V[6] bits.


4) RDSR1 instruction to read SR1V.


5) Repetition of 2 - 4 forever (until hard reset of board)

0 Kudos