From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15745 invoked by alias); 20 Feb 2008 14:14:41 -0000 Received: (qmail 15733 invoked by uid 22791); 20 Feb 2008 14:14:39 -0000 X-Spam-Check-By: sourceware.org Received: from py-out-1112.google.com (HELO py-out-1112.google.com) (64.233.166.183) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 20 Feb 2008 14:14:22 +0000 Received: by py-out-1112.google.com with SMTP id u77so3245170pyb.15 for ; Wed, 20 Feb 2008 06:14:20 -0800 (PST) Received: by 10.35.106.1 with SMTP id i1mr9830396pym.62.1203516860418; Wed, 20 Feb 2008 06:14:20 -0800 (PST) Received: by 10.35.108.3 with HTTP; Wed, 20 Feb 2008 06:14:20 -0800 (PST) Message-ID: Date: Wed, 20 Feb 2008 14:14:00 -0000 From: Zavi Reply-To: zavi05@gmail.com To: ecos-discuss@ecos.sourceware.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Google-Sender-Auth: ae82e8b0db8304fd X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Re: twothreads example problem X-SW-Source: 2008-02/txt/msg00145.txt.bz2 I've isolated the problem to the 1st scheduler call to hal_thread_load_context(), specifically to the first line in the following assembly code (from context.S) FUNC_START_ARM(hal_thread_load_context, r2) ldr fp,[r0] // get context to restore mrs r0,cpsr // disable IRQ's orr r0,r0,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE msr cpsr,r0 ldr r0,[fp,#armreg_cpsr] msr spsr,r0 ldmfd fp,{r0-r10,fp,ip,sp,lr} #ifdef __thumb__ mrs r1,spsr // r1 is scratch // [r0 holds initial thread arg] msr cpsr,r1 // hopefully no mode switch here! bx lr #else movs pc,lr // also restores saved PSR #endif I manipulated the r0 so that first 4 bits were zeroized, and found out that the problem was some misallignment in the address passed to this function (stack pointer of first thread), since now the program continued. Has anyone encountered such a problem, and can instruct me as to why it occurs (and how to fix it)? Thank you On Feb 18, 2008 2:52 PM, Zavi wrote: > Hi all, > > I'm a newbie to eCos. > I'm trying to run the twothreads example on my ARM7TDMI (lpc2119). I > tried to run it even with only one thread (allocated a stack only for > it). > cyg_user_start() runs , however the thread never resumes, and all I > get is an infinite loop of the entire startup sequence. > > What can be the reason for this? > I'm using the default configuration with some minor adjustments. > Could it be that I don't have enough RAM (16k)? > I added prints to the startup function, and the scheduler > initializtion is called as expecter, however with no effects. > > Thank you > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss