In this guide, we will step-by-step guide you to use OPT Tool (a software application) to burn OTP bits on SP7350 platforms.
1. Prerequisites:
Before proceeding, ensure that you have compiled your SP7350 code to support the OTP Tool.
Please confirm that the OTP driver in X-Boot is enabled. For guidance, refer to the screenshot below:
2. UART connection setup
2.1 Close terminal applications
Close terminal applications such as Putty to free up the COM port connected to the SP7350 platform.
2.2 Run OTP Tool
Launch "OTP Tool.exe" on your PC. Once started, the application interface will be displayed as shown below:
2.3 Configure COM port
Set the COM port connected to the SP7350 platform. Refer to screenshot below:
For instance, if UART0 of the SP7350 platform is linked to COM5 on your PC, select COM5 and set the Baudrate to 115200. Refer to screenshot below:
Press OK.
2.4 Connect with SP7350 platform
Click "Connect" button in the OTP Tool and power on the SP7350 platform.
The status window of OTP Tool indicates "CONNECT Success!" as shown above.
3 OTP Tool operations:
3.1 Open Excel file (OTP table)
Open the OTP table Excel file. Refer to screenshot below:
When Open diaglog box is displayed, select the Excel file "OTP_TABLE_QAK654.xls". Then, press OK button. Refer to screenshot below, OTP table are loaded successfully.
3.2 Read and modify OTP bits
Press "Read" button to read the content of OTP from the SP7350 platform. Refer to screenshot below, Read command completed successfully.
The status window of OTP Tool indicates "READ Start…” and next “READ Success!" as shown above.
3.3 Write to OTP bits
For modifications, right-click on the relevant bit or bit range, select "Modify item":
Input the new value, and press OK.
After making all necessary modifications, click "Write" to write the changes to the OTP of the SP7350 platform. Refer to screenshot below, bit [543:512] is updated:
4. Burning secure-boot and device keys:
SP7350 supports secure-boot. To enable secure-boot, you need to build code with security enabled and write secure keys into OTP of SP7350. There are two keys defined in OTP. One is secure-boot key and the other is device key. Each key is 32 bytes long. Secure-boot key is for digital signature. Device key is for decrypting image.
4.1 Burn secure-boot public key (for digital signature) into OPT bit 765 ~ 512
Secure-boot key is stored in file build/tools/secure_hsm/secure/otp_Sb_keys/ed_pub_0.hex:
7BBBCF06A44BA7655540A7F8AD5176F4BCA83F00E63442A7BA0C4F5D8BBCF650
Convert key to little-endian 4-byte word.
OTP[543:512] = 06CFBB7B OTP[575:544] = 65A74BA4 OTP[607:576] = F8A74055 OTP[639:608] = F47651AD OTP[671:640] = 003FA8BC OTP[703:672] = A74234E6 OTP[735:704] = 5D4F0CBA OTP[767:736] = 50F6BC8B
Input key to OTP words one by one, and then check and then press "Write"
You can press 'Read' to read back content of OTP.
4.2 Write device private key (for decryption) into OTP bit 1023 ~ 768
Device private key is stored in hex file build/tools/secure_hsm/secure/otp_Device_keys/x_priv_0.hex:
583D94
Convert key to little-endian 4-byte word.
OTP[799:768] = 79943D58OTP[831:800] = 29520D76
OTP[863:832] = 01461A61 OTP[895:864] = 0EE81ECB OTP[927:896] = E17B0C2C OTP[959:928] = 37C6F4E8 OTP[991:960] = D572EAA9 OTP[1023:992] = 5CB2A3A5
OTP[799:768] = 79943D58
OTP[831:800] = 29520D76
OTP[863:832] = 01461A61
OTP[895:864] = 0EE81ECB
OTP[927:896] = E17B0C2C
OTP[959:928] = 37C6F4E8
OTP[991:960] = D572EAA9
OTP[1023:992] = 5CB2A3A5
Follow the provided steps, ensuring the correct conversion and input of the key.
Burn Device Private Key (For Decryption): Write the device private key into OTP[1023 ~ 768]. Follow the provided steps, ensuring the correct conversion and input of the key.
Important Notes:
Burning OTP bits is irreversible, and incorrect burns may render the IC unusable.
Save the keys in designated directories (hsm_keys, otp_Sb_keys, and otp_Device_keys).
Follow these steps diligently to successfully utilize the OTP Tool and enhance the security features of your SP7350 platform.
Burn secure-boot and device Keys
Write Secure-Boot Public Key (For Digital Signature): Write the secure-boot public key into OTP[765 ~ 512]. Follow the provided steps, ensuring the correct conversion and input of the key.
Write Device Private Key (For Decryption): Write the device private key into OTP[1023 ~ 768]. Follow the provided steps, ensuring the correct conversion and input of the key.
Write 1 to OTP[0]: Write the value '1' to OTP[0]. Ensure not to enable the HWLOCK_MP_ENABLE bit.
Note:
Burning the keys (OTP) is irreversible. Incorrectly burned keys will render the IC unusable.
Save the keys in the directories: hsm_keys, otp_Sb_keys, and otp_Device_keys.