From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5058 invoked by alias); 14 Aug 2006 08:43:30 -0000 Received: (qmail 5047 invoked by uid 22791); 14 Aug 2006 08:43:29 -0000 X-Spam-Check-By: sourceware.org Received: from static124-190.staticcal.vsnl.net.in (HELO alumnux.com) (203.197.124.190) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 14 Aug 2006 09:43:27 +0100 Received: from [192.168.10.157] (IDENT:U2FsdGVkX1/CVWNEB8gohYXAMxOJNgKQkQUEnuTXBaE@[192.168.10.157]) by alumnux.com (8.9.3/8.9.3) with ESMTP id TAA01668; Mon, 14 Aug 2006 19:37:41 +0530 Message-ID: <44E035C3.1000408@alumnux.com> Date: Mon, 14 Aug 2006 08:43:00 -0000 From: Tathagata Das User-Agent: Mozilla Thunderbird 0.8 (X11/20041020) MIME-Version: 1.0 To: Andrew Lunn CC: ecos-discuss@ecos.sourceware.org References: <44DC6C39.1060309@alumnux.com> <44DC6E2B.2090209@mlbassoc.com> <44E012AC.2000707@alumnux.com> <20060814071705.GR2053@lunn.ch> In-Reply-To: <20060814071705.GR2053@lunn.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 Subject: Re: [ECOS] Serial driver X-SW-Source: 2006-08/txt/msg00126.txt.bz2 Hi Andrew, Thank you very much for your reply. For my problem 1 : You are right. I want to echo that character. Please tell me how can I enable echo. I am not using any tty layer. I am sending you DEVTAB_ENTRY for your reference. DEVTAB_ENTRY( test_serial_iol, /dev/ser0, 0, &cyg_io_serial_devio, test_serial_init, test_serial_lookup, // Serial driver may need initializing &test_serial_channel ); I only use this single entry. Hope , i do not need two entries (one for RX and one for TX). Single entry should be good enough. Also CYGDAT_IO_SERIAL_TTY_CONSOLE = /dev/ser0 Please tell me how can I use tty layer so that I get the echo support. For my problem 2 : Yes you are again right. It tries to read a block. But why ? My scanf is like this ---- scanf("%c", &c); SO it should try to read single character. But i have noticed that size = 256 in "while (size< *len) {". Please tell me why the control does not come out and why I am not able to print the value of variable 'c'. Thanks in advance Regards, Tatha Andrew Lunn wrote: >On Mon, Aug 14, 2006 at 11:35:32AM +0530, Tathagata Das wrote: > > >>Hi , >> I am using two different IRQ number for RX and TX in serial driver. >> >>My init function of serial driver looks like this --- >> >>static bool test_serial_init(struct cyg_devtab_entry *tab) >>{ >> serial_channel *chan = (serial_channel *)tab->priv; >> (chan->callbacks->serial_init)(chan); // Really only required >>for interrupt driven devices >> >> /* Allocate the IRQs */ >> if (chan->out_cbuf.len != 0) { >> /* TX interrupt */ >> cyg_drv_interrupt_create(TX_IRQ, >> 0, >>// IRQ priority >> (cyg_addrword_t)chan, >>// Data item passed to interrupt handler >> &test_tx_serial_ISR, >> &test_tx_serial_DSR, >> &tx_serial_interrupt_handle, >> &tx_serial_interrupt); >> cyg_drv_interrupt_attach(tx_serial_interrupt_handle); >> cyg_drv_interrupt_unmask(TX_IRQ); >> } >> if (chan->in_cbuf.len != 0) { >> /* RX interrupt */ >> cyg_drv_interrupt_create(RX_IRQ, >> 0, >>// IRQ priority >> (cyg_addrword_t)chan, >>// Data item passed to interrupt handler >> &test_rx_serial_ISR, >> &test_rx_serial_DSR, >> &rx_serial_interrupt_handle, >> &rx_serial_interrupt); >> cyg_drv_interrupt_attach(rx_serial_interrupt_handle); >> cyg_drv_interrupt_unmask(RX_IRQ); >> } >> >> return true; >>} >> >>My problems are : >> >> 1. when I press any key from keyboard test_rx_serial_ISR and >>test_rx_serial_DSR are called one by one. >> But that charcter is not displayed. >> >> > >You mean there is no echo? Do you have echo'ing enabled? Are you even >using the tty layer in eCos which provides echo support? > > > >> 2. In scanf function --- control is stuck into " while (size >>< *len) {" this loop in serial_read function. >> >> > >So this layer is trying to read a block of charactors, not a single >charactor read. Nothing wrong here. > >You might want to read more of >http://ecos.sourceware.org/docs-latest/ref/io-serial-driver-details.html > >It sounds like you want to use the tty driver. > > Andrew > > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss