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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
933 次查看
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 项奖励
回复
1 解答
649 次查看
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 项奖励
回复
5 回复数
897 次查看
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 项奖励
回复
791 次查看
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 项奖励
回复
765 次查看
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 项奖励
回复
706 次查看
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 项奖励
回复
650 次查看
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 项奖励
回复