From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28327 invoked by alias); 20 Jun 2012 09:54:47 -0000 Received: (qmail 28309 invoked by uid 22791); 20 Jun 2012 09:54:46 -0000 X-SWARE-Spam-Status: No, hits=4.5 required=5.0 tests=AWL,BAYES_50,BOTNET,KHOP_THREADED,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ip2.televic.com (HELO ip2.televic.com) (81.82.194.222) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jun 2012 09:54:32 +0000 Received: from SRV-VS06.TELEVIC.COM ([10.0.0.46]) by SRV-VS06.TELEVIC.COM ([10.0.0.46]) with mapi; Wed, 20 Jun 2012 11:54:31 +0200 From: =?iso-8859-1?Q?Lambrecht_J=FCrgen?= To: "'Jesper K. Pedersen'" , "ecos-discuss@ecos.sourceware.org" Date: Wed, 20 Jun 2012 09:54:00 -0000 Message-ID: <6EE7D1502C48E44E92DCADF9DD3E0DB9019D1B87A064@SRV-VS06.TELEVIC.COM> References: <20120617164302.74bdd347@io.solnet> <20120619151658.2b387e48@io.solnet> <4FE0DE86.2030003@televic.com> <20120620073825.71080156@io.solnet> In-Reply-To: <20120620073825.71080156@io.solnet> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: RE: [ECOS] AT91SAM7S256 problem with test/example twothreads X-SW-Source: 2012-06/txt/msg00017.txt.bz2 > -----Original Message----- > From: ecos-discuss-owner@ecos.sourceware.org [mailto:ecos-discuss- > owner@ecos.sourceware.org] On Behalf Of Jesper K. Pedersen > Sent: woensdag 20 juni 2012 7:38 > To: ecos-discuss@ecos.sourceware.org > Subject: Re: [ECOS] AT91SAM7S256 problem with test/example twothreads >=20 > On Tue, 19 Jun 2012 22:18:14 +0200 > Lambrecht J=FCrgen wrote: >=20 > > On 06/19/2012 03:16 PM, Jesper K. Pedersen wrote: > > > On Sun, 17 Jun 2012 16:43:02 +0200 > > > "Jesper K. Pedersen" wrote: > > > > > >> I am at my wits end getting the twothreads example working on my > > >> Olimex P256 board (AT91SAM7S256 based). > > >> > > >> Calling the cyg_mutex_init does not return. Also I notice that the > > >> call to the printf line before the call to cyg_mutex_init prints > > >> extremely slow on my terminal. > > >> > > >> I have set the default console up to tty0 going to ser0. This part > > >> works fine with my other software running on the board (normal > > >> expected transmission speed). > > >> > > >> Are there any "gotcha'" involving threading on the AT91 series > > >> microcontrollers? > > >> > > > Problem was solved. > > > > > > For some reason if you put any output function (printf's) in the > > > cyg_user_start the threading will hang. > > > > > > Removing all output will allow for threading and the example works > > > as expected. > > > > > > I wonder if this is intended or if its a bug in the A91SAM7 eCos. > > > > > > Best regards > > > JesperKP > > > > > I have lots of diag_printf's in my cyg_user_start() running on an > > AT91 ARM7 and a ARM9. > > Maybe because you use printf? > > Be carefull: Code running in initialization context runs with > > interrupts disabled and the scheduler locked. Only after > > cyg_user_start, the scheduler starts and resumes all threads. > > Maybe (if I remember well; search the list for the diff between both > > printfs) printf uses interrupts (to know when the hardware has sent a > > byte), and diag_printf doesn't. I have searched the list in your place, and a printf needs interrupts, so i= ndeed, it will not run in cyg_user_start(). > > > > You must also realize that printf's can take a lot of CPU. I meant diag_printf's. > > > > And no, it is certainly not intended or a bug in the ecos CVS code > > (although I don't know the twothreads test): it is your bug ;-) . > > >=20 > If you look in the ecos-3.0-user-guide.pdf on page 52 "A Sample Program > with Two Threads" it is shown with printf's in the cyg_user_start. >=20 > If that is not a correct way to do it - perhaps that example should be > changed? :-D Indeed. I thought the two-thread example came from CVS ecos sources. But it comes f= rom an example from the user guide. So the writer of it should reply. The example is wrong, must be diag_printf instead. Kind regards, J=FCrgen >=20 > Best regards > JesperKP >=20 > -- > Before posting, please read the FAQ: > http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss