Skip to main content
NGros
Associate II
November 26, 2018
Question

Why is my CubeMx created USART not running?

  • November 26, 2018
  • 2 replies
  • 1222 views

Hi Guys,

I created a Keil5 project with CubeMX. In this project, i only created a USART (USART1) periphery application. So simple as that. BUT: My usart seams not to run. I enabled it by "HAL_USART_ENABLE_IT" in the setup and call the "HAL_USART_RECEIVE_IT" in the USART1_IRQHandler function. Secondly i tried to enable RCC-Clock by "__HAL_RCC_USART1_CLK_ENABLE();", but my buffer was still empty.

In the Debug Session, i made a Screenshot of the huart1 variable. There you can see the values of every Register during debugging. They stay all the same, so no chasnges during debugging.

Do you see anything I missed for calling? The USART clock should be connected with the usart periphery automatically by using CubeMX, souldn't it?

Thank you and have a nice day.

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    November 26, 2018

    Only seeing 3 files. ZIP up compilable projects don't attach multiple files.

    Not sure what board or what pins are involved.

    Check GPIO pins and clocks

    Check HSE_VALUE define and PLL setting relative to chosen clock source/parts.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    NGros
    NGrosAuthor
    Associate II
    November 26, 2018

    Hi, I already found the mistake, was a pure pin fault...

    I'd like to explain my question as done, where do I do that?

    Tesla DeLorean
    Guru
    November 26, 2018

    Select your own answer as being correct, assume it uses the little V icon in the top right of the reply.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..