原创 GBA的KEIL模板

2008-12-24 22:07 2723 4 4 分类: MCU/ 嵌入式

https://static.assets-stash.eet-china.com/album/old-resources/2008/12/24/68531dc5-3d0c-432f-94c6-85a96889937d.rar" target=_blank>将李强的GBA ADS模板改到KEIL上运行费了不少时间。


主要是分散加载,还有BOOT.S的修改


里面添加了这样一段,不然会报错


 EXPORT __user_initial_stackheap 
__user_initial_stackheap
    MOV   pc,lr


我尝试了将BOOT.S里面的bl main 改成 bl __main可以运行


另外一个办法就是改成bl Main 就是大写M


然后把主函数改为大写Main,


 


最重要的就是分散加载文件,我是这样写得


LR_1 0x08000000 0x00040000  {  ; load region
  ER_RO +0  {       ; load address = execution address
   *.o (INIT, +First)
   * (+RO)
  }
  ER_RW 0x03000000 0x00008000  {  ; RW data
   * (+RW)
  }
  ER_ZI +0{  ; RW data
   * (+ZI)
  }
}


然后修改BOOT.S最开始


 IMPORT |Image$$ER_RO$$Base|   ; Address of the start of the RO output section.
 IMPORT |Image$$ER_RO$$Limit|   ; Address of the first byte beyond the end of the RO output section.
 IMPORT |Image$$ER_RW$$Base|   ; Address of the start of the RW output section.
 IMPORT |Image$$ER_RW$$Limit|   ; Address of the byte beyond the end of the ZI output section. (The choice of the end of the ZI region rather than the end of the RW region is to maintain compatibility with legacy code.)
 IMPORT |Image$$ER_ZI$$Base|   ; Address of the start of the ZI output section.
 IMPORT |Image$$ER_ZI$$Limit|   ; Address of the byte beyond the end of the ZI output section.


然后加入--entry 0x08000000


PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
4
关闭 站长推荐上一条 /1 下一条