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]

FW: FW: FW: eCos Array memory size





> Date: Thu, 2 Oct 2008 09:51:23 +0200
> From: andrew@lunn.ch
> To: oricon776@hotmail.com
> CC: ecos-discuss@ecos.sourceware.org
> Subject: Re: [ECOS] FW: [ECOS] FW: [ECOS] 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
>

Hi, my stack size is defined to be 4096 bytes. Seems like it is not enough for the application. 
Sorry, I am not very sure on how to declare it as a static variable. Do you have any reference on how to declare it? I have bought the Embedded Software Development with eCos. Does it mention in the book?
_________________________________________________________________
Join the Fantasy Football club and win cash prizes here!
http://fantasyfootball.sg.msn.com

-- 
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]