cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP135 - Programmatically set boot pins and restart the ROM Boot

OPetr.2
Associate II

We are developing a board with stm32mp135 processor and to load the entire operating system on the external mmc we set the boot pins in USB boot programming mode, after which we use Stm32 cube programmer.
If we wanted to carry out this operation even when the card is sealed and only has the external USB connector, how could we do it? Is it possible to programmatically change the state of the boot pins from a resident SW application, restart the processor, use the stm32 cube progremmer again and then restore the state of the boot pins and reset again?
Essentially we would like to carry out the procedure described in https://wiki.st.com/stm32mpu/wiki/STM32MP13_Discovery_kits_-_Starter_Package

(paragraph 6.2 and 7) programmatically. Is there any other solution?

1 REPLY 1
PatrickF
ST Employee

Hi,

Usually no need to play with BOOT pins (unless the platform is bricked).

If BOOT pins are set to a eMMC (BOOT=b010) and no valid TF-A header found, the Boot will automatically fallback to Serial (UART/USB). This is handy for the initial programming of the Flash.

Then, during runtime of the product, SW could set BOOT_MODE (TAMP_REG[30]) to 0xFF to ask again for a serial (UART/USB) boot, then issue an HW reset  which activate NRST pin (e.g. using RCC_MP_GRSTCSETR).

See https://wiki.st.com/stm32mpu/wiki/STM32MP13_backup_registers#Boot_mode_selection_feature

and https://wiki.st.com/stm32mpu/wiki/STM32_MPU_ROM_code_overview#Boot_device_selection

Notice that TAMP_REG[30] should be retained during NRST cycle, either by avoiding the STPMIC1 to do a VDD power cycle (default behavior set during boot in our SW deliveries) or having VBAT presence.

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.