【TI毫米波雷达笔记】CCS雷达工程内存RAM指定(DATA_SECTION,以IWR6843AOP为例)
工程建立好以后会有一个cmd文件
此文件描述的是内存map
/*----------------------------------------------------------------------------*/
/* r4f_linker.cmd */
/* */
/* (c) Texas Instruments 2016, All rights reserved. */
/* */
/* USER CODE BEGIN (0) */
/* USER CODE END */
/*----------------------------------------------------------------------------*/
/* Linker Settings */
--retain="*(.intvecs)"
/*----------------------------------------------------------------------------*/
/* Memory Map */
#define MMWAVE_L3RAM_SIZE (MMWAVE_L3RAM_NUM_BANK*MMWAVE_SHMEM_BANK_SIZE)
MEMORY{
PAGE 0:
VECTORS (X) : origin=0x00000000 length=0x00000100
PROG_RAM (RX) : origin=0x00000100 length=0x0007FF00+(MMWAVE_SHMEM_TCMA_NUM_BANK*MMWAVE_SHMEM_BANK_SIZE)
DATA_RAM (RW) : origin=0x08000000 length=0x00030000+(MMWAVE_SHMEM_TCMB_NUM_BANK*MMWAVE_SHMEM_BANK_SIZE)
L3_RAM (RW) : origin=0x51000000 length=MMWAVE_L3RAM_SIZE
HWA_RAM (RW) : origin=0x52030000 length=0x00010000
HS_RAM (RW) : origin=0x52080000 length=0x8000
PAGE 1:
L3_RAM (RW) : origin=0x51000000 length=MMWAVE_L3RAM_SIZE
}
/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS{
.intvecs : {} > VECTORS
.text : {} > PROG_RAM
.const : {} > PROG_RAM
.cinit : {} > PROG_RAM
.pinit : {} > PROG_RAM
.bss : {} > DATA_RAM
.data : {} > DATA_RAM
.stack : {} > DATA_RAM
systemHeap : {} > DATA_RAM
.l3ram: {} > L3_RAM
}
/*----------------------------------------------------------------------------*/
在SECTIONS中 可以自定义自己想要定义的内存位置
比如.l3ram: {} > L3_RAM
指定到L3_RAM内存区域
如果要用到这块内存(一般是用为存储雷达ADC数据)
则可以定义全局变量:
/*! L3 RAM buffer for object detection DPC */
uint8_t L3_RAM_Buf[SOC_L3RAM_SIZE]={0};
用DATA_SECTION语句指定其存放空间
#pragma DATA_SECTION(L3_RAM_Buf, ".l3ram");
在main函数中清空内存
//刷一下内存
memset ((void *)L3_RAM_Buf, 0, sizeof(L3_RAM_Buf));
最后在map表中即可看到