From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28096 invoked by alias); 22 Aug 2012 07:27:41 -0000 Received: (qmail 28084 invoked by uid 22791); 22 Aug 2012 07:27:39 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_PW X-Spam-Check-By: sourceware.org Received: from mail-bk0-f49.google.com (HELO mail-bk0-f49.google.com) (209.85.214.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Aug 2012 07:27:07 +0000 Received: by bkcji2 with SMTP id ji2so173313bkc.36 for ; Wed, 22 Aug 2012 00:27:05 -0700 (PDT) Received: by 10.204.148.72 with SMTP id o8mr5992261bkv.103.1345620425354; Wed, 22 Aug 2012 00:27:05 -0700 (PDT) Received: from [192.168.178.24] (217-75-21-197.pool.cyberlink.ch. [217.75.21.197]) by mx.google.com with ESMTPS id gq2sm1959286bkc.13.2012.08.22.00.27.03 (version=SSLv3 cipher=OTHER); Wed, 22 Aug 2012 00:27:04 -0700 (PDT) Message-ID: <503489DB.6020200@gmail.com> Date: Wed, 22 Aug 2012 07:27:00 -0000 From: Bob Brusa User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: discuss ecos Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit 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] Interrupt handling under eCOS for the arm AT91SAM7s X-SW-Source: 2012-08/txt/msg00004.txt.bz2 Hi, I use an ISR that has considerable work to. Clearly, a job for a dsr, but I found, that using a dsr is too time consuming, so I must do everything in the isr (A screenshot of the ISR is available here: https://dl.dropbox.com/u/13412634/Screenshot%20-%2021.08.jpg) The ISR handles 4 pwm channels - all producing interrupts at a rate of 1 ms. 3 of the channels run syncronously and hence only one of them has interrupts enabled. The 4th channels also triggers interrupts every ms, but is not in phase with the other 3 channels. The pwm interrupts have lowest priority of all interrupts in my system. Upon entry in the pwm_isr, I clear flags, mask the interrupt of the pwm-hardware on the level of the interrupt controller (AIC) and enable interrupts again. This should allow higher priority interrupts to come through, but no pwm interrupts while the pwm_isr is busy. This according to my understanding. But it is obviously wrong, because the primitve "semaphore" I implemented tells me, that a 2nd pwm interrupt interrupts the first one. One explanation I have for this is, that one of the higher priority interrupts clears the interrupt mask of the pwm channels - which I would consider a bug of eCos. Onother explanation could be, that the system timer interrupts the pwm_isr and runs a task and of course, many threads in my system access globals of the pwm_isr, doing this within mask-pwm-interrupts/unmask-pwm-interrupts brackets. But it would surprise me that ecos runs a thread while an isr is still unfinished. Any comments? Bob -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss