Skip to main content
Ba5tian
Associate II
August 1, 2018
Question

Does UART4 configured as UART_MODE_RX work?

  • August 1, 2018
  • 3 replies
  • 930 views

I have STM32F765, did the configuration in CubeMX.

I did try to receive with:

uint8_t testData[10] = {0,};
HAL_StatusTypeDef status = 0;
status = HAL_UART_Receive(&huart4, testData, 5, 2000);

This did not work, status was HAL_TIMEOUT(I did try Receive_IT as well but the result where the same, no receive).

After changing to UART_MODE_TX_RX both funktions work as expected.

Is this correct or do i have to configure more to use half duplex only?

    This topic has been closed for replies.

    3 replies

    waclawek.jan
    Super User
    August 1, 2018

    This is unexpected.

    Read out and post content of UART4 registers when in the "non-working" state.

    JW

    Tesla DeLorean
    Guru
    August 1, 2018

    Try simple tests of polling the UART directly, or reviewing the ISR register to confirm if you're actually receiving anything. Check basic things like clocks for GPIO, and UART, and the correct pin/AF settings.

    CubeMX/HAL enforces some half-duplex, serialized operation, but that's due to stupid software design and blocking, rather than any inherent limitation of the underlying hardware.

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

    I think i didn't understand the half duplex mode correct. I thought that the uart would just receive but in fact it is one wire if i understand the doc's correct.

    Thanks for your help.

    Now i'm just activating the receive interrupt and thats good enought for me.