Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Several tasks using same stack memory

Status
Not open for further replies.

Lauris

Newbie level 6
Newbie level 6
Joined
Apr 24, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Lithuania, Vlinius
Activity points
1,355
Hello everyone,

maybe anyone here is familiar with a way of making one stack memory for few tasks? Problem is that even if I'm defining one memory area for few tasks which runs for a short time and never runs at same time compiler makes few different allocations for them.
Code:
main.h
	//-----------------------------------------------------------------------
	static U64 stk_task		[1424/8];
	//-----------------------------------------------------------------------

file1.c
#include "main.h"
*
*
	taskID  = os_tsk_create_user (task, 0, &stk_task, sizeof(stk_task));	// Create Next Task
	os_evt_set (0x0001, taskID);

file2.c
#include "main.h"
*
*
	if (active_link.protocol) {
		taskID1 = os_tsk_create_user (task1, 0, &stk_task, sizeof(stk_task));
		os_evt_set (0x0001, taskID1);
	} else {
		taskID2 = os_tsk_create_user (task2, 0, &stk_task, sizeof(stk_task));
		os_evt_set (0x0001, taskID2);
	}


fragment of MAP file
    stk_Data_Send                            0x400051b8   Data        1424  file1.o(.bss)
*
*
    stk_Data_Send                            0x40005db0   Data        1424  file2.o(.bss)
Maybe I'm doing something wrong or missing something?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top