首页 > 解决方案 > Jump to another application

问题描述

I want to write a bootloader for my stm32l4 mcu which (after pressing a button) jumps to another part of flash and run the app on that part. for application part I write a simple blinky and generate its BIN file and copy this bin file to address 0x0800 8000 of flash memory.

Now I do not know how can I jump to this address and run this blinky app.

would anyone help me?

best!

标签: embeddedstm32bootloader

解决方案


至少有两种选择浮现在脑海中:

  1. 使用函数指针:

        /* ... */
        void (*app)(void) = (void (*)(void))0x08008000;
        app();
    
  2. 声明一个外部函数并使用您的链接描述文件解决它:

        /* ... */
        void app(void);
        app();
    

    如何在链接器脚本中定义地址取决于您的链接器。


推荐阅读