打印

变量定义在不同RAM块的超简单方法,含MDK,GCC和IAR

[复制链接]
250|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
肉坨坨|  楼主 | 2018-8-10 14:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
前面的ALIGN_32BYTES不用管,是用来做32位字节对齐用的。需要用在在RAM域,指定调用__attribute__((section (" 参数 ")  指定 .RAM_D1   .RAM_D2    .RAM_D3即可。



/******** MDMA Destination 0 Buffer definition *******//*Buffer location and size should aligned to cache line size (32 bytes) */
#if defined ( __ICCARM__ )
#pragma location = 0x24004000
uint32_t DESTBuffer0_D1_AXISRAM[BUFFER_SIZE0];
#elif defined ( __CC_ARM )
ALIGN_32BYTES(__attribute__((section (".RAM_D1"))) uint32_t DESTBuffer0_D1_AXISRAM[BUFFER_SIZE0]);
#elif defined ( __GNUC__ )
ALIGN_32BYTES(uint32_t __attribute__((section (".RAM_D1"))) DESTBuffer0_D1_AXISRAM[BUFFER_SIZE0]);
#endif

/*****************************************************/


/******** MDMA Destination 1 Buffer definition *******/
/*Buffer location and size should aligned to cache line size (32 bytes) */
#if defined ( __ICCARM__ )
#pragma location = 0x30000000
uint32_t DESTBuffer1_D2_SRAM1[BUFFER_SIZE0];
#elif defined ( __CC_ARM )
ALIGN_32BYTES(__attribute__((section (".RAM_D2"))) uint32_t DESTBuffer1_D2_SRAM1[BUFFER_SIZE0]);
#elif defined ( __GNUC__ )
ALIGN_32BYTES(uint32_t __attribute__((section (".RAM_D2"))) DESTBuffer1_D2_SRAM1[BUFFER_SIZE0]);
#endif
/*****************************************************/


/******** MDMA Destination 2 Buffer definition *******/
/*Buffer location and size should aligned to cache line size (32 bytes) */
#if defined ( __ICCARM__ )
#pragma location = 0x38000000
uint32_t DESTBuffer2_D3_AHBSRAM[BUFFER_SIZE0];
#elif defined ( __CC_ARM )
ALIGN_32BYTES(uint32_t __attribute__((section (".RAM_D3"))) DESTBuffer2_D3_AHBSRAM[BUFFER_SIZE0]);
#elif defined ( __GNUC__ )
ALIGN_32BYTES(uint32_t __attribute__((section (".RAM_D3"))) DESTBuffer2_D3_AHBSRAM[BUFFER_SIZE0]);
#endif
/*****************************************************/

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

419

主题

431

帖子

0

粉丝