From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25721 invoked by alias); 17 Jan 2007 05:09:37 -0000 Received: (qmail 25712 invoked by uid 22791); 17 Jan 2007 05:09:37 -0000 X-Spam-Check-By: sourceware.org Received: from ganga.bsil.com (HELO mail4.bsil.com) (203.199.84.175) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 17 Jan 2007 05:09:31 +0000 Received: from mail4.bsil.com (localhost.localdomain [127.0.0.1]) by mail4.bsil.com (8.13.1/8.13.1) with ESMTP id l0H59RAj023174 for ; Wed, 17 Jan 2007 10:39:27 +0530 Received: from seepz.bsil.com (seepz.bsil.com [192.168.8.23])by mail4.bsil.com (8.13.1/8.13.1) with ESMTP id l0H59Qmr023169for ; Wed, 17 Jan 2007 10:39:26 +0530 Received: from seepz.bsil.com (localhost.localdomain [127.0.0.1])by seepz.bsil.com (8.13.4/8.13.4) with ESMTP id l0H59QJb004047for ; Wed, 17 Jan 2007 10:39:26 +0530 Received: from [192.168.9.101] ([192.168.9.101])by seepz.bsil.com (8.13.4/8.13.4) with ESMTP id l0H59LAx004025for ; Wed, 17 Jan 2007 10:39:26 +0530 From: Asutosh Das Reply-To: asutosh.das@bsil.com To: ecos-discuss@sources.redhat.com Content-Type: text/plain Date: Wed, 17 Jan 2007 05:09:00 -0000 Message-Id: <1169010877.2951.81.camel@mdt303.bsil.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 (2.2.2-5) Content-Transfer-Encoding: 7bit X-imss-version: 2.045 X-imss-result: Passed X-imss-scanInfo: M:P L:E SM:0 X-imss-tmaseResult: TT:0 TS:0.0000 TC:00 TRN:0 TV:3.6.1039(14940.003) X-imss-scores: Clean:20.46379 C:2 M:3 S:5 R:5 X-imss-settings: Baseline:1 C:1 M:1 S:1 R:1 (0.0000 0.0000) 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 Problem with threads in the port for phyCORE MPC555 X-SW-Source: 2007-01/txt/msg00095.txt.bz2 Hi I have downloaded a port for phyCORE mpc555. I could successfully build it and I downloaded my code to the RAM section of the board. When I try to run it, it switches to the other thread on the call of cyg_thread_delay but exits the program after that.(attached below). The flow should be 1-2-3-1-3-1 and continue, but it does not and to my surprise it exits and insight-gdb throws an exception SIGFPE Arithmetic exception. Please can anyone advise me on this? #include #include "Main.h" #define NUMBER_OF_THREADS 4 #define STACKSIZE 4096 static unsigned char stack[NUMBER_OF_THREADS][STACKSIZE]; static cyg_handle_t handle[NUMBER_OF_THREADS]; static cyg_thread thread[NUMBER_OF_THREADS]; int main() { InitializeLED(); cyg_thread_create(2,SwitchRedLEDOn,0,"redLedOn", (void *)stack[0], STACKSIZE, &handle[0],&thread[0]); cyg_thread_create(3,SwitchRedLEDOff,0,"redLedOff", (void *)stack[1], STACKSIZE, &handle[1],&thread[1]); cyg_thread_resume(handle[0]); cyg_thread_resume(handle[1]);<-------------------- comes here 2nd and resumes 2nd thread (2) return 0; }<----------------------------------------------- but jumps back here (4) void InitializeLED(void) { MPIOSMDR |= 0x0002; /* drive MPIO1 high */ MPIOSMDR |= 0x0001; /* drive MPIO0 high */ MPIOSMDDR |= 0x0003; /* configure MPIO0 and MPIO1 for output */ } void SwitchRedLEDOn(cyg_addrword_t b) { while(1){ cyg_thread_delay(100);<------------------------ control comes here 1st after 1st thread is resumed (1) MPIOSMDR &= 0xFFFD; /* drive MPIO1 low */ } } void SwitchRedLEDOff(cyg_addrword_t a) { while(1){ MPIOSMDR |= 0x0002; /* drive MPIO1 high */ cyg_thread_delay(120);<---------------------- comes here 3rd and thread gets blocked and should jump back to SwitchRedLEDOn() (3) } } Regards Asutosh Das asutosh dot das at bsil dot 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