cancel
Showing results for 
Search instead for 
Did you mean: 

Does UART4 configured as UART_MODE_RX work?

Ba5tian
Associate II

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?

3 REPLIES 3

This is unexpected.

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

JW

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
Up vote any posts that you find helpful, it shows what's working..
Ba5tian
Associate II

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.