Skip to main content
Explorer II
December 4, 2025
Solved

GPIO Usage on STM32N6

  • December 4, 2025
  • 1 reply
  • 73 views

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?

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

    @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

    1 reply

    RomainR.Answer
    ST Employee
    December 4, 2025

    @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