[Security] D-Flash CSE driver encryption/decryption interface limitations

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

[Security] D-Flash CSE driver encryption/decryption interface limitations

Jump to solution
1,460 Views
Gideon
Contributor III

Dear NXPs:

Bootloader- D-Flash-32K

Are there any restrictions if I call CSEC_DRV_EncryptCBC/CSEC_DRV_DecryptCBC interfaces of the CSEc driver on D-Flash?

0 Kudos
Reply
1 Solution
1,176 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

I haven't met this use-case yet but I can see in the manual that you are right. It explicitly says:

lukaszadrapa_0-1715759187636.png

 If your code is running from data flash, solution is to put the function to RAM memory.

View solution in original post

0 Kudos
Reply
5 Replies
1,424 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Gideon 

If we are talking about CSEc commands CMD_ENC_CBC and CMD_DEC_CBC, there are no limitations because it is up to software to load plain/encrypted data to CSEc via PRAM interface and then read encrypted/plain data from PRAM. So, software can read the data from anywhere. Mentioned SDK function do not check the addresses, so it can read the data from whole memory map. Just the output buffer needs to be in RAM, of course, so the driver can write the result to the buffer.

Regards,

Lukas

0 Kudos
Reply
1,318 Views
Gideon
Contributor III
Dear lukaszadrapa:
@lukaszadrapa
NXP S32K142 executes CSEC_CMD_ENC_CBC command in D-Flash, but PUBWEAK HardFault_Handler occurs
SECTION .text:CODE:REORDER:NOROOT(1)
HardFault_Handler
B. Error. There is no problem with IAR Debug single-step execution, but the above HardFault will occur when F5 is executed at full speed, which is very strange.
0 Kudos
Reply
1,292 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Gideon 

not sure what's going on.

First step - did you try to disable interrupts? Second step - you can try to find out what is the reason of the fault exactly:

https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447

https://www.nxp.com/docs/en/application-note/AN12201.pdf

Regards,

Lukas

 

0 Kudos
Reply
1,233 Views
Gideon
Contributor III

Dear lukaszadrapa:
@lukaszadrapa

A1:Disabling interrupts has no effect.The interface I use is 

INT_SYS_DisableIRQGlobal();
INT_SYS_EnableIRQGlobal();
A2: IBUSSERR

By the way Viewed the manual S32K-RM.pdf Table 37-7. Allowed simultaneous memory operations,

There are limitations in operating CSE PRAM on D-Flash,Could IBUSSERR be related to this?

Gideon_1-1715340768594.png

 

 
 

 

0 Kudos
Reply
1,177 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

I haven't met this use-case yet but I can see in the manual that you are right. It explicitly says:

lukaszadrapa_0-1715759187636.png

 If your code is running from data flash, solution is to put the function to RAM memory.

0 Kudos
Reply