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++
12600 Discussions

UART connected to DMA with char HAL API

Altera_Forum
Honored Contributor II
1,184 Views

I am connecting the NIOS II UART to a DMA controller. Is it possible to use the standard HAL character mode API to open, read and write the /dev/uart. 

 

Thanks in advance, 

Joe
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
406 Views

If you don't use the HAL API and the DMA at the same time, it should work.

0 Kudos
Altera_Forum
Honored Contributor II
406 Views

Just to clarify - what I want to do is have the DMA servicing the UART whiled the driver transmits data throught the DMA with write() and reads from the DMA RXD buffer with read().

0 Kudos
Altera_Forum
Honored Contributor II
406 Views

In that case you need to write your own driver. The default HAL driver doesn't know how to do that.

0 Kudos
Altera_Forum
Honored Contributor II
406 Views

It is also worth remembering that read/write require a data copy, it makes little difference to overall system performance if this is to/from the UART fifo, or from a memory buffer from which the UART will dma data. In both cases writes will eventually hit 'buffer full' and stall. 

What you do need is a driver that does read/write directly to/from the fifo - rather than through another adaption layer! and a fifo that is big enough to buffer the required data. 

I doubt that the Altera HAL driver meets either of these criteria. Also if you are trying to transfer data with low latency of cpu use then you'll need something more slim-line than the generic 'unix style' io functions.
0 Kudos
Altera_Forum
Honored Contributor II
406 Views

Thanks for all your feedback. I agree with the issues that you have pointed out. I had a problem with dropped RXD. I came across the FIFO'ed UART which addresses the problem nicely. So, goodbye UART-DMA union ;-) 

 

Joe
0 Kudos
Reply