Skip to main content
Nikeware
Associate
August 20, 2018
Question

STM32L432KC - lpuart work only in transmit mode

  • August 20, 2018
  • 5 replies
  • 1111 views

LPUART (over usb connection) work only in transmit mode. I have CubeMX generated project with "receive and transmit" settings for lpuart in interrupt mode, but can only send data from the mController to PC.

With another evalboard (Nucleo L496ZG) my send/receive source code work without problems. The reconfiguration of L432KC from lpuart to usart1 or usart2 also work fine.

Thanks!

    This topic has been closed for replies.

    5 replies

    T J
    Senior III
    August 20, 2018

    I had to enable the interrupts for both DMA and UartRx, then the DMA worked correctly.

    Tesla DeLorean
    Guru
    August 20, 2018

    What pins are involved, care to provide a minimally complete example?

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Nikeware
    NikewareAuthor
    Associate
    August 21, 2018

    Yes, of course.

    In attachment one ioc-file for CubeMX and main.c file with source code for lpuart and usart1.

    Nikeware
    NikewareAuthor
    Associate
    August 21, 2018

    Note. The callback function HAL_UART_RxCpltCallback() for lpuart called only once, direct after start of mC.

    Nikeware
    NikewareAuthor
    Associate
    August 21, 2018

    Solved!

    In datasheet for STM32 L432KC the ST-Link microController pins connections (STLK_TX and STLK_RX) connected to PA2 and PA15 pins on mC respectively. But CubeMX generate by default the source code for LPUART connection over PA2 and PA3 pins.

    Reconfiguration of USART2 for PA2 and PA15 solve this problem!

    Thanks!