S32K146 Program Partition

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

S32K146 Program Partition

521 Views
ikarkala
Contributor III

I want to change the DEPART value in my s32k146 .

1.Is it possible to change its value without mass erase ? If yes what command can be used ? 

2.If No How can we check if cse is enabled 

3.Do we have to completely mass erase and repartition to change the value of DEPART 

4. After mass erase can we reset and continue partition by running the code or is there anything that we have to do prior to it 

 

0 Kudos
Reply
1 Reply

501 Views
prakashram72
Contributor III

Hi @ikarkala ,

Changing the DEPART value on the S32K146 involves manipulating the flash memory partitioning. Here are the answers to your questions:

 

1. No, it's not possible to change the DEPART value without a mass erase. The DEPART value is stored in the Flash Configuration Field (FCF) which is a part of the flash memory. Changing this value requires erasing and reprogramming the FCF, which is a part of the mass erase operation.

2. To check if the CSE (Cryptographic Security Engine) is enabled, you can read the CSE_PRAM register. If the CSE is enabled, the CSE_PRAM[0] bit will be set to 1. Here is a code snippet to check this:

 if ((CSE->CSE_PRAM & CSE_PRAM_CSE_EN_MASK) == CSE_PRAM_CSE_EN_MASK) {     // CSE is enabled } else {     // CSE is not enabled } 

3. Yes, to change the DEPART value, you have to perform a mass erase and then repartition the flash memory. This is because the DEPART value is stored in the FCF which is a part of the flash memory.

4. After a mass erase, you can reset and continue partitioning by running the code. However, you have to ensure that the new DEPART value is correctly set in the FCF. Here is a code snippet to set the DEPART value:

 // Set the DEPART value FTFC->FCCOB3 = FTFC_FCCOB3_CCOBn(0x80); // Program Partition command FTFC->FCCOB4 = FTFC_FCCOB4_CCOBn(DEPART_VALUE); // DEPART value // Execute the command FTFC->FSTAT = FTFC_FSTAT_CCIF_MASK; 

Please refer to the Flash Partitioning on S32K1xx article for more details about flash partitioning on the S32K146.

 

Regards,

Prakash

0 Kudos
Reply