DISCO L476 USART 3 not working

Sysprogs forums Forums VisualGDB DISCO L476 USART 3 not working

This topic contains 5 replies, has 2 voices, and was last updated by  support 11 months, 4 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #12736


    I designed a board based on the Disco L476. I used MBED with the L476 board as the chosen platform and the program worked well.

    I wanted to move to VisualGDB and so I ported the project and everything worked. Then I tried to check USART3.

    At first when I declared the TX RX pins (PD_8, PD_9 in my design) I got an error “pinmap not found for peripheral”  in the COM port window. So I searched for pin configurations, and indeed these two pins were missing in the PinMap PinMap_UART_RX[] and PinMap PinMap_UART_TX[] declarations in “”PeripheralPins.c”.

    So I added these lines:

    {PD_8, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},     //added to PinMap PinMap_UART_TX[]


    {PD_9, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},   //added to PinMap PinMap_UART_RX[]


    Now I don’t get the “pinmap not found for peripheral” message anymore, but I also don’t receive any serial data for this port (I can’t see any data received). I checked with an external logic analyzer that the receive pin indeed receives data.

    Here is my declaration:

    GPS_Serial.format(8, SerialBase::None, 1);

    void GPSCallback()
    e = GPS_Serial.getc();


    Could it be that the USART3 can’t register itself to receive interrupts?






    Generally in order for a USART to work, you need to ensure the following:

    • The peripheral clock for this USART is enabled
    • The corresponding pins are configured to work as USART
    • You configure the peripheral correctly (e.g. set the baud rate) and write the correct data registers

    We have a detailed tutorial showing how to use STM32 UART here: https://visualgdb.com/tutorials/arm/stm32/uart/hal/

    Generally we would advise first sorting this out on a regular non-MBED project and then stepping through the mbed source code to ensure that it does the same initialization/configuration steps as your non-mbed project (hardware register window can help double-check that the necessary parts got initialized).



    all the other UARTS are working well with the same MBED code running in VisualGDB.

    I didn’t change anything…





    We understand you didn’t change anything, however sometimes the problems are caused by unexpected combinations of small changes or incompatible settings that are hard to predict. We advise following the diagnostic steps in the previous post to resolve this.




    I tried the example from the URL, but I still can’t receive any serial data. Transmitting serial data works well.

    I am using interrupts.

    Here is my code.

    • This reply was modified 11 months, 4 weeks ago by  support. Reason: formatting



    You might be missing extern “C” around your interrupt handler. Please also note that our support is limited to issues related to VisualGDB. For general programming problems and troubleshooting issues with your code please use other resources like StackOverflow to get help from other community members.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.