embedded - 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!
解决方案
至少有两种选择浮现在脑海中:
使用函数指针:
/* ... */ void (*app)(void) = (void (*)(void))0x08008000; app();
声明一个外部函数并使用您的链接描述文件解决它:
/* ... */ void app(void); app();
如何在链接器脚本中定义地址取决于您的链接器。
推荐阅读
- reactjs - 如何在表格中的反应选择外部滚动中显示菜单样式?
- javascript - 如何将 Node 添加到前端?
- java - 什么解释了 java 中双精度的范围?
- python - ModuleNotFoundError:python 中没有名为“sksurv”的模块
- javascript - 如何在 Node/Express 中设置 404 路由
- r - 在R中的标头上运行forloop
- android - 如何使用房间关系注释一次连接多个对象?
- javascript - 具有NUXT环境变量的IISNODE在生产中不起作用
- typescript - Typescript 4.0+ 是否能够使用映射的可变元组类型的函数?
- ios - 从初始化程序返回而不初始化所有存储的属性 - SwiftUI 绑定错误