S32K118 – DEPART Register Not Updating / Unable to Flash D Flash Region

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

S32K118 – DEPART Register Not Updating / Unable to Flash D Flash Region

785 Views
Kishore_14
Contributor III

Hi,


I am writing to report an issue we are facing with the S32K118 microcontroller related to  DEPART register and D Flash programming.
 
We previously enabled the Program Partition command in our firmware with the following configuration:
 

FTFC->FCCOB[3] = 0x80; /* FCCOB0 = Program Partition command */
FTFC->FCCOB[6] = 0x03; /* FCCOB5 = 0x03, no data flash, 32k(all) EEPROM backup */

This set the DEPART register to 0x03, configuring the FlexNVM as full EEPROM backup with no Data Flash.

 
 Unable to Flash D Flash Region:
 
In certain cases, we need to flash the OpenBLT bootloader to the D Flash (Data Flash) region of the S32K118. However, when attempting to program this region using S32DS with the debug/flash option, we receive the following error:
 
Calculated CRC-16 does not match block. (File = $CEA2, Device = $0000)
Current content of flash does not match application to be programmed
 
We suspect this error is caused by the DEPART register being set to 0x03 (no Data Flash available), which prevents programming of the D Flash region entirely.
 
DEPART Register Not Changing:
We attempted to reset the DEPART register back to its default value (0x00) by running the full Program Partition command sequence again with the updated FCCOB5 value. However, the DEPART register value does not change.
 
However, we tested the exact same procedure on the S32K144, and the DEPART register changed successfully as expected.
 
Questions:
 
  1. Is our above suspicion correct regarding the CRC error and DEPART being the root cause?
  2. Is there a recommended procedure to reset the DEPART register to its default value (0x0) on an already-partitioned S32K118 device?
  3. What is the correct approach to flash the D Flash region when DEPART is already set to 0x03 on S32K118?
     
Environment:
  • Device: S32K118
  • IDE: S32DS
  • Bootloader: OpenBLT
  • FCCOB values used: FCCOB0 = 0x80, FCCOB4 = 0x03, FCCOB5 = 0x03
Please advise on the correct approach to resolve this issue.
0 Kudos
Reply
3 Replies

731 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Kishore_14

1.Is our above suspicion correct regarding the CRC error and DEPART being the root cause?

It's unclear whether this is the cause.

 

2.Is there a recommended procedure to reset the DEPART register to its default value (0x0) on an already-partitioned S32K118 device?

3.What is the correct approach to flash the D Flash region when DEPART is already set to 0x03 on S32K118?

The simplest operation is to use the debugger to execute the mass erase command to erase the MCU partition (note that CSEc was not enabled in the previous partitioning operation, otherwise the chip may be permanently locked after the mass erase is executed).

 

For PE&Micro

image.png

For J-link(j-link commander)

Enter “unlock kinetis” in the J-Link Commander.

 

0 Kudos
Reply

703 Views
Kishore_14
Contributor III

Hi @Senlent 


1.We need to confirm CSEc enablement status. Currently we observe:

FSEC Register = 0xFE &

FCSESTAT Register 

  • BSY=0, SB=0, BIN=0, BFN=0, BOK=1, RIN=0, EDB=1, IDB=0

Based on these observed register values, is CSEc currently enabled or disabled on our S32K118? or in which register i ahve to check

2. We executed Program Partition Command (FCCOB[3]=0x80) with these parameters:

 
FTFC->FCCOB[3] = 0x80; /* FCCOB0 = 0x80, program partition command */
    FTFC->FCCOB[2] = 0x03; /* FCCOB1 = 2b11, 20 keys */
    FTFC->FCCOB[1] = 0x00; /* FCCOB2 = 0x00, SFE = 0, VERIFY_ONLY attribute functionality disable */
    FTFC->FCCOB[0] = 0x00; /* FCCOB3 = 0x00, FlexRAM will be loaded with valid EEPROM data during reset sequence */
    FTFC->FCCOB[7] = 0x03; /* FCCOB4 = 0x03, 2kb EEPROM Data Set Size for S32K118 */
    FTFC->FCCOB[6] = 0x03; /* FCCOB5 = 0x03, no data flash, 32k(all) EEPROM backup for S32K118 */
 

