cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to boot after writing OTP word 60 with 32-bit word

jandriea
Associate II

I want to store some configurations in the OTP. The datasheet states that the OTP word 59 to 95 are free for users. In DK boards, OTP word 59 is already claimed as board_id, so I use word 60 as my starting point. Currently, I am using both environments 3.0 (using yocto) and 2.0 (using buildroot) and I prepared the OTP map by modifying the tf-a device tree.

---------------------------------------------
&bsec{
	status = "okay";
	secure-status = "okay";
 
	board_id: board_id@ec {
		reg = <0xec 0x4>;
		st,non-secure-otp;
	};
 
	conf_sec: conf_sec@f0 {
		reg = <0xf0 0x40>;
		st,non-secure-otp;
	};
};
---------------------------------------------
&nvmem_layout {
	nvmem-cells = <&cfg0_otp>,
		      <&part_number_otp>,
		      <&monotonic_otp>,
		      <&nand_otp>,
		      <&uid_otp>,
		      <&package_otp>,
		      <&hw2_otp>,
		      <&pkh_otp>,
		      <&board_id>,
	              <&conf_sec>;
 
	nvmem-cell-names = "cfg0_otp",
			   "part_number_otp",
			   "monotonic_otp",
			   "nand_otp",
			   "uid_otp",
			   "package_otp",
			   "hw2_otp",
			   "pkh_otp",
			   "board_id",
			   "conf_sec";
};

at first, I successfully flashed the image and write the OTP to word 60. However, I cannot read the OTP table after I write my configuration to the OTP

0693W00000BcFTIQA3.pngafter I got the error, I thought that I only need to reboot the board. But unfortunately, the board failed to boot. I tried to re-flash the image but the I got a timeout error. The serial out showed something like this.

0693W00000BcFSZQA3.pngAfter I tried with multiple boards, I found out that I can only write the lower 16-bit of the OTP word (ex, 0x0000FFFF). However, if I change any single bit in the upper 16-bit of the OTP word, the board will break.

I believe there is something wrong with OTP mapping that makes the image failed to boot from MMC or USB/Serial. Now, I need help to resolve this issue because I have 3 broken DK boards

3 REPLIES 3
Olivier GALLIEN
ST Employee

Hi @jandriea​ ,

Not clear if you are still able to boot up to Uboot ?

If yes can you please send the boot log and try to read the OTP from Uboot ?

https://wiki.st.com/stm32mpu/wiki/How_to_update_OTP_with_U-Boot

Thanks

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi @Community member​ 

Unfortunately, the boards are unable to boot up to uboot. The boot sequence stopped after printing these messages

========================

NOTICE: BL2: Booting BL32                                                     

INFO:   Entry point address = 0x2ffeb000                                      

INFO:   SPSR = 0x1d3  

=======================

MJerm.1
Associate II

The same problem. It is not possible to write to user space in otp? How to fix broken boards?