From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <52C949D6.6090904@xenomai.org> Date: Sun, 05 Jan 2014 13:02:30 +0100 From: Philippe Gerum MIME-Version: 1.0 References: <52C7CF1E.2050404@xenomai.org> <52C85088.7020501@xenomai.org> <52C86093.4000609@xenomai.org> <52C891C1.2090007@xenomai.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] rtdm_task_init call freezes the system List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nima Nourozi Cc: xenomai@xenomai.org On 01/05/2014 01:25 AM, Nima Nourozi wrote: > On Sat, Jan 4, 2014 at 2:57 PM, Philippe Gerum > wrote: > > On 01/04/2014 09:29 PM, Nima Nourozi wrote: > > Here is the task function. But I'm not seeing the printout. > > void xx_start_transfer(void *arg) { > rtdm_wait_period(); > > > What about checking the return code of rtdm_wait_period()? If > something goes wrong there, you do want to know, instead of entering > a tight runaway loop. > > -- > Philippe. > > > I can't print anything since the system freezes so I don't know how I > can check return value? Also, what loop are you referring to I don't > have a loop just a print statement. It does not make sense to have a single wait statement in a periodic task, you should have a loop. Or you don't have periodic task. So your task should implement a loop. To force a direct output through the serial console port, you may want to try enabling DEBUG_LL and IPIPE_DEBUG, then call __ipipe_serial_debug(), instead of printk. Do not use this in regular code, this is for debugging purpose only, in mostly hopeless situations where using buffered console output is not an option. Preventing the thread to exit by suspending it indefinitely before the routine returns would also help debugging. Calling rtdm_task_sleep(0) should do this. -- Philippe.