Skip to main content
xfinta
Visitor II
July 19, 2016
Question

SW UART

  • July 19, 2016
  • 2 replies
  • 640 views
Posted on July 19, 2016 at 16:55

Hello, I need a sw emulated uart. I am trying to use the sw emulation available here:

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32-standard-peripheral-libraries-expansions/stsw-stm32156.html

but I am only able to receive/trasmit once. If I try to receive/trasmit a 2nd time, it doesn't work. 

Please could you help or suggest an alternative? 
    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    July 20, 2016
    Posted on July 20, 2016 at 03:02

    Please could you help or suggest an alternative? 

    Use a real USART, there's usually a lot of them.

    Perhaps you can provide a little foundation, like why, and which STM32 specifically we are talking about, because they make hundreds now across half a dozen families.

    It is a topic that comes up occasionally, and has been discussed here before, I'm not looking to wade into your implementation work, but others might.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    FordFairlane
    Associate III
    May 30, 2017
    Posted on May 30, 2017 at 19:57

    Hi, I'm using the same library to add a software UART on STM32F401VC @ PB6 & PB7. The ST library uses TIM1 and DMA2, but I need them for other tasks, only TIM4 is free. All other hardware UARTS and pins are used. I have modified the library replacing:

    - 'TIM1' by 'TIM4'

    - 'DMA2' by 'DMA1'

    - 'CHANNEL_6' by 'CHANNEL_2'

    - 'Stream1' by 'Stream0'

    - 'Stream2' by 'Stream3'

    - etc,

    The modified library does not work, when I try to send data, as soon as DMA1 Stream0 is enabled the DMA transfer error flag is set and the corresponding DMA error interrupt is serviced.

    Maybe DMA1 is not able to transfer data from RAM to GPIO_BSSR using TIM4_CH1 trigger?.

    Regards