Skip to main content
Visitor II
January 28, 2021
Question

What should I do to maintain GPIO PIN status during bootloader execution?

  • January 28, 2021
  • 2 replies
  • 1639 views

I am using a bootloader as STM32F405.

Before Jump_to_application(), I want to keep the GPIO status in API, but what should I do?

After the GPIO PIN is output "high" from the current boot firmware, it runs the jump_to_application().

The parameters are initialized at API run, and the GPIO PIN is output to Low.

Is there any way to keep the GPIO PIN "High"?

The code is as follows.

JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);

Jump_To_Application = (pFunction) JumpAddress;

HAL_RCC_DeInit();

HAL_DeInit();

__set_MSP(*(__IO uint32_t*) (APPLICATION_ADDRESS));

Jump_To_Application();

    This topic has been closed for replies.

    2 replies

    Graduate II
    January 28, 2021

    Find a different entry point​

    Visitor II
    July 17, 2024

    Can you elaborate how to resolve this issue am using STM32L010R8T6 device how to retain gpio state when jumping from main application to bootloader section. i want to retain one gpio pin state from main application to bootloader.

     

    Here is the code for jumping application to bootloader.

    void BootLoader_jumpToApp(void)

    {

    volatile uint32_t *appVT;

     

    // main app's vector table

    if (g_eeprom->active_image == FW_IMG_B)

    {

    // Bank B

    appVT = (volatile uint32_t *)UPGRADE_APP_BASE;

    LOG_INFO(MAIN_LOG, "Main APP : Jump to App B %x", appVT);

    HAL_Delay(TICKS_2MS);

    g_BootLoaderJumpFlag = JUMP_TO_MAIN_APPLICATION;

    HAL_NVIC_SystemReset();

    while(1);

    }

    else

    {

    // Bank A

    appVT = (volatile uint32_t *)FLASH_BASE;

    LOG_INFO(MAIN_LOG, "Main APP : Jump to App A %x", appVT);

    HAL_Delay(TICKS_2MS);

    g_BootLoaderJumpFlag = JUMP_TO_BOOTLOADER;

    HAL_NVIC_SystemReset();

    while(1);

    }

     

     

     

     

    Thanks,

    Meimurugan

    Graduate II
    January 28, 2021

    Only external Pulls will guarantee.