STM32 UART Definitions not found for HAL but ok for StdPeriph?

Sysprogs forums Forums VisualGDB STM32 UART Definitions not found for HAL but ok for StdPeriph?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10649
    gojimmypi
    Participant

    I’m following the (ok, 3 year old) STM32 UART tutorial here:

    https://visualgdb.com/tutorials/arm/stm32/uart/

    As the tutorial is old, my VisualGDB UI is a bit different. One place of interest: I have 3 options for the LEDBlink sample (HAL, StdPeriph, and FreeRTOS).  I leave the default at LEDBlink (HAL). There’s also a checkbox not show in tutorial “Support Legacy HAL API”. I leave it checked.

    Blink works fine. So I proceed to step 7 to add some UART code.

    When doing so – pretty much all of the UART macros are undefined, even when adding the suggested libraries as shown:

    If I change the sample code to LEDBlink (StdPeriph) the only compile error is that unsignedchar is an unknown type for  USART_ReadByteSync(USART_TypeDef * USARTx)   ha! as it should have a space in there between unsigned and char 😉 perhaps update the tutorial for others that might not know that.

    However, curiously with StdPeriph my LED no longer blinks (GPIOC, pin 6 in both instances)

    Can you please add some clarification to this? Is there some documentation on the HAL features? I googled it and didn’t really find any sort of VisualGDB overview on this topic.

    I am using a STM32 Smart V2 (with STM32F103C8T6 – or is that xCBT6?) with Visual Studio 2017 (same result in 2015) with VisualGDB-5.2.14.1389.msi

    Any insight on this will be appreciated, thanks.

    *edit: remove html garbage that was included in copy/paste

     

     

    • This topic was modified 7 years, 9 months ago by gojimmypi.
    #10651
    support
    Keymaster

    Hi,

    Our UART tutorial is indeed old and covers the older STM32 StdPeriph library. We will eventually add another version of it showing how to use the newer HAL library, but currently our best advice would be to look up the UART example for your board (select “use examples from STM32Cube” on the sample selection page of VisualGDB Project Wizard) and use the code from it.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.