Can you please provide more details regarding the your project? As per my understanding you are trying to receive data using UART.
The UART configuration in the attached document seems to be correct.
Could you please attach your project as would be easier to get a better understanding of this issue ?
Yes, I try to communicate (Modbus 485) with the Uart.
I have a 20ms timebased main tasks and when if I have a "free time"
(all tasks have not been completed 20ms)then, I manage the communication frames.
The Uart is by interruption (Tx and RX).
The firmware is about 65Kb.
What specific part would you like to review?
Can you please provide the following information:
1. Try changing the oversampling to 16x and see if the least significant bit is still lost?
2. Can you please let us know if the issue is observed while sending or receiving data? As per our understanding it occurs while receiving data through UART.
3. If it is possible can you please share the part of the project that shows the error and remove other parts that may not be required to reproduce the issue at our end? Please share the oscilloscope trace.
The sampling of UART happens completely in hardware even though you might perform several other tasks in firmware you should not lose anything either you lose the entire byte due to firmware traffic losing the last bit alone should not be related to firmware.