From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17720 invoked by alias); 6 Jul 2005 07:31:43 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 17490 invoked by uid 22791); 6 Jul 2005 07:31:25 -0000 Received: from smtpauth09.mail.atl.earthlink.net (HELO smtpauth09.mail.atl.earthlink.net) (209.86.89.69) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 06 Jul 2005 07:31:25 +0000 Received: from user-112umh6.biz.mindspring.com ([66.47.90.38] helo=[127.0.0.1]) by smtpauth09.mail.atl.earthlink.net with asmtp (Exim 4.34) id 1Dq4NP-0006H5-RN; Wed, 06 Jul 2005 03:31:24 -0400 Message-ID: <42CB88BE.1060207@mindspring.com> Date: Wed, 06 Jul 2005 07:31:00 -0000 From: Frank Pagliughi User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Oliver Munz CC: ecos-discuss@sources.redhat.com References: <006101c580e1$b3a48df0$5e188481@cadpad> In-Reply-To: <006101c580e1$b3a48df0$5e188481@cadpad> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: 4d82f965df0f6dd9e3f977c6d1ea408f0a9da525759e265454384bafbdfe06f2ecbe45bb47807d2faf78f7fbf31ba7be350badd9bab72f9c350badd9bab72f9c Subject: Re: [ECOS] Timecritical interrupt-debuging ... printf in DSR's ... Cyg_Scheduler_Implementation::rem_thread() ... cyg_assert_fail() X-SW-Source: 2005-07/txt/msg00057.txt.bz2 Oliver Munz wrote: > Hi > > To debug an USB-driver, I used diag_printf(). Unfortunatly this > function blocks my DSR longer then the USB-specifications allowed to. > So I tryed to send the debug-output over the standard > at91-serial-driver, configurated with a 2kByte buffer. > > This works fine a short time and fail: > > CYG_ASSERT( ((queue_map & (1< ((!run_queue[pri].empty())!=0), "Map and queue disagree"); > in: > > 7 cyg_assert_fail() at e:\ecos\packages\infra\current\src\buffer.cxx:737 > 6 Cyg_Scheduler_Implementation::rem_thread() at > e:\ecos\packages\kernel\current\src\sched\mlqueue.cxx:323 > 5 Cyg_Condition_Variable::wait_inner() at > e:\ecos\packages\kernel\current\src\sync\mutex.cxx:636 > 4 serial_write() at > e:\ecos\packages\io\serial\current\src\common\serial.c:362 > 3 cyg_io_write() at e:\ecos\packages\io\common\current\src\iosys.c:178 > > > I don't know if it's allowed to use the buffered IO from ISR and > DSR's. If everybody know's if it should work or not in threory, let me > know.... Im also intressted in other hints how to debug driveres... > > Thanks > Oliver Munz > Another thing you can consider is make a first pass at the driver using a high-priority thread to service the device, instead of the DSR. Just have the DSR signal the thread using a semaphore or similar. Than you can then send a fair amount of debug output to a hardware-driven serial port (from the thread context) and still remain within the timing constraints of USB. You may just need to try responding to the USB host before doing your printf()'s in certain time-constrained situations, such as when you get a SET_ADDRESS. This will obviously effect your throughput (not to mention all the serial output slowing things down) but you'll be able to get through a USB enumeration no problem. Once it's all working you can bring the code back into the DSR and remove the printing. Or even better, leave a configuration option to switch between the "debug" and "release" options. Frank Pagliughi -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss