前面的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
/*****************************************************/ |