Skip to main content
Explorer II
September 2, 2024
Solved

STM32 builtin bootloader GO command problem

  • September 2, 2024
  • 3 replies
  • 1175 views

Hi,

I am trying to set up bootloader on my STM32G030, via usart. 

When I enter it and send start command (0x7F) I do get ACK response(0x79). I cna read ID and protocol verions, but when I try do use "Go" command to start my application, it gets stuck.

What I am sending and responses I get from bootlaoder:

Send:  0x7F    (start)

Response: 0x79

Send:  0x21    0xDE    (go command)

Response: 0x79

Send:  0x0800004 0x04 (my application program is at address 0x08000000) (0x04 is length of address in bytes for checksum)

Response: nothing

 

I assume I am doing something wrong with checksum value, but I cant figure out what.

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

    You can try the following sequence instead:

    1. Send 0x21 (Go command)
    2. Send 0xDE (Checksum for the Go command)
    3. Send 0x08 0x00 0x00 0x00 (Address bytes)
    4. Send 0x08 (Checksum for the address bytes)

    3 replies

    liaifat85Answer
    Visitor II
    September 2, 2024

    You can try the following sequence instead:

    1. Send 0x21 (Go command)
    2. Send 0xDE (Checksum for the Go command)
    3. Send 0x08 0x00 0x00 0x00 (Address bytes)
    4. Send 0x08 (Checksum for the address bytes)
    KlemenDSAuthor
    Explorer II
    September 2, 2024

    Ok @liaifat85  , with this command procedure I get ACK after checksum. But my application is not starting after it. One of functions in my APP is that it repondes to a uart query (I send ID, it reponds with SYS). It know it works, because if I disable bootlaoder, and it goes straight in the APP, it works.

    Might there be a problem with my address?

    This is screen of STMcubeprogrammer:

    KlemenDS_0-1725283486484.png

     

    After checking with debugger, after the bootlaoder "GO command" the program flow gets to main.c(set breakpoint at HAL_Init(); ), so there is some other problem with main APP not really working. Thank for your help. 

     

    Visitor II
    September 1, 2025

    Hi,

    Stm32 bootloader remap Vector Table in RAM,

    your application must remap in flash

    RelocateVectorTableToFlash() before HAL_Init()

     

    static void RelocateVectorTableToFlash(void)
    {
    __HAL_RCC_SYSCFG_CLK_ENABLE(); // Active horloge SYSCFG
    SYSCFG->CFGR1 &= ~SYSCFG_CFGR1_MEM_MODE; // Remap Flash à 0x00000000
    }

     

    Best regards