2021-05-27 02:26 AM
hi,i am trying uart with dma in stm32f103c8 with uart3 after n try i found that uart3 in stm32f103c8 is not working then in polling I observed that the TX pin is not getting high and low so I toggle that pin it toggles as a digital pin so I think there is some problem in uart3 can someone provide solutions that how can i use it
2021-05-27 04:48 AM
Hi @ABhat.7 ,
Please refer to the UART_TwoBoards_ComPolling example of the STM32CubeF1 FW.
Best Regards,
Ons.
2021-05-27 05:02 AM
> toggle that pin it toggles as a digital pin
Then that pin is set as Out, i.e. you have not set properly the pin as AF.
JW
2021-05-27 05:28 AM
Show code..
Do the pins need remapping? Thought U3 defaults were PB10/11
2021-05-27 05:37 AM
Hi,
thanks for the reply it was my code error that i found out but now I am using DMA with uart3 for receiving fixed bytes of data as I am query for the data some data is coming and some go missing as soon as I comment NVIC_EnableIRQ(USART3_IRQn) that some more data is coming any support is useful
secondly, i want to know I can we have a DMA and interrupt on the same usart i.e I want a DMA on the recieve and a transmission complete interrupt i am using standard peripheral library for stm32f103c8
2021-05-27 07:27 AM
As I recall the plumbing, the DMA is signalled on RXNE and TXE, and can service those prior to any interrupts be recognized.
I think you can catch UART TC, but DMA TC will occur earlier, and you can chain buffers to achieve continuous output.
2021-05-27 08:02 AM
Hi,
I didnot understand very well pls give an example where i use dma for recieving and interrupt for transmissions data on the same usart
2021-05-27 06:31 PM
Hi @Ons KOOLI
Thanks for reply but i just want to know can we use dma on rx and interrupt on tx of same uart please any example share with me
2021-05-28 05:02 AM
HI,
I want to ask can a timer interfere with uart my uart is working fine it recieve complete data but as soon as i enable the timer it start to lose some byte of data so i implement DMA as it has the highest interrupt priority than tim interrupt but still the situation is same i can the interrupt priority but nothing is work also keep the isr short my timer is 4msec as of now please suggest what can be done in this case
2021-05-29 03:12 AM
There is only one physical flip-flop - the one that you read as RXNE - to indicate the received byte to either the interrupt and to the DMA, and it is cleared by reading the data register, again either by processor, or DMA.
So, if you enable both the UART interrupt and DMA, chances are, that DMA succeeds to pick the data before the UART interrupt starts to run and check the RXNE bit, so it finds that bit already cleared. In short, you can't have both.
But if you want DMA on Rx and interrupt on Tx, well, that should be perfectly OK.
JW