Skip to main content
sbaek.11
Associate
Jan 28, 2021 4:23 AM UTC
Question

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

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.

4 replies

Tesla DeLorean
Guru
Jan 28, 2021 7:06 AM UTC

Find a different entry point​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Associate II
Jul 17, 2024 9:13 AM UTC

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

Andrew Neil
Super User
Jul 17, 2024 10:16 AM UTC
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Uwe Bonnes
Chief
Jan 28, 2021 11:50 AM UTC

Only external Pulls will guarantee.