cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO Usage on STM32N6

digilog
Associate II

This is a pretty basic question but I would like a bit of clarity if possible.

If a GPIO pin is configured for the fsbl code can it also be used in the Appli code?

If so how would you go about defining it in the Appli code? There doesn't seem to be an option to use a GPIO pin in both fsbl and Appli in STM32CubeMX or do you have to configure it manually in the Appli code?

1 REPLY 1
RomainR.
ST Employee

@digilog 

 
You need to distinguish between peripheral configuration (here, the GPIOs) and execution contexts.
 
If your GPIOs are already configured by the FSBL, they will be directly usable in the Application, and you will have nothing to do except HAL_GPIO_WritePin in the Application, just like SystemClock_Config() which is executed by the FSBL, the RCC configuration remains intact in the Application.
 
Remember that the STM32N6 is always in secure mode.
However, if you have a third execution context, Non-Secure (AppNS), this is different, and you will need to configure the peripheral privileges in the secure world in order to use them in the non-secure world (refer to the Template_Isolation_LRUN example)
Let me know if it clarifies your question ?
Best regards,
Romain

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.