Skip to main content
JSamo.2
Associate II
May 18, 2021
Solved

OTP basic question (boot modes - STM32MP151 )

  • May 18, 2021
  • 4 replies
  • 2032 views

I apologize in advance as the question is really a basic and obvious one ...

My custom board is using an STM32MP151 SoC.

Is it possible to re-write programmed OTP bits (namely, OTP Word 3 for boot modes).

My feeling is that, this is not possible (One Time Programming).

A complementary question: I try to do a soft selection of the boot source (instead of dealing with hardware pins), so I thought about fusing the OTP word so that it'd start from SPI NAND by default, then force the Serial boot using the TAMP backup register 20 if needed.

Does it makes sense ?

Thanks,

Jacques

This topic has been closed for replies.
Best answer by PatrickF

Hi,

as per reference manual (see BSEC section):

  • OTP virgin bits are set to 0 and can be programmed once to 1.
  • Lower OTP words (i.e. WORD0 to WORD31), can be bitwise programmed in several operations.

This mean, on lower OTPs, you could set a anytime a bit from 0 to 1, but never clear them.

For your case, I think you don't need to fuse any OTP (except OTP WORD9 is your Serial-NAND require it), just set the Boot pins to Serial-NAND (BOOT[2:0] = 0b111).

If Flash is empty (or no valid header found), BootROM will fallback to serial boot. See https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_code_overview#Boot_interface_selection

Once application is started, you could set TAMP_REG[20] = 0xFF and reset the board to force a serial boot.

Alternatively, with DK2 and EV1 boards using Started Package, uBoot could detect User1 (PA14) button pressed during reset and enable USB DFU connection. See https://wiki.st.com/stm32mpu/wiki/LEDs_and_buttons_on_STM32_MPU_boards#Description

Regards.

4 replies

PatrickF
PatrickFBest answer
ST Employee
May 19, 2021

Hi,

as per reference manual (see BSEC section):

  • OTP virgin bits are set to 0 and can be programmed once to 1.
  • Lower OTP words (i.e. WORD0 to WORD31), can be bitwise programmed in several operations.

This mean, on lower OTPs, you could set a anytime a bit from 0 to 1, but never clear them.

For your case, I think you don't need to fuse any OTP (except OTP WORD9 is your Serial-NAND require it), just set the Boot pins to Serial-NAND (BOOT[2:0] = 0b111).

If Flash is empty (or no valid header found), BootROM will fallback to serial boot. See https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_code_overview#Boot_interface_selection

Once application is started, you could set TAMP_REG[20] = 0xFF and reset the board to force a serial boot.

Alternatively, with DK2 and EV1 boards using Started Package, uBoot could detect User1 (PA14) button pressed during reset and enable USB DFU connection. See https://wiki.st.com/stm32mpu/wiki/LEDs_and_buttons_on_STM32_MPU_boards#Description

Regards.

In order to give better visibility on the answered topics, please click on 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent
JSamo.2
JSamo.2Author
Associate II
May 20, 2021

Hi,

Thanks Patrick for this very complete answer !

rgds,

Jacques

PatrickF
ST Employee
May 20, 2021

If my reply answered your question, please click on Select as Best at the bottom of the post. This will help other users with the same issue to find the answer faster.

In order to give better visibility on the answered topics, please click on 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent
JSamo.2
JSamo.2Author
Associate II
May 20, 2021

sure ... done