Skip to main content
Visitor II
July 12, 2024
Question

STM32H745 Dual Core bootloader application

  • July 12, 2024
  • 4 replies
  • 2990 views

Hi,

I am using stm32h745 dual core microcontroller. I want to bootloader application in this processor. The same process does not work with applications made with single core. Can anyone share a sample code for this? Or can you help me on how to apply bootloader in dualcore?

    This topic has been closed for replies.

    4 replies

    Super User
    July 12, 2024

    There's not much that needs to be different for a dual core bootloader compared to a single core chip. You'll have two programs to flash instead of one, but otherwise the concept is identical.

    HSAuthor
    Visitor II
    July 12, 2024

    If you think this is the case, can you share a working example code? Dual core is also a bootloader application. Because there is no sample application for dual core in the literature and the ones for single core do not work either.

    Graduate II
    July 12, 2024

    If you think people want to do your job for you, ascribe some value to the work involved..

    One core is certainly capable of writing the entire FLASH space, where both core images reside. Each core can also update it's own image, or chose which image it wants to run. You can't have both cores write concurrently so you'll need to arbitrate that.

    If the primary core starts the secondary, it can apply the update/recovery processes before doing so.

    Super User
    July 16, 2024

    Your bootloader is running on the M7, right?

    It stops the M4 core, erases the M4 code, restarts the M4 core, and then it jumps to the M4 application that it just flash? That doesn't make sense. The M7 core can't run the M4 code.

    HSAuthor
    Visitor II
    July 16, 2024

    Yes, bootloader m7 also works. Application code also works on m7.
    Even if I call the goto_application() function directly without stopping the M4 core, deleting the M4 core and restarting the M4 core, the bootloader does not work.
    This was the bootloader I wanted to develop as the first step. If this worked, I would develop a bootloader for my application code on both m7 and m4.

    Visitor II
    December 25, 2024

    Hello @HS ,

    I also want same application. and also facing same issue. can you help me if you have solved this challenge.

    Visitor II
    January 23, 2025

    I need the exactly the same dual core bootloader in STM32H745 in my project now. Here are what I have done in the experiment. However, it does not reach the goal yet. 

    1) My application has two apps which can be up and running in M4(flash address 0x0810 0000) and M7(address 0x0800 0000) successfully now. There are communications between two apps in normal.

    2)  The bootloader has two apps too. They are in M4(flash address 0x081D 0000) and M7(address 0x080D 0000). The app in M7 can do download images using UART and flash images into 0x0810 0000 and 0x0800 0000. There are communications between two apps when needed.

    3) After change the boot address using Cube Programmer, both application and bootloader can be up and running successfully from their own address during the boot.

    4) Here is my goal now I want to achieve.  Jump to the application address when needed to start the application inside the bootloader. The bootloader can be up and running now. However, application jump seems not successful.

    I browsed the relevant topics in this community and prepared the code below for application jump. Each bootloader app in M4 and M7 jump to its own app address (M4 0x0810 0000 and M7 0x0800 0000) is synced using ipc message. The system looks like dead after the jump.

    In application app, systemInit() is added at the start of the main() to insure the SCB->VTOR is initialized correctly in both M4 and M7 main.c. systemInit() is called initially in the .s start code in regular boot.

    void gotoFirmware(uint32_t fwFlashStartAdd)

    {

    pFunction appEntry;

    appEntry = (pFunction) *(__IO uint32_t*) (fwFlashStartAdd + 4);

    __set_MSP(*(__IO uint32_t*)fwFlashStartAdd);

    appEntry();

    }

    In bootloader M7 side

    bool cliEchoCmd(..)

    {

    ...

    ipc_send_msg(buf, len+1, IPC_MSG_ECHO); //  ipc to CM4

    tx_thread_sleep(TX_MS_2_TICKS(1000));

    gotoFirmware(APP_M7_ADD); //0x0800 0000

    }

     

    In bootloader M4 side

    bool ipcMsg_Echo(void *pData, uint32_t length)

    {

    ...

    //received ipc msg from M7

    gotoFirmware(APP_M4_ADD); //0x0810 0000

    ..

    }

    I am looking forward to any advices.  Thank you in advance.