Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Are Avalon UARTs useable as eCos /dev/tty ?

Altera_Forum
Honored Contributor II
1,392 Views

I can't get working correctly a simple application that reads bytes at 115200 bps under eCos using "hardware serial device driver" (Avalon UART) : I get one byte each two. 

However, the (almost) same program works fine with Altera HAL. 

 

-> is it possible to use a pure eCos driver to manage Avalon UART instead of the hardware one ? 

-> what are the TTY mode chan# 0..2 ? Are they mappeable on Avalon UARTs ? If so, how (I can find them with cyg_io_lookup()) ? 

 

Thanks in advance ! 

 

++ Fred
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
496 Views

Hi Fred, 

I had something similar to this happening to me. Whilst Rxing at higher Baud rates (including 115200) I would occasionally lose characters. It turned out to be a timer interrupt, of higher priority, occasionally taking longer to complete. If the timer interrupt lasted more than 400uS then that was long enough for the UART to Rx 2 characters, one in the holding register and one in the shift register - anything else has nowhere to go. 

I fixed the problem by giving the UART a higher priority in the SOPC builder, this didn't cuase any problems, for me, as the UART irq is very fast - just buffers the character into a ring buffer for later processing. 

 

Banx.
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

Thanks Banx, 

 

Actually, my system does just nothing for now. 

It's why I am quite worried about futur with this OS on my system. 

I've tried with a slower system tick (100 Hz), but it isn't better. 

 

Do I have to unmask interrupt or something like that before using this driver ? 

 

-- Fred
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

 

--- Quote Start ---  

originally posted by frd66@Jun 13 2006, 02:17 AM 

thanks banx, 

 

actually, my system does just nothing for now. 

it's why i am quite worried about futur with this os on my system. 

i've tried with a slower system tick (100 hz), but it isn't better. 

 

do i have to unmask interrupt or something like that before using this driver ? 

 

-- fred 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16147) 

--- quote end ---  

 

--- Quote End ---  

 

There are two drivers polled and interrupt driven, you should not be manually interfering with interrrupts this should be left to the driver. Without looking at your entire application it&#39;s tricky to diagnose the problem, I suggest you follow the instructions to get one of the examples working on a development board, once you have that working then try to build your application on this board, then try your own hardware.
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

 

--- Quote Start ---  

originally posted by rugbybloke+jun 13 2006, 12:23 pm--><div class='quotetop'>quote (rugbybloke @ jun 13 2006, 12:23 pm)</div> 

--- quote start ---  

<!--quotebegin-frd66@Jun 13 2006, 02:17 AM 

thanks banx, 

 

actually, my system does just nothing for now. 

it&#39;s why i am quite worried about futur with this os on my system. 

i&#39;ve tried with a slower system tick (100 hz), but it isn&#39;t better. 

 

do i have to unmask interrupt or something like that before using this driver ? 

 

-- fred 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16147) 

--- quote end ---  

 

--- Quote End ---  

 

There are two drivers polled and interrupt driven, you should not be manually interfering with interrrupts this should be left to the driver. Without looking at your entire application it&#39;s tricky to diagnose the problem, I suggest you follow the instructions to get one of the examples working on a development board, once you have that working then try to build your application on this board, then try your own hardware. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16153)</div> 

[/b] 

--- Quote End ---  

 

That&#39;s not so simple ! 

Of course, I use the interrupt version of driver. 

Till now, I have the following results : 

- it works on EP2C35 at 85MHz with Altera HAL 

- it works on EP2C35 at 85MHz with eCos 

- it works on our hardware at 20MHz with Altera HAL 

- it doesn&#39;t works on our hardware at 20MHz with eCos 

 

Unfortunatly, I&#39;m not good enought to program the PLL (for the SSRAM) as required to make my EP2C35 running at 20 MHz. It would help me to unvestigate the things...
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

Hi Fred, 

Sorry Fred, we&#39;ve never used eCos (or even HAL) so can&#39;t help any further with that. It sounds like your problem isn&#39;t the one I suspected - but it would be interesting to see if you get all characters when a slower Baud rate is used. 

Good luck. 

 

Banx.
0 Kudos
Reply