-
Notifications
You must be signed in to change notification settings - Fork 877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing otp.json file reports an error #556
Comments
Have you previously written these otp.json files to your OTP (like in #554)? If so, then see 13.5.2 in the datasheet - you cannot re-write a key once you've set the valid bit, so cannot re-write these otp.json files to the same device again. If you want to use the same device again they you'll need to delete the
I'm not sure what you mean by this - the encrypted programs all run in SRAM, and the encrypted bootloader will only run encrypted programs, so if you try to run something encrypted with a different key (or not encrypted at all) then it will just be decrypted as garbage and won't be run? |
Was this definitely the first time writing the OTP keys and key_valid bits on the device? You can check this with
Secure boot hasn't been enabled on your device, because the |
Hi,
I defined a new key and updated the otp.json file (according to #536). I wrote the new key to an unused page in otp, and it showed that the write failed, but the encryption program with the new key can run normally (the encryption program cannot be run when the otp.json file is not written). It seems that the new key has been written to the corresponding page of otp.
![image](https://private-user-images.githubusercontent.com/97655921/371818987-d607cc15-021c-45d2-b81c-e0348c3e9894.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MjIzODYsIm5iZiI6MTczOTYyMjA4NiwicGF0aCI6Ii85NzY1NTkyMS8zNzE4MTg5ODctZDYwN2NjMTUtMDIxYy00NWQyLWI4MWMtZTAzNDhjM2U5ODk0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDEyMjEyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWExOGExMDI1NGE0OWMwMTQyOTZlY2QzZmFiYzRlODE4ZDgxNjhjYmJlYjNkYzY3NjFiNjRiNDA2MWVkYmE1NzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JL6tpoP4lgDnx8dh4EGb_y3lHgyLIbMbclKOhxglbCg)
In addition, I tested writing the otp.json file in the build directory to otp and performing a secure boot. The write also failed, but the encryption program can run normally. Running an unencrypted program is the same as a non-secure boot, it cannot run in flash, but it can run in SRAM. Is this normal?
![image](https://private-user-images.githubusercontent.com/97655921/371818990-74163902-6688-4905-aef7-2b43da467129.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MjIzODYsIm5iZiI6MTczOTYyMjA4NiwicGF0aCI6Ii85NzY1NTkyMS8zNzE4MTg5OTAtNzQxNjM5MDItNjY4OC00OTA1LWFlZjctMmI0M2RhNDY3MTI5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDEyMjEyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlhMTkyZDEzOTE0ZDNjYjc4ZGVkZDJlNmQxY2U0MmU0Mjk4YjBiY2QxYWM2OGQ5MzdmMWZjNzlmZjZiZDdiZjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.T9QGQLSnG9Ncgpa3ZGsYtWrPbRDuBEMGgsDwONMV92k)
The text was updated successfully, but these errors were encountered: