This patch that moves the 'read DR' into the existing error handling.
By this, the DR is only read in case of an error, which include the ORE. In the case of no error, the DR is not read and no bytes get lost.
Search found 6 matches
- Tue Jan 03, 2023 5:27 pm
- Forum: Bug Reports
- Topic: Avoid lost bytes on STM32/USARTv1 with RTS/CTS
- Replies: 7
- Views: 51271
- Tue Jan 03, 2023 4:41 pm
- Forum: Bug Reports
- Topic: Avoid lost bytes on STM32/USARTv1 with RTS/CTS
- Replies: 7
- Views: 51271
Re: Avoid lost bytes on STM32/USARTv1 with RTS/CTS
Ok. Will do.
- Tue Jan 03, 2023 4:23 pm
- Forum: Bug Reports
- Topic: Avoid lost bytes on STM32/USARTv1 with RTS/CTS
- Replies: 7
- Views: 51271
Re: Avoid lost bytes on STM32/USARTv1 with RTS/CTS
Hi,
That function is meant to handle errors, it is done in case there is an ORE to be handled, from the STM32 RM:
"The ORE bit is reset by a read to the USART_SR register followed by a USART_DR register read operation."
Giovanni
Hi Giovanni
That's correct. However, by unconditionally reading ...
That function is meant to handle errors, it is done in case there is an ORE to be handled, from the STM32 RM:
"The ORE bit is reset by a read to the USART_SR register followed by a USART_DR register read operation."
Giovanni
Hi Giovanni
That's correct. However, by unconditionally reading ...
- Mon Jan 02, 2023 10:53 pm
- Forum: Bug Reports
- Topic: Avoid lost bytes on STM32/USARTv1 with RTS/CTS
- Replies: 7
- Views: 51271
Avoid lost bytes on STM32/USARTv1 with RTS/CTS
In uart_lld_serve_interrupt() of the STM32/USARTv1 implementation, the following line reads the data register, clearing it by that:
(void)u->DR; /* SR reset step 2.*/
This causes a problem in the following context:
- DMA is IDLE
- An send operation is started
- The UART receives a single byte and ...
(void)u->DR; /* SR reset step 2.*/
This causes a problem in the following context:
- DMA is IDLE
- An send operation is started
- The UART receives a single byte and ...
- Mon Jan 02, 2023 1:10 pm
- Forum: Small Change Requests
- Topic: Improve DMA UART with RTS/CTS on STM32
- Replies: 2
- Views: 28114
Re: Improve DMA UART with RTS/CTS on STM32
Fixed patch to match description. Sorry.
- Sun Jan 01, 2023 11:04 pm
- Forum: Small Change Requests
- Topic: Improve DMA UART with RTS/CTS on STM32
- Replies: 2
- Views: 28114
Improve DMA UART with RTS/CTS on STM32
Hi there
I'm working on a port of our BTstack Bluetooth Host stack for ChibiOS. BTstack's transport layer requests data from the UART in blocks and uses CTS/RTS to avoid loosing bytes. The trunk ChibiOS/HAL implementation in uart_enter_rx_idle_loop() unconditionally restarts the UART DMA leading to ...
I'm working on a port of our BTstack Bluetooth Host stack for ChibiOS. BTstack's transport layer requests data from the UART in blocks and uses CTS/RTS to avoid loosing bytes. The trunk ChibiOS/HAL implementation in uart_enter_rx_idle_loop() unconditionally restarts the UART DMA leading to ...