S32K144 CSEc module CMD_GENERATE_MAC

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

S32K144 CSEc module CMD_GENERATE_MAC

2,040 Views
lyz
Contributor II

Problem: When using S32K144 to generate MAC value calculation, while waiting for the execution of the CSEc command CMD_GENERATE_MAC, the P-Flash is accessed asynchronously, and the result is reset, as follows:

long int index;
unsigned int *add = (unsigned int *)0x0;
void CSEC_WriteCmdAndWait(csec_cmd_t funcId,
csec_func_format_t funcFormat,
csec_call_sequence_t callSeq,
csec_key_id_t keyId)
{
char i;
CSE_PRAM->RAMn[0].DATA_32 =
CSE_PRAM_RAMn_DATA_32_BYTE_0(funcId) |
CSE_PRAM_RAMn_DATA_32_BYTE_1(funcFormat) |
CSE_PRAM_RAMn_DATA_32_BYTE_2(callSeq) |
CSE_PRAM_RAMn_DATA_32_BYTE_3(keyId);

while ((FTFC->FSTAT & FTFC_FSTAT_CCIF_MASK) == 0U)
{
/* Wait until the CCIF flag is set */
for (index = 0; index < 10 *1024; index++)
{
i = add[index];
}
}
}

It is ok to wait for the command execution to complete in while, but reset occurs when accessing data on p-flash

0 Kudos
Reply
3 Replies

2,034 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

not sure if I can understand the description. Do you run some flash operation or do you only read the pflash?

lukaszadrapa_0-1653306613030.png

 Regards,

Lukas

0 Kudos
Reply

2,025 Views
lyz
Contributor II

thanks for your message!

reading the p-flash in running csec operation of generate mac at the same time.

0 Kudos
Reply

2,018 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I can't see a reason for that. Moreover, when using CSEC_DRV_GenerateMAC function, CSEc does not access the flash directly. This function just copies required data to CSE PRAM memory and then CSEc calculates MAC over this data. The CSEc reads the flash directly only when using CSEC_DRV_GenerateMACAddrMode.

So, it seems to be just a side effect of something else. What can you see in RCM_SRS register after such reset?

Regards,

Lukas

0 Kudos
Reply