TTI大神,你好!
问题描述:
我在设计程序中 有接口需要多次申请空间(用Csf_malloc()申请),程序运行中 总在确定的第N次调用Csf_malloc()时出错,最终报 MAIN_ASSERT_HWI_TIRTOS错误。
问提分析:
1、 目前怀疑任务运行空间不够而缠身该问题,进而将 任务堆栈大小( APP_TASK_STACK_SIZE)修改到3000左右,问题依然存在 (问题出现推后一些,例如第N+L次调用Csf_malloc()),但是串口应用报错,怀疑是由于任务堆栈太大 占用了该部分内容。
2、根据其他帖子相关问题,尝试修改CMD文件,好像没有效果(没有实际修改)。
/* Retain interrupt vector table variable */
--retain=g_pfnVectors
/* Override default entry point. */
--entry_point ResetISR
/* Allow main() to take args */
--args 0x8
/* Suppress warnings and errors: */
/* - 10063: Warning about entry point not being _c_int00 */
/* - 16011, 16012: 8-byte alignment errors. Observed when linking in object */
/* files compiled using Keil (ARM compiler) */
--diag_suppress=10063,16011,16012
/* The following command line options are set as part of the CCS project. */
/* If you are building using the command line, or for some reason want to */
/* define them here, you can uncomment and modify these lines as needed. */
/* If you are using CCS for building, it is probably better to make any such */
/* modifications in your CCS project and leave this file alone. */
/* */
/* --heap_size=0 */
/* --stack_size=256 */
/* --library=rtsv7M3_T_le_eabi.lib */
--heap_size=1024
--stack_size=1256
/* The starting address of the application. Normally the interrupt vectors */
/* must be located at the beginning of the application. */
#define FLASH_BASE 0x00000000
#ifdef ONE_PAGE_NV
#define FLASH_SIZE 0x1E000
#define FLASH_NV_BASE 0x1E000
#define FLASH_NV_SIZE 0x1000
#else
#define FLASH_SIZE 0x1D000
#define FLASH_NV_BASE 0x1D000
#define FLASH_NV_SIZE 0x2000
#endif
#define FLASH_LAST_BASE 0x1F000
#define FLASH_LAST_SIZE 0x1000
#define RAM_BASE 0x20000000
#define RAM_SIZE 0x5000
/* System memory map */
MEMORY
{
/* Application stored in and executes from internal flash */
FLASH (RX) : origin = FLASH_BASE, length = FLASH_SIZE
/* FLASH NV */
FLASH_NV (RWX) : origin = FLASH_NV_BASE, length = FLASH_NV_SIZE
/* Last flash page */
FLASH_LAST (RX) : origin = FLASH_LAST_BASE, length = FLASH_LAST_SIZE
/* Application uses internal RAM for data */
SRAM (RWX) : origin = RAM_BASE, length = RAM_SIZE
}
/* Section allocation in memory */
SECTIONS
{
.intvecs : > FLASH_BASE
/*
flash_last_text
{
nvocop.obj(.text)
macTask.obj(.text)
} > FLASH_LAST
*/
.text : >> FLASH_LAST | FLASH
config_const { mac_user_config.obj(.const) } > FLASH
.const : > FLASH
.constdata : > FLASH
.rodata : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.emb_text : > FLASH
.ccfg : > FLASH_LAST (HIGH)
GROUP > SRAM
{
.data
.bss
.vtable
.vtable_ram
vtable_ram
.sysmem
.nonretenvar
} LOAD_END(heapStart)
.stack : > SRAM (HIGH) LOAD_START(heapEnd)
}
/* Create global constant that points to top of stack */
/* CCS: Change stack size under Project Properties */
__STACK_TOP = __stack + __STACK_SIZE;
求助:
请问有什么其他办法可以解决该问题吗,