aaa123
aaa123
这家伙很懒,什么也没写!

注册于 1年前

回答
2
文章
0
关注者
0

发布于1年前

typedef void (pFunction)(void);/ 声明一个函数指针 /
unsigned char
ram_data = (unsigned char *)RAM_ADDRESS;
function_ptr func = (function_ptr)RAM_ADDRESS;

发布于1年前

  1. typedef void (*function_ptr)(void);
  2. int main(int argc, char **argv)
  3. {
  4. rt_thread_t thread;
  5. uint8_t index = 0;
  6. uint8_t *buf;
  7. rt_base_t level = rt_hw_interrupt_disable(); //关闭rt中断
  8. buf=rt_malloc(1024*1024);
  9. read_flash(1, 0x100000, IAPP, 0xf0000);
  10. unsigned char *ram_data = (unsigned char *)RAM_ADDRESS;
  11. for(int i=0;i<0xf0000;i++)
  12. {
  13. ram_data[i]=IAPP[i];
  14. }
  15. rt_free(buf);
  16. function_ptr func = (function_ptr)RAM_ADDRESS;
  17. sysSetGlobalInterrupt(1);//关闭全局中断
  18. func(); // 调用RAM中的函数

这是我的跳转代码,实际上跳转过去了,但是报了一些错误,

  1. main stack overflow

回到
顶部

发布
问题

投诉
建议