cancel
Showing results for 
Search instead for 
Did you mean: 

OTP basic question (boot modes - STM32MP151 )

JSamo.2
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

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 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
PatrickF
ST Employee

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 'Accept as Solution' on the reply which solved your issue or answered your question.
JSamo.2
Associate II

Hi,

Thanks Patrick for this very complete answer !

rgds,

Jacques

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 'Accept as Solution' on the reply which solved your issue or answered your question.
JSamo.2
Associate II

sure ... done