Skip to main content
Visitor II
September 14, 2020
Solved

Error with USART 2 when attached to STLINKV3Mods VCP and USART 1 configured

  • September 14, 2020
  • 3 replies
  • 1077 views

I have a custom PCB with a STM32G431 on board and STLINkV3Mods

I wish to use PA9,10 for USART1 and PA2,3 for USART2 attached to VCP of STLINKV3MODS via 3K3 resistor.

If I use USART1 only it is OK

If I use USART2 only it is OK. See Figure 1

If I use USART1 and USART2. USART1 works OK. USART2 does not work. See Figure 2

There is a correct pattern coming out of the Micro. But he STLINKV3MODS input pin stays high. This I assume must be being driven high by the STLINK.

If I transmit a pattern before configuring the USART1 is also does not work.

0693W000003RZ4YQAW.jpg

Figure 1 USART2 only configured Yellow USART2 Tx pin Blue via 3k3 VCP input pin

0693W000003RZ57QAG.jpg

Figure 2 USART2 only configured Yellow USART2 Tx pin Blue via 3k3 VCP input pin

    This topic has been closed for replies.
    Best answer by DCorn

    Error found there was a short on due to badly etched PCB between USART1 and USART2

    3 replies

    DCornAuthor
    Visitor II
    September 14, 2020

     Further investigation. The line

    MODIFY_REG(huart->Instance->CR1, USART_CR1_FIELDS, tmpreg); line in UART_SetConfig(UART_HandleTypeDef *huart) when huart is pointing to UART1 causes the STLINKV3 pin to go high but the micro side stays Low i.e PA2 stays low

    DCornAuthorAnswer
    Visitor II
    September 14, 2020

    Error found there was a short on due to badly etched PCB between USART1 and USART2

    Super User
    September 14, 2020

    Thanks for coming back with the solution.

    Please select your post as Best so that the thread is marked as solved.

    JW