2164525_en-US

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

2164525_en-US

2164525_en-US

IMXRT1176 OTFAD Decrypting Flash when reading over SWD

Hi,

I'm currently using the OTFAD to encrypt code stored in External Flash on the IMXRt1176. 

I've run two tests, one where I encrypt with the KEK burned into the fuses and one where I encrypt with a different key. 

In the first test, the software runs as expected and in the second the software doesn't run which is also expected. 

When I read the external flash using the memory browser in MCUXpresso, I noticed when I use the incorrect key to encrypt the image the flash contents looks encrypted but when I use the correct key the flash contents look exactly like the unencrypted image. 

My theory is that I'm reading the flash from the CPU's address space and the OTFAD is running so it's decrypting the the contents as I read it. If the OTFAD uses the incorrect key then the contents is not decrypted properly, hence why it doesn't match the original image.

Does the above sound correct?

If so, I'm running into an issue when verifying with the PEMicro Cyclone Programmer and I think it has to do with this. When I program a fresh device, the verification passes. When I reprogram, it does not pass. I think on the second round the OTFAD has loaded the key and decrypts the image as the Cyclone reads it back. If it's decrypted, then it fails verification because it does not match the encrypted image. 

I know that it does program correctly because I can run the software and it reports the updated version number.

Re: IMXRT1176 OTFAD Decrypting Flash when reading over SWD

Hi @rnicolls ,


Yes, it is the expected result due to OTFAD.


Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

Re: IMXRT1176 OTFAD Decrypting Flash when reading over SWD

Hi Kan,

Yes, I always erase before programming and the issue persists. I also tried performing a mass erase followed by a reset and then programming and verifying but this causes it to fail the programming step. 


Could you confirm that reading the flash over SWD will show the unencrypted data due to the OTFAD running?

Best,

Rory

Re: IMXRT1176 OTFAD Decrypting Flash when reading over SWD

Hi @rnicolls ,


Thanks for the clarification! maybe you are right, it is needed to check with "PEMicro", maybe it directly read flash contents for verification.


BTW, have you tried a mass erase before reprogramming? Did it make any difference?



Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

Re: IMXRT1176 OTFAD Decrypting Flash when reading over SWD

Hi Kan, 

I'm programming and verifying with the PEMicro Cyclone FX.


Re: IMXRT1176 OTFAD Decrypting Flash when reading over SWD

Hi @rnicolls ,


May I know which tool you are using to program and verify the flash? by SEC tool or others? Please kindly clarify.


Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

标记 (1)
无评分
版本历史
最后更新:
‎11-21-2025 05:57 PM
更新人: