Skip to main content
edited tags
Link
Lundin
  • 22.2k
  • 1
  • 30
  • 83
code formatting
Source Link
Velvet
  • 4.7k
  • 5
  • 18
  • 32

Issue After Bootloaderafter bootloader on STM32F072RBT6: Stack Pointer Not Jumpingnot jumping to Application Addressapplication address

I am currently working on a project using the STM32F072RBT6 microcontroller, where I have implemented a custom bootloader to load an application program into flash memory. However, after the bootloader successfully writes the application binary, the stack pointer does not correctly jump to the application’s address, and the application fails to execute.

MCU Model: STM32F072RBT6 Bootloader

Functionality: The bootloader receives the application binary and writes it to flash memory at the designated application address.

Application Flash Address: 0x08004000

Problem: After the bootloader completes, I attempt to jump to the application by setting the stack pointer and program counter accordingly, but the application does not start. It appears that the stack pointer is not correctly set to the application's address.

Jump Code in Bootloader:

static void goto_application(void){

void (* app_reset_handler)(void) = (void )((volatile uint32_t *) (0x08004000 + 4));

__disable_irq();

__set_MSP((*(volatile uint32_t *)0x08004000));

__enable_irq();

app_reset_handler();

}

static void goto_application(void) {
    void (* app_reset_handler)(void) = (void *)(*(volatile uint32_t *) (0x08004000 + 4));

    __disable_irq();

    __set_MSP((*(volatile uint32_t *)0x08004000));

    __enable_irq();

    app_reset_handler();
}

Issue After Bootloader on STM32F072RBT6: Stack Pointer Not Jumping to Application Address

I am currently working on a project using the STM32F072RBT6 microcontroller, where I have implemented a custom bootloader to load an application program into flash memory. However, after the bootloader successfully writes the application binary, the stack pointer does not correctly jump to the application’s address, and the application fails to execute.

MCU Model: STM32F072RBT6 Bootloader

Functionality: The bootloader receives the application binary and writes it to flash memory at the designated application address.

Application Flash Address: 0x08004000

Problem: After the bootloader completes, I attempt to jump to the application by setting the stack pointer and program counter accordingly, but the application does not start. It appears that the stack pointer is not correctly set to the application's address.

Jump Code in Bootloader:

static void goto_application(void){

void (* app_reset_handler)(void) = (void )((volatile uint32_t *) (0x08004000 + 4));

__disable_irq();

__set_MSP((*(volatile uint32_t *)0x08004000));

__enable_irq();

app_reset_handler();

}

Issue after bootloader on STM32F072RBT6: Stack Pointer not jumping to application address

I am currently working on a project using the STM32F072RBT6 microcontroller, where I have implemented a custom bootloader to load an application program into flash memory. However, after the bootloader successfully writes the application binary, the stack pointer does not correctly jump to the application’s address, and the application fails to execute.

MCU Model: STM32F072RBT6 Bootloader

Functionality: The bootloader receives the application binary and writes it to flash memory at the designated application address.

Application Flash Address: 0x08004000

Problem: After the bootloader completes, I attempt to jump to the application by setting the stack pointer and program counter accordingly, but the application does not start. It appears that the stack pointer is not correctly set to the application's address.

Jump Code in Bootloader:

static void goto_application(void) {
    void (* app_reset_handler)(void) = (void *)(*(volatile uint32_t *) (0x08004000 + 4));

    __disable_irq();

    __set_MSP((*(volatile uint32_t *)0x08004000));

    __enable_irq();

    app_reset_handler();
}
Source Link

Issue After Bootloader on STM32F072RBT6: Stack Pointer Not Jumping to Application Address

I am currently working on a project using the STM32F072RBT6 microcontroller, where I have implemented a custom bootloader to load an application program into flash memory. However, after the bootloader successfully writes the application binary, the stack pointer does not correctly jump to the application’s address, and the application fails to execute.

MCU Model: STM32F072RBT6 Bootloader

Functionality: The bootloader receives the application binary and writes it to flash memory at the designated application address.

Application Flash Address: 0x08004000

Problem: After the bootloader completes, I attempt to jump to the application by setting the stack pointer and program counter accordingly, but the application does not start. It appears that the stack pointer is not correctly set to the application's address.

Jump Code in Bootloader:

static void goto_application(void){

void (* app_reset_handler)(void) = (void )((volatile uint32_t *) (0x08004000 + 4));

__disable_irq();

__set_MSP((*(volatile uint32_t *)0x08004000));

__enable_irq();

app_reset_handler();

}