From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21068 invoked by alias); 19 Feb 2013 14:51:35 -0000 Received: (qmail 21052 invoked by uid 22791); 19 Feb 2013 14:51:34 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from p02c11o149.mxlogic.net (HELO p02c11o149.mxlogic.net) (208.65.144.82) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Feb 2013 14:51:29 +0000 Received: from unknown [12.218.215.72] (EHLO smtpauth1.linear.com) by p02c11o149.mxlogic.net(mxl_mta-7.0.0-0) with ESMTP id 07193215.0.84220.00-369.198346.p02c11o149.mxlogic.net (envelope-from ); Tue, 19 Feb 2013 07:51:29 -0700 (MST) X-MXL-Hash: 512391711d5ae267-638d01940a2db210bd9554cc532109edcf2306df Received: from smtpauth1.linear.com (localhost [127.0.0.1]) by smtpauth1.linear.com (Postfix) with ESMTP id C7341740A3; Tue, 19 Feb 2013 06:51:26 -0800 (PST) Received: from [192.168.0.24] (174-24-24-137.clsp.qwest.net [174.24.24.137]) by smtpauth1.linear.com (Postfix) with ESMTPSA id 715C8740A1; Tue, 19 Feb 2013 06:51:26 -0800 (PST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: Problem setting up an ISR for a K60 PORT From: Michael Jones In-Reply-To: <512338ED.6000705@televic.com> Date: Tue, 19 Feb 2013 14:51:00 -0000 Cc: "ecos-devel@ecos.sourceware.org" , ecos Content-Transfer-Encoding: quoted-printable Message-Id: <5ED098DC-1719-4A66-82DA-2599E0489743@linear.com> References: <512338ED.6000705@televic.com> To: =?iso-8859-1?Q?Lambrecht_J=FCrgen?= X-AnalysisOut: [v=2.0 cv=TLXyvSZa c=1 sm=1 a=glloKNylpeYNumXQcclYyA==:17 a] X-AnalysisOut: [=MEVdYVPCnewA:10 a=D2_GN2MmYMYA:10 a=BLceEmwcHowA:10 a=8nJ] X-AnalysisOut: [EP1OIZ-IA:10 a=MqDINYqSAAAA:8 a=shGR7GQp7K4A:10 a=cJU25fke] X-AnalysisOut: [C71GnaHt00sA:9 a=wPNLvfGTeEIA:10] X-MAIL-FROM: X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2013-02/txt/msg00003.txt.bz2 >>=20 >>=20 > After our 'interrupt_create', we also have those calls (we use IRQ2=20 > instead of your PORTA): > cyg_interrupt_attach(t_intrhandle); > cyg_interrupt_configure(CYGNUM_HAL_INTERRUPT_IRQ2, TLV_FALSE, TLV_FALSE= ); > cyg_interrupt_acknowledge(CYGNUM_HAL_INTERRUPT_IRQ2); > cyg_interrupt_unmask(CYGNUM_HAL_INTERRUPT_IRQ2); >=20 > Why do you call 'cyg_thread_suspend...' ? I do not see code that creates= =20 > a thread. And when I create a thread, I do cyg_thread_create(...);=20 > cyg_thread_resume(..);. >=20 > Why do you need a thread when your code is run by interrupts? I am creating all my threads from cyg_user_start. Each "task" (thread) has = its own file and interface (psuedo OO). The overall app has multiple thread= s, one of them handling telemetry, and a higher priority one handling ALERT= B problems using a PMBus (I2C). Once the interrupt works and the DSR is cal= led, the DSR code will do an ARA (get addresses vis I2C), get STATUS_WORD f= or all address that ALERTed, and then send events so that the alert thread = can respond by interacting over the PMBus. I just suspended the thread unti= l I get the ISR to work, then I will add then event and processing code.=20 I could do all the work in the DSR as long as I can call I2C from the DSR. = However, I am porting an application from MQX and maintaining its structure= , and in MQX I don't have a DSR, so in that version the ARA and read of STA= TUS_WORD is all in the task code. I tried making some I2C calls from a DSR by using a timer, and the code loc= ked up somewhere. I did not have time to track down the problem. It could h= ave gotten in trouble on a mutex, in the driver, etc. So I may have to put = all the code in the task/thread anyway until I have a better understanding = of what code can execute in the DSR. I just have to dig through the eCos Re= f Manual. Seeing your code, brought something to mind. I had assumed that the interru= pt was enabled in the Kinetis HAL and all I had to do was configure the por= t. Perhaps that is not the case. I'll try to use your example and see what = happens. Thanks