S32K144 - detect partition settings and change partitioning settings at runtime

cancel
Showing results for 
Search instead for 
Did you mean: 

S32K144 - detect partition settings and change partitioning settings at runtime

Jump to solution
280 Views
andy63
Contributor II

Hello all,

I'm working with a S32K144 device, no RTOS, no SDK are used.
The device memory is partitioned for EEPROM usage as shown in reference manual (page 864) and in workshop document - AMF-AUT-T3822 Writing CSEc Security Software on S32K MCU_rev2.pdf - tables / sample code (page 27, 29).

For some historical reasons we have devices in the field - fully potted - with invalid settings. The CSEc Key size field is set to 0x00 instead of 0x03. The firmware of these devices must be updated via field bus interface. I do not have access to the SWD programmer interface.

So I am faced with two questions which must be solved in the new firmware:

  • How to determine which CSEc key size value is actually set in this controller?
  • Once I have determined the partitioning (CSEc key size value) is wrong (zero value), how can I change the partitioning from a running application?

The register SIM->FCFG1 provides the information about EEPROM data set size and FlexNVM partition code.

But for CSEc key size value I'm missing an equivalent register.

Kind regards,

Andreas

0 Kudos
1 Solution
234 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Andreas,

There is no register that would show the size of the space allocated for the CSEc keys.

But I think you can tell which MCU has been partitioned from FlexRAM.

Because, for example, if the allocated CSEc space is 512B, the space 0x14000E00-0x14000FFF will not be accessible.

It should generate a bus fault on a read access.

 

The partitioning can be removed either by Mass Erase or by CMD_DB_CHAL and CMD_DBG_AUTH provided the MCU is partitioned for CSEc.

I'm afraid you will need to mass erase the MCU that are partitioned for EEPROM but not for CSEc.

 

Regards,

Daniel

View solution in original post

0 Kudos
2 Replies
208 Views
andy63
Contributor II

Hello Daniel,

thanks for your reply. 

That's not quite what I was hoping for, but now I have to find a way to deal with it.

Regards,

Andreas

0 Kudos
235 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Andreas,

There is no register that would show the size of the space allocated for the CSEc keys.

But I think you can tell which MCU has been partitioned from FlexRAM.

Because, for example, if the allocated CSEc space is 512B, the space 0x14000E00-0x14000FFF will not be accessible.

It should generate a bus fault on a read access.

 

The partitioning can be removed either by Mass Erase or by CMD_DB_CHAL and CMD_DBG_AUTH provided the MCU is partitioned for CSEc.

I'm afraid you will need to mass erase the MCU that are partitioned for EEPROM but not for CSEc.

 

Regards,

Daniel

View solution in original post

0 Kudos