The command completed successfully, but we never executed any LOAD_KEY commands to program actual key values.

3. .Current situation:

  • FSEC = 0xFE (KEYEN = 11)
  • FCSESTAT = 0x4002002C (EDB=1, BOK=1)
  • DEPART register = 0x03 (needs reset to 0x0)
  • Program Partition executed but no keys loaded

With these exact register values and configuration state, can we safely perform mass erase via debugger, or do we need to use DBG_CHAL/DBG_AUTH first to avoid permanent lockout?"

Thanks.

0 Kudos
Reply

534 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@kishore_14

Your partition code indicates that you have enabled CSEc and assigned a key.

AN5401:

tip1:

Once the device is configured successfully for CSEc operation, the FCNFG register fields are set to the following. FCNFG[RAMRDY] == 0 and FCNFG[EEERDY] == 1

tip2:

With the CSEc key enabled, the chip cannot be erased in the program using the Erase All and Erase All Unsecure commands, nor can the chip's security function be disabled by using Mass Erase to erase the Flash via the debug port. This is because the CSEc module's key is stored in the D-Flash. To completely erase the chip's Flash and disable its security function using Erase All, Erase All Unsecure, and the Mass Erase command triggered by an external debugger, the key stored in the D-Flash must first be erased using the relevant CSEc commands before using the above operations to completely disable the chip's security function.

(refer to chapter 4.5 Resetting Flash to the Factory State)

In short, once CSEc is enabled and a key has been assigned, you cannot directly erase the partition using mass erase. Built-in application code is required to use the CSEc module's own instructions to restore it to its factory state.

If your application code does not handle CSEc factory restoration, the chip may not be able to restore the partition to its factory state.

 

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2327075%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K118%20%E2%80%93%20DEPART%20Register%20Not%20Updating%20%2F%20Unable%20to%20Flash%20D%20Flash%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2327075%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CDIV%20class%3D%22%22%3EI%20am%20writing%20to%20report%20an%20issue%20we%20are%20facing%20with%20the%3CSTRONG%3E%26nbsp%3BS32K118%3C%2FSTRONG%3E%26nbsp%3Bmicrocontroller%20related%20to%26nbsp%3B%20DEPART%20register%20and%20D%20Flash%20programming.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EWe%20previously%20enabled%20the%20Program%20Partition%20command%20in%20our%20firmware%20with%20the%20following%20configuration%3A%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3EFTFC-%26gt%3BFCCOB%5B3%5D%20%3D%200x80%3B%20%2F*%20FCCOB0%20%3D%20Program%20Partition%20command%20*%2F%3CBR%20%2F%3EFTFC-%26gt%3BFCCOB%5B6%5D%20%3D%200x03%3B%20%2F*%20FCCOB5%20%3D%200x03%2C%20no%20data%20flash%2C%2032k(all)%20EEPROM%20backup%20*%2F%3C%2FP%3E%3CP%3E%3CSPAN%3EThis%20set%20the%20DEPART%20register%20to%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E0x03%3C%2FSPAN%3E%3CSPAN%3E%2C%20configuring%20the%20FlexNVM%20as%20full%20EEPROM%20backup%20with%20no%20Data%20Flash.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSTRONG%3E%26nbsp%3BUnable%20to%20Flash%20D%20Flash%20Region%3A%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EIn%20certain%20cases%2C%20we%20need%20to%20flash%20the%20OpenBLT%20bootloader%20to%20the%20D%20Flash%20(Data%20Flash)%20region%20of%20the%20S32K118.%20However%2C%20when%20attempting%20to%20program%20this%20region%20using%20S32DS%20with%20the%20debug%2Fflash%20option%2C%20we%20receive%20the%20following%20error%3A%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3E%3CI%3ECalculated%20CRC-16%20does%20not%20match%20block.%20(File%20%3D%20%24CEA2%2C%20Device%20%3D%20%240000)%3C%2FI%3E%3CBR%20%2F%3E%3CI%3ECurrent%20content%20of%20flash%20does%20not%20match%20application%20to%20be%20programmed%3C%2FI%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3E%3CI%3E%26nbsp%3B%3C%2FI%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EWe%20suspect%20this%20error%20is%20caused%20by%20the%20DEPART%20register%20being%20set%20to%200x03%20(no%20Data%20Flash%20available)%2C%20which%20prevents%20programming%20of%20the%20D%20Flash%20region%20entirely.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3E%3CSTRONG%3EDEPART%20Register%20Not%20Changing%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EWe%20attempted%20to%20reset%20the%20DEPART%20register%20back%20to%20its%20default%20value%20(%3CSPAN%3E0x00%3C%2FSPAN%3E)%20by%20running%20the%20full%20Program%20Partition%20command%20sequence%20again%20with%20the%20updated%20FCCOB5%20value.%20However%2C%20the%20DEPART%20register%20value%20does%20not%20change.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EHowever%2C%20we%20tested%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Eexact%20same%20procedure%20on%20the%20S32K144%3C%2FSTRONG%3E%2C%26nbsp%3Band%20the%20DEPART%20register%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Echanged%20successfully%3C%2FSTRONG%3E%26nbsp%3Bas%20expected.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EQuestions%3A%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3COL%3E%3CLI%3E%3CDIV%3EIs%20our%20above%20suspicion%20correct%20regarding%20the%20CRC%20error%20and%20DEPART%20being%20the%20root%20cause%3F%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3EIs%20there%20a%20recommended%20procedure%20to%20reset%20the%20DEPART%20register%20to%20its%20default%20value%20(%3CSPAN%3E0x0%3C%2FSPAN%3E)%20on%20an%20already-partitioned%20S32K118%20device%3F%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3EWhat%20is%20the%20correct%20approach%20to%20flash%20the%20D%20Flash%20region%20when%20DEPART%20is%20already%20set%20to%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E0x03%3C%2FSPAN%3E%26nbsp%3Bon%20S32K118%3F%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FLI%3E%3C%2FOL%3E%3CDIV%20class%3D%22%22%3E%3CSTRONG%3EEnvironment%3A%3C%2FSTRONG%3E%3C%2FDIV%3E%3CUL%3E%3CLI%3E%3CSTRONG%3EDevice%3A%3C%2FSTRONG%3E%26nbsp%3BS32K118%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EIDE%3A%3C%2FSTRONG%3E%26nbsp%3BS32DS%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EBootloader%3A%3C%2FSTRONG%3E%26nbsp%3BOpenBLT%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EFCCOB%20values%20used%3A%3C%2FSTRONG%3E%26nbsp%3BFCCOB0%20%3D%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E0x80%3C%2FSPAN%3E%2C%20FCCOB4%20%3D%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E0x03%3C%2FSPAN%3E%2C%20FCCOB5%20%3D%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E0x03%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CDIV%20class%3D%22%22%3EPlease%20advise%20on%20the%20correct%20approach%20to%20resolve%20this%20issue.%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2327479%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K118%20%E2%80%93%20DEPART%20Register%20Not%20Updating%20%2F%20Unable%20to%20Flash%20D%20Flash%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2327479%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EKishore_14%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E1.Is%20our%20above%20suspicion%20correct%20regarding%20the%20CRC%20error%20and%20DEPART%20being%20the%20root%20cause%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIt's%20unclear%20whether%20this%20is%20the%20cause.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E2.Is%20there%20a%20recommended%20procedure%20to%20reset%20the%20DEPART%20register%20to%20its%20default%20value%20(0x0)%20on%20an%20already-partitioned%20S32K118%20device%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E3.What%20is%20the%20correct%20approach%20to%20flash%20the%20D%20Flash%20region%20when%20DEPART%20is%20already%20set%20to%26nbsp%3B0x03%26nbsp%3Bon%20S32K118%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThe%20simplest%20operation%20is%20to%20use%20the%20debugger%20to%20execute%20the%20mass%20erase%20command%20to%20erase%20the%20MCU%20partition%20(note%20that%20CSEc%20was%20not%20enabled%20in%20the%20previous%20partitioning%20operation%2C%20otherwise%20the%20chip%20may%20be%20permanently%20locked%20after%20the%20mass%20erase%20is%20executed).%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorSenlent_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3EFor%20PE%26amp%3BMicro%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20555px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20555px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20555px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20555px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F378501i1D173B5168045E19%2Fimage-dimensions%2F555x323%3Fv%3Dv2%22%20width%3D%22555%22%20height%3D%22323%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EFor%20J-link(j-link%20commander)%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EEnter%20%E2%80%9Cunlock%20kinetis%E2%80%9D%20in%20the%20J-Link%20Commander.%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2327804%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K118%20%E2%80%93%20DEPART%20Register%20Not%20Updating%20%2F%20Unable%20to%20Flash%20D%20Flash%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2327804%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F188029%22%20target%3D%22_blank%22%3E%40Senlent%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E1.We%20need%20to%20confirm%20CSEc%20enablement%20status.%20Currently%20we%20observe%3A%3C%2FP%3E%3CP%3EFSEC%20Register%20%3D%200xFE%20%26amp%3B%3C%2FP%3E%3CP%3EFCSESTAT%20Register%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EBSY%3D0%2C%20SB%3D0%2C%20BIN%3D0%2C%20BFN%3D0%2C%20BOK%3D1%2C%20RIN%3D0%2C%20EDB%3D1%2C%20IDB%3D0%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%3EBased%20on%20these%20observed%20register%20values%2C%20is%20CSEc%20currently%20enabled%20or%20disabled%20on%20our%20S32K118%3F%20or%20in%20which%20register%20i%20ahve%20to%20check%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E2.%26nbsp%3BWe%20executed%20Program%20Partition%20Command%20(FCCOB%5B3%5D%3D0x80)%20with%20these%20parameters%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EFTFC%3C%2FSPAN%3E%3CSPAN%3E-%26gt%3B%3C%2FSPAN%3E%3CSPAN%3EFCCOB%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E3%3C%2FSPAN%3E%3CSPAN%3E%5D%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E0x80%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20FCCOB0%20%3D%200x80%2C%20program%20partition%20command%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3EFTFC%3C%2FSPAN%3E%3CSPAN%3E-%26gt%3B%3C%2FSPAN%3E%3CSPAN%3EFCCOB%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E2%3C%2FSPAN%3E%3CSPAN%3E%5D%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E0x03%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20FCCOB1%20%3D%202b11%2C%2020%20keys%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3EFTFC%3C%2FSPAN%3E%3CSPAN%3E-%26gt%3B%3C%2FSPAN%3E%3CSPAN%3EFCCOB%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E%5D%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E0x00%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20FCCOB2%20%3D%200x00%2C%20SFE%20%3D%200%2C%20VERIFY_ONLY%20attribute%20functionality%20disable%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3EFTFC%3C%2FSPAN%3E%3CSPAN%3E-%26gt%3B%3C%2FSPAN%3E%3CSPAN%3EFCCOB%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E%5D%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E0x00%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20FCCOB3%20%3D%200x00%2C%20FlexRAM%20will%20be%20loaded%20with%20valid%20EEPROM%20data%20during%20reset%20sequence%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3EFTFC%3C%2FSPAN%3E%3CSPAN%3E-%26gt%3B%3C%2FSPAN%3E%3CSPAN%3EFCCOB%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E7%3C%2FSPAN%3E%3CSPAN%3E%5D%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E0x03%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20FCCOB4%20%3D%200x03%2C%202kb%20EEPROM%20Data%20Set%20Size%20for%20S32K118%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3EFTFC%3C%2FSPAN%3E%3CSPAN%3E-%26gt%3B%3C%2FSPAN%3E%3CSPAN%3EFCCOB%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E6%3C%2FSPAN%3E%3CSPAN%3E%5D%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E0x03%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20FCCOB5%20%3D%200x03%2C%20no%20data%20flash%2C%2032k(all)%20EEPROM%20backup%20for%20S32K118%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3EThe%20command%20completed%20successfully%2C%20but%20we%26nbsp%3Bnever%20executed%20any%20LOAD_KEY%20commands%26nbsp%3Bto%20program%20actual%20key%20values.%3CBR%20%2F%3E%3CBR%20%2F%3E3.%20.Current%20situation%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSTRONG%3EFSEC%20%3D%200xFE%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E(KEYEN%20%3D%2011)%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EFCSESTAT%20%3D%200x4002002C%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E(EDB%3D1%2C%20BOK%3D1)%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EDEPART%20register%20%3D%200x03%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E(needs%20reset%20to%200x0)%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EProgram%20Partition%20executed%20but%20no%20keys%20loaded%3C%2FSTRONG%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EWith%20these%20exact%20register%20values%20and%20configuration%20state%2C%20can%20we%20safely%20perform%20mass%20erase%20via%20debugger%2C%20or%20do%20we%20need%20to%20use%20DBG_CHAL%2FDBG_AUTH%20first%20to%20avoid%20permanent%20lockout%3F%22%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2328586%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K118%20%E2%80%93%20DEPART%20Register%20Not%20Updating%20%2F%20Unable%20to%20Flash%20D%20Flash%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2328586%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22mailto%3AHi%40kishore_14%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EHi%40kishore_14%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EYour%20partition%20code%20indicates%20that%20you%20have%20enabled%20CSEc%20and%20assigned%20a%20key.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fpwmxy87654%2Fattachments%2Fpwmxy87654%2FS32K%2F3002%2F1%2FAN5401.pdf%22%20target%3D%22_blank%22%3EAN5401%3A%3C%2FA%3E%3C%2FP%3E%0A%3CP%3Etip1%3A%3C%2FP%3E%0A%3CP%3EOnce%20the%20device%20is%20configured%20successfully%20for%20CSEc%20operation%2C%20the%20FCNFG%20register%20fields%20are%20set%20to%20the%20following.%20FCNFG%5BRAMRDY%5D%20%3D%3D%200%20and%20FCNFG%5BEEERDY%5D%20%3D%3D%201%3C%2FP%3E%0A%3CP%3Etip2%3A%3C%2FP%3E%0A%3CP%3EWith%20the%20CSEc%20key%20enabled%2C%20the%20chip%20cannot%20be%20erased%20in%20the%20program%20using%20the%20Erase%20All%20and%20Erase%20All%20Unsecure%20commands%2C%20nor%20can%20the%20chip's%20security%20function%20be%20disabled%20by%20using%20Mass%20Erase%20to%20erase%20the%20Flash%20via%20the%20debug%20port.%20This%20is%20because%20the%20CSEc%20module's%20key%20is%20stored%20in%20the%20D-Flash.%20To%20completely%20erase%20the%20chip's%20Flash%20and%20disable%20its%20security%20function%20using%20Erase%20All%2C%20Erase%20All%20Unsecure%2C%20and%20the%20Mass%20Erase%20command%20triggered%20by%20an%20external%20debugger%2C%20the%20key%20stored%20in%20the%20D-Flash%20must%20first%20be%20erased%20using%20the%20relevant%20CSEc%20commands%20before%20using%20the%20above%20operations%20to%20completely%20disable%20the%20chip's%20security%20function.%3C%2FP%3E%0A%3CP%3E(refer%20to%20chapter%20%3CSTRONG%3E4.5%20Resetting%20Flash%20to%20the%20Factory%20State%3C%2FSTRONG%3E)%3C%2FP%3E%0A%3CP%3EIn%20short%2C%20once%20CSEc%20is%20enabled%20and%20a%20key%20has%20been%20assigned%2C%20you%20cannot%20directly%20erase%20the%20partition%20using%20mass%20erase.%20Built-in%20application%20code%20is%20required%20to%20use%20the%20CSEc%20module's%20own%20instructions%20to%20restore%20it%20to%20its%20factory%20state.%3C%2FP%3E%0A%3CP%3EIf%20your%20application%20code%20does%20not%20handle%20CSEc%20factory%20restoration%2C%20the%20chip%20may%20not%20be%20able%20to%20restore%20the%20partition%20to%20its%20factory%20state.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E