Page 1 of 1

UART2 + DMA

Posted: Mon Jun 18, 2012 5:50 pm
by orcim
Hi,
I'm trying out a board STM32VLDISCOVERY
when I try to use the channel 2 of the uart
I get the following error:
# error "invalid DMA stream to Associated USART2
how can I disable the use of DMA or is it a bug?

Thanks a lot!

Re: UART2 + DMA

Posted: Mon Jun 18, 2012 5:57 pm
by Giovanni
There are two drivers handling the USARTs: The Serial driver and the UART driver. The Serial driver is interrupt driven and does not require DMA, the UART driver uses DMAs.

In halconf.h you can enable and disable the various drivers, in mcuconf.h you can setup the low level detail.

In you case probably you enabled the UART driver, use the Serial instead (like in the included demo).

Giovanni

Re: UART2 + DMA

Posted: Mon Jun 18, 2012 6:14 pm
by Giovanni
Hi,

Your error message was caused by a bug, that DMA channel is supposed to work with the UART driver. As I suggested before, if you don't need operations with DMA use the Serial driver and configure it to use USART2 in mcuconf.h.

Giovanni

Re: UART2 + DMA

Posted: Tue Jun 19, 2012 4:29 pm
by orcim
Hi,
in the testhal i have only uart example!
where can i search other example with usart?

when fix the bug with DMA?

thanks of lot

Loris

Re: UART2 + DMA

Posted: Tue Jun 19, 2012 5:19 pm
by Giovanni
Hi,

All examples under ./demos use the serial driver, there is a demo for the Discovery too. The bug has already been fixed in the repository, the next release will include the fix.

Giovanni

Re: UART2 + DMA

Posted: Wed Jun 20, 2012 8:01 am
by orcim
hi,

ok Giovanni

thanks of lot

Loris