工具/软件:TI-RTOS
这是 我们 的.cfg 配置。
VAR HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x100000;
heapMemParams.sectionName =".external";
heapMemParams.buf = 0x60000000;
heapMemParams.instance.name ="SDRAM";
program.global.SDRAM = HeapMem.create (heapMemParams);
Memory.defaultHeapInstance = Program.global.SDRAM; <.--------------- 第 X 行
启用此行 X 时,f_write() 函 数会锁定 usvhostenum.c (Tiware/usblib)中的 USBHCSDPipeRead (uint32_t ui32Pipe、uint8_t * pu8Data、uint32_t ui32Size)函数。
我已经使用 外部 RAM 通过 NDK 和其他 TI-RTOS 模块以及 我们使用 ( malloc 和 free)的函数测试了全局堆 、没有问题、但是
FatFS 存在这个问题, 所以我必须禁用外部 RAM 中的堆 ,因为它可以正常工作, 这会导致 内部使用 malloc/free 的其他模块中的内存限制。