Can't read OTP from AES encrypted program

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
milo
Newbie
Posts: 1
Joined: Fri May 14, 2021 1:29 pm

Can't read OTP from AES encrypted program

Post by milo »

I've stored a serial number for my product in OTP. My program can read the serial number just fine using OTP_read() if I run it using JTAG and reading OTP with xburn shows it is there. However, if I boot from an encrypted AES image of my program stored in flash, otp_read() returns a value of 0 instead of the stored serial number. Is OTP off limits to programs that have been encrypted? I can't find anything in the documentation to explain this.
User avatar
andrewxcav
Verified
Experienced Member
Posts: 79
Joined: Wed Feb 17, 2016 5:10 pm

Post by andrewxcav »

https://www.xmos.com/documentation/XM-0 ... guard.html

I think the secure boot bit disables OTP read.
Adam Frew
Junior Member
Posts: 5
Joined: Wed Jan 04, 2023 11:18 am

Post by Adam Frew »

I am having the exact same problem.

Is there no way around this problem? I too can't find any official documentation which indicates that this won't work.
User avatar
andrewxcav
Verified
Experienced Member
Posts: 79
Joined: Wed Feb 17, 2016 5:10 pm

Post by andrewxcav »

Try to search the datasheet for "security register features," hopefully you can then query that and see if reading has been disabled by the security bit.

I agree I cannot find a definitive answer saying that the security bit implies this, but it makes sense to me as this would prevent you from reading off the key at runtime.
Adam Frew
Junior Member
Posts: 5
Joined: Wed Jan 04, 2023 11:18 am

Post by Adam Frew »

I managed to fix my issue by appending the --enable-otp flag to the end of my xflash command which constructs my final .bin image.

Hope this helps other people.