Skip to main content
Bogdan Golab
Lead
June 11, 2014
Solved

STM32 nucleo-053 - USART issue

  • June 11, 2014
  • 1 reply
  • 634 views
Posted on June 11, 2014 at 23:06

Hi,

I am familiar with Standard Pheripheral Library on STM32F100 MCU.

====

The problem is that on nucleo-053 (SPL is not available for this MCU) I cannot make USART working properly.

I generated the code using CubeMX 4.2 (USART2 enabled, NO parity, 1 stopbit, 8 data bits). When I use the following piece of code:

    uint8_t pData[40];

    int k;   

    for(k=0;k<40;k++){pData[k]=48+k;}

    HAL_UART_Transmit(&huart2, pData, 40, 10);

only numbers and @ are sent correctly. Letters ('abcd', etc ) are displayed as if they have extended ASCI codes (extra bit was added in front of the original code making it extended code). I know that for 9B & parity the HAL driver plays this way. But it's not the cae, I guess (no 9B & parity).

I do not use physical uart port - Virtual COM is used (ST-link 2.1 feature).

===

Anyway, could you please share USART code example for nucleo-L053?

Thanks,

Bogdan

    This topic has been closed for replies.
    Best answer by Montassar BEN ROMDHANE_O
    Posted on June 30, 2014 at 15:11

    Hi bogdan,

    You can download the STM32CubeL0 FW package from here: 

    http://goo.gl/6yriy6

    UART examples are available under: Projects\STM32L053R8-Nucleo\Examples\UART

    With regards.

    1 reply

    Montassar BEN ROMDHANE_O
    Visitor II
    June 30, 2014
    Posted on June 30, 2014 at 15:11

    Hi bogdan,

    You can download the STM32CubeL0 FW package from here: 

    http://goo.gl/6yriy6

    UART examples are available under: Projects\STM32L053R8-Nucleo\Examples\UART

    With regards.