Issue operate FRDM-MCXN236 Flash via SWD with Custom Programmer

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Issue operate FRDM-MCXN236 Flash via SWD with Custom Programmer

422 次查看
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?

标签 (2)
0 项奖励
回复
1 回复

373 次查看
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 项奖励
回复