STM32开发 -- cannot open source input file absacc.h 解决方法
如需轉載請注明出處:https://blog.csdn.net/qq_29350001/article/details/80831070
問題描述:
使用 keil MDK 5.24
代碼里有包含頭文件 absacc.h
也使用了相關功能 const uint8_t ver[32] __at (0x08002400) =“12345678V01.01”;
編譯出現錯誤:cannot open source input file “absacc.h”: No such file or directory
解決方法:
找了個 keil MDK 4.74 (安裝地址:C:\Keil\ARM\ARMCC\include)的 absacc.h 拷貝到 keil MDK 5.24(安裝地址:C:\Keil_v5\ARM\ARMCC\include)里,問題解決。
下載:百度網盤 – absacc.h
原因:
keil MDK 5.24 版本里缺少 absacc.h
使用
參看: attribute((at(address))) variable attribute
attribute((at(address))) variable attribute
This variable attribute enables you to specify the absolute address of a variable.
Syntax
attribute((at(address)))
Where:
address
is the desired address of the variable.
Usage
The variable is placed in its own section, and the section containing the variable is given an appropriate type by the compiler:
Read-only variables are placed in a section of type RO.
Initialized read-write variables are placed in a section of type RW.
Variables explicitly initialized to zero are placed in:
A section of type ZI in RVCT 4.0 and later.
A section of type RW (not ZI) in RVCT 3.1 and earlier. Such variables are not candidates for the ZI-to-RW optimization of the compiler.
Uninitialized variables are placed in a section of type ZI.
Note
GNU compilers do not support this variable attribute.
Restrictions
The linker is not always able to place sections produced by the at variable attribute.
The compiler faults use of the at attribute when it is used on declarations with incomplete types.
Errors
The linker gives an error message if it is not possible to place a section at a specified address.
Example
const int x1 attribute((at(0x10000))) = 10; /* RO /
int x2 attribute((at(0x12000))) = 10; / RW /
int x3 attribute((at(0x14000))) = 0; / RVCT 3.1 and earlier: RW.
* RVCT 4.0 and later: ZI. /
int x4 attribute((at(0x16000))); / ZI */
如需轉載請注明出處:https://blog.csdn.net/qq_29350001/article/details/80831070
總結
以上是生活随笔為你收集整理的STM32开发 -- cannot open source input file absacc.h 解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: STM32开发 -- 串口详解
- 下一篇: 机器学习基础笔记总结