UART2 + DMA

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
orcim
Posts: 4
Joined: Mon Jun 18, 2012 5:34 pm

UART2 + DMA

Post 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!
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: UART2 + DMA

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: UART2 + DMA

Post 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
orcim
Posts: 4
Joined: Mon Jun 18, 2012 5:34 pm

Re: UART2 + DMA

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: UART2 + DMA

Post 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
orcim
Posts: 4
Joined: Mon Jun 18, 2012 5:34 pm

Re: UART2 + DMA

Post by orcim »

hi,

ok Giovanni

thanks of lot

Loris
Post Reply