Setting Custom GPIO Immediately After Reboot

This application note explains how to manipulate GPIO immediately after power-on / reboot. This feature can be used to indicate to the user that the device is alive and running, while the system still continues to boot up. For instance, the unit can turn on certain LED's, etc.

1. Understanding Early GPIO Handling

1.1. U-Boot Custom GPIO Handling Function

A placeholder function for setting up custom GPIO resides in the board/emcraft/stm32h7-som/stm32h7-som.c module in the U-Boot source tree. This function is the place where the custom, board-specific early GPIO handling code should be placed.

The prototype of this function is defined as follows:

static void custom_gpio_setup(void);

The custom_gpio_setup() function is called from the standard U-Boot function board_late_init(), which is enabled by the CONFIG_BOARD_LATE_INIT configuration option.

1.2. Example of GPIO Handling Function

In a way of providing an example of using that function, U-Boot turns LED1 on.