Skip to content

How to set the value heap and stack in the .ld file? #38

@KiraVerSace

Description

@KiraVerSace

OK, Here is my problem, and I was confused.
I use five tasks in my main.cpp like this:

	xTaskCreate(periphRunTask, 		(const portCHAR *)"PeriphRun", 		512, 	NULL, 	6,	NULL);
	xTaskCreate(sensorSampleTask, 	(const portCHAR *)"Sensor", 		256, 	NULL, 	5, 	NULL);
	xTaskCreate(dataHandleTask, 	(const portCHAR *)"DataHandle", 	512, 	NULL, 	4, 	NULL);
	xTaskCreate(socketLTERunTask, 	(const portCHAR *)"LTESocket",		1024, 	NULL, 	3, 	NULL);
	xTaskCreate(socketWaterRunTask, (const portCHAR *)"WaterSocket",	1024, 	NULL, 	2, 	NULL);

and in my ldscript.ld file , I set the heap size like this:

/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size  = 0x200;;       /* 0x400 1KB 一般由程序员分配和释放,分配方式类似于数据结构中的链表     */
_Min_Stack_Size = 0x800;; 	    /* 0x800 2KB 由编译器自动分配和释放,如存放函数的参数值,局部变量的值等	 */

and default use #define configUSE_NEWLIB_REENTRANT 1

but I dont know how to set them with right value, my problem often run to hardfault,
When I use tasklist to see the statck size, it is useless.

Could you help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions