2019-11-06 02:57 AM
I am trying to receive variable length of data by manipulating the the RxXferCount value and pRxBUffPtr.I am getting desired results most of the time but for certain time the receive buffer is unable to capture all the bytes i sent.I tried to debug it seeing if my code to calculate the amount of data bytes received is okay or not but I find the behaviour random without any syncronism
2019-11-06 06:01 AM
Likely introducing race conditions, or making the ones in the HAL implementation worse.
If you understand what you're doing, discard the HAL routines, and manage the USART more directly in the IRQHandler, into buffering structures you have control of and are more inherently thread safe.