This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FW: FW: eCos Array memory size


> void Read_all_14443a_type1(cyg_uint32 uid0, cyg_uint32 uid1, cyg_uint32 uid2, cyg_uint32 uid3) {
> 	
> 	cyg_uint32 request[9];
> 	cyg_uint32 binary[71]; 
> 	cyg_uint32 symbol[89]; 
> 	cyg_uint32 processed_data[124];
> 	cyg_uint32 CRC;
> 	int i,parity_check,byteValue;
> 	int responseFlag=0;
> 	int raw_data [2238]; 
> 	.

So it is on the stack. When you create the thread which is running
this code, how big a stack do you allocate?

void cyg_thread_create(cyg_addrword_t sched_info, 
                       cyg_thread_entry_t* entry, 
                       cyg_addrword_t entry_data, 
                       char* name, void* stack_base,
                       cyg_ucount32 stack_size, 
                       cyg_handle_t* handle, 
                       cyg_thread* thread);

You need to have sufficient space on the stack for this variable, all
your other variables, and everything else that you put on the stack.

Maybe putting it on the stack is the wrong way to do this. Maybe it
should be a static variable? It is then not on the stack, it is in the
BSS. Or allocate it with malloc() so that it is on the heap.

     Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]