RealView MDK问题征集及相关处理办法(小菜高呼)

来源:互联网 发布:ios破解软件下载 编辑:程序博客网 时间:2024/05/16 09:21

          RealView MDK在中国推出已经有一段时间了,而且作为未来发展的趋势必将取代ADS1.2,成为工程师广泛应用的开发平台。

         在编译中常常会有些问题,有时十分的让人抓狂,小菜在这里发出呼吁:希望把大家把自己的问题或者成果在这个平台上与大家分享,让大家的少走弯路,共同进步。

以下是小菜的整理几个问题及解决:

1, .\output\LJD2440TEST.axf: Error: L6218E: Undefined symbol Main (referred from 2440init.o).

Main -> main,新的Realview MDK中大小写认为名称不同

2,.\output\LJD2440TEST.axf: Error: L6915E: Library reports error: scatter-load file declares no heap or stack regions and __user_initial_stackheap is not defined

    加入部分代码

                EXPORT __user_initial_stackheap

__user_initial_stackheap

                LDR     R0, = Heap_Mem

               LDR     R1, =(Stack_Mem + USR_Stack_Size)

                LDR     R2, = (Heap_Mem +      Heap_Size)

                LDR     R3, = Stack_Mem

                BX      LR

3,

.\output\LJD2440TEST.axf: Error: L6218E: Undefined symbol Image$$RW$$Limit (referred from 2440lib.o).

.\output\LJD2440TEST.axf: Error: L6218E: Undefined symbol Image$$RO$$Base (referred from main.o).

.\output\LJD2440TEST.axf: Error: L6218E: Undefined symbol Image$$RO$$Limit (referred from main.o).

.\output\LJD2440TEST.axf: Error: L6218E: Undefined symbol Image$$RW$$Base (referred from main.o).

.\output\LJD2440TEST.axf: Error: L6218E: Undefined symbol Image$$ZI$$Base (referred from main.o).

.\output\LJD2440TEST.axf: Error: L6218E: Undefined symbol Image$$ZI$$Limit (referred from main.o).

办法:重新编写.sct加载文件

4, Error: L6238E: foo.o(.text) contains invalid call from '~PRES8' function to'REQ8' function Warning: L6306W: '~PRES8' section foo.o(.text) should not use the address of 'REQ8' function foobar

办法:在每个汇编文件的开头,添加“PRESERVE8”指令

5.在MDK下编译STM32的工程,调用NIVC_Init(),编译程序,提示未定义;检查工程,发现工程中未包含stm32f10x_nvic.c文件,手动添加该文件;重新编译,提示错误如下:

Build target 'Target 1' 
compiling stm32f10x_nvic.c... 
linking... 
MyProject.axf: Error: L6218E: Undefined symbol __BASEPRICONFIG (referred from stm32f10x_nvic.o). 
MyProject.axf: Error: L6218E: Undefined symbol __GetBASEPRI (referred from stm32f10x_nvic.o). 
MyProject.axf: Error: L6218E: Undefined symbol __RESETFAULTMASK (referred from stm32f10x_nvic.o). 
MyProject.axf: Error: L6218E: Undefined symbol __RESETPRIMASK (referred from stm32f10x_nvic.o). 
MyProject.axf: Error: L6218E: Undefined symbol __SETFAULTMASK (referred from stm32f10x_nvic.o). 
MyProject.axf: Error: L6218E: Undefined symbol __SETPRIMASK (referred from stm32f10x_nvic.o). 
Target not created 

搜索发现这些符号在cortem3_marco.h中定义,cortem3_marco.h在工程中也已包含,但是它对应的。s文件工程中没有,搜索ST提供的库,找到了cortem3_marco。s文件,添加到工程,编译,OK了!!

 

 

 

原创粉丝点击