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.

TMS320F28377D: EMIF模块 远存储区器定义一定要用__attribute__((far)) volatile格式吗?

Part Number: TMS320F28377D

在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段吗,为什么区别这么大?