How to set the OTP bits?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-05 6:08 AM
I have a custom STM32MP157c board. I try to set fuse bits (3 0x23000000). It worked on the basic boot system but not on the TF-A boot system.
I mean by example the boot command : fuse prog 0 3 0x23000000.
- Labels:
-
STM32MP15 Lines
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-06 12:41 AM
Hi Ronte.1 (Community Member)
Fuse cmd only works at U-boot stage, basic boot refers to U-boot SPL.
When TF-A is used as the First Stage Boot loader it needs U-boot as SSBL, as recommended for product development, then fuse command will work.
https://wiki.st.com/stm32mpu/wiki/Boot_chain_overview
https://wiki.st.com/stm32mpu/wiki/U-Boot_overview#U-Boot_overview
https://wiki.st.com/stm32mpu/wiki/How_to_update_OTP_with_U-Boot
Regards,
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-06 4:55 AM
I have the recommended setup for TF-A. Fuse command works indeed, with read and sense, but the prog command fails.
Regards,
Raimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-06 6:53 AM
Is the OTP lock bit set? Did you reboot?
otherwise I tried on my board:
at U-boot prompt, for ex write in OTP57:MAC address "12:34:56:78:9a:bc"
STM32MP> fuse sense 0 0x10000039 2
Sensing bank 0:
Word 0x10000039: 00000000 00000000
STM32MP> fuse prog -y 0 57 0x78563412 0x0000bc9a
Programming bank 0 word 0x00000039 to 0x78563412...
Programming bank 0 word 0x0000003a to 0x0000bc9a...
STM32MP> fuse sense 0 57 2
Sensing bank 0:
Word 0x00000039: 78563412 0000bc9a
reboot...
STM32MP> env print ethaddr
ethaddr=12:34:56:78:9a:bc
STM32MP> fuse prog 0 3 0x23000000
Programming bank 0 word 0x00000003 to 0x23000000...
Warning: Programming fuses is an irreversible operation!
This may brick your system.
Use this command only if you are sure of what you are doing!
Really perform this fuse programming? <y/N>
Regards,
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-02 12:35 AM
Yes, it goes just like in your log but when I answer "y" in the last "Really perform this fuse programming?" the programming procedure fails.
Regards,
Raimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-10 5:38 AM
What is OTP lock bit ?
Regards Raimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-10 6:26 AM
Hi Ronte.1 (Community Member)
This is used to permanently write lock one OTP word and therefore once the lock is set the OTP word is no more programmable, specially designed for upper OTPs that are word accessed and builtin with ECC, so when one upper OTP word is written, it should be write lock protected to prevent any further writes on the same OTP word.
Regards
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-13 11:40 PM
So I'm trying to set OTP bank 0 word 3 to 0x23000000 to set the boot order of the device.
The programming command fails as described above. The error follows:
stm32_smc: Failed to exec svc=82001003 op=2 in secure mode (err = -2)
ERROR
Is there some way to make it work ?
Regards Raimo
