Issue operate FRDM-MCXN236 Flash via SWD with Custom Programmer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue operate FRDM-MCXN236 Flash via SWD with Custom Programmer

434 Views
GarrickChen
Contributor I
I'm having trouble operating the flash memory on the FRDM-MCXN236 board using my custom SWD programmer. I'm following the procedure outlined in AN14178 to operate the flash.
 

Here are the steps I'm taking, and the results I'm observing:

  1. Check Core ID: I successfully read the core ID, which is 0x6BA02477.
  2. Check FSTAT CCIF: I verified that the CCIF (Command Complete Interrupt Flag) bit in the FSTAT register is set to 1 before initiating the erase command.
  3. Write FCCOB for Sector Erase (ERSSCR): I wrote 0x42 (ERSSCR command) to the FCCOB register.
  4. Clear FSTAT CCIF: I cleared the CCIF bit in the FSTAT register to launch the command.
  5. Read FSTAT - Expecting PEWEN = 1: This is where I'm encountering the issue. After clearing the CCIF bit and attempting to read the FSTAT register, I'm receiving a value of 0x01000900. I'm expecting the PEWEN (Program/Erase Write Enable) bit to be set to 1, indicating that the flash is ready for programming or erasing. The PEWEN bit is not set, and the process seems to be stuck. I cannot proceed further.

When I try using the 0x40 (ERSALL - Erase All ) command instead of 0x42, I receive a FSTAT value of 0x00000190.

Are there any specific configurations or initializations required before attempting to operate the flash using SWD?

Labels (2)
0 Kudos
Reply
1 Reply

385 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @GarrickChen 

 

Please confirm that the default parameters of the flash have been initialized and the flash clock for the FLASH and FMC has been enabled before performing the erase operation.

 

BR

Alice

0 Kudos
Reply