2022-07-13 09:32 PM
I have a distance laser outputting at 10KB/s (BAUD 921500).
I cannot miss any of the information output by the laser so want to turn it on after the UART DMA is turned on and listening.
Hence the steps are
However, doing things in this order prevents any bytes from being received by the UART DMA.
I was wondering if anyone might have some insights into this problem, many thanks.
2022-07-13 10:03 PM
There is no intrinsic timeout with your approach. UART receive using cyclic DMA waits forever for the next byte. Possibly "start laser" causes some garbage output on the serial line which puts the USART in an error state? Use a scope/LA to check and also the error bits.
If there are no such errors, show your code.
hth
KnarfB
2022-07-13 10:13 PM
Hi KnarfB thanks for your response,
It does appear that the laser is outputting some garbage that causes the DMA to lock up. If the DMA listens to the laser <20ms after it has begun outputting the DMA will lock up. I'm in the process of looking at the initial laser output (0-20ms) right now
If the behaviour is caused by garbage output do you have any suggestions to ensure the DMA is able to capture the first non-garbage byte that the laser outputs?
2022-07-13 10:28 PM
2022-07-13 10:34 PM
awesome thank you
2022-07-13 10:47 PM
Actually it does not appear that's there's any garbage data being output. This is confirmed empirically by doing the following
If garbage data were the problem I would expect turning the laser on and off to produce more garbage that causes the UART to error
2022-07-13 11:01 PM
Which STM32?
> prevents any bytes from being received by the UART DMA.
How do you observe this, exactly?
Both UART and DMA do have status bits/bytes, check them (keeping in mind that debugging may be intrusive).
JW