This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
在emif列程中使用__attribute__((far)) volatile Uint32 g_ulSDRAMBuf[MEM_BUFFER_SIZE+1]; //Buffer infar memory的形式把 g_ulSDRAMBuf[MEM_BUFFER_SIZE+1]定义在farbss段中,可正常对SDRAM读写。
对__attribute__((far)) volatile Uint32 g_ulSDRAMBuf[MEM_BUFFER_SIZE+1]更改;
更改为:
#pragma DATA_SECTION("farbss");
Uint32 g_ulSDRAMBuf[MEM_BUFFER_SIZE]; 可正常编译,但运行到g_ulSDRAMBuf 的时候就跑飞了,不能对SDRAM正常读写;
cmd文件定义
EMIF2_CS0n : origin = 0x90000000, length = 0x10000000
.farbss : > EMIF2_CS0n, PAGE = 1
使用__attribute__的形式定义和#pragma DATA_SECTION("farbss")不都是把g_ulSDRAMBuf定义到far段吗,为什么区别这么大?
您好,
更改为:
#pragma DATA_SECTION("farbss");
Uint32 g_ulSDRAMBuf[MEM_BUFFER_SIZE];
试一下加上volatile关键字
加了 volatile关键字现象还是一样,无法正确写入
并且发现这个好像跟编译器还有关系用TI V6.2.5无法__attribute__((far)) volatile Uint32 g_ulSDRAMBuf[MEM_BUFFER_SIZE+1]编译通过,一直报错
Source/App/subdir_rules.mk:9: recipe for target 'Source/App/EMIFDrv.obj' failed
"../Source/App/EMIFDrv.cpp", line 26: warning #78-D: this declaration has no storage class or type specifier
"../Source/App/EMIFDrv.cpp", line 26: warning #21-D: type qualifiers are meaningless in this declaration
"../Source/App/EMIFDrv.cpp", line 26: warning #262-D: explicit type is missing ("int" assumed)
"../Source/App/EMIFDrv.cpp", line 26: error #29: expected an expression
"../Source/App/EMIFDrv.cpp", line 26: error #66: expected a ";"
用列程编译器及(更高版本)TI v15.12.14可正常编译通过
请问这是什么原因?