UART variable sized string receive with DMA and a timer
Posted: Wed Feb 25, 2015 10:10 pm
I am new to ChibiOS but have been developing on STM32 and LPC43xx MCUs in a super loop fashion for a while now. A functionality that I found useful was the ability to reset a general purpose timer counter (STM32) or the SCT (LPC43xx) from an external source without an interrupt (timer slave reset mode configuration on STM32). This allowed me to connect the UART receive source to the UART_RX pin and another pin that resets a timer count on any polarity transition. The DMA can then handle any UART receive by putting it onto a buffer and then if the timer counter ever reaches the value in the timer's Auto Reload Register (STM32) an interrupt is generated and we know that nothing is being sent anymore (transmission is finished) so we can then collect the data on the DMA buffer for processing. This allows variable sized string receives without any processor interaction at all as we can query the DMA counter in the interrupt routine once the receive is finished.
Is there any such functionality in the ChibiOS hal? I am currently using the Serial driver to receive each byte separately as it becomes available which is quite a resource intensive method (similar to https://github.com/grantmd/ChibiCopter/ ... ster/GPS.c).
This is useful for things like a GPS unit that sends NMEA strings of variable size.
Thank you for any help in advance.
Roland
Is there any such functionality in the ChibiOS hal? I am currently using the Serial driver to receive each byte separately as it becomes available which is quite a resource intensive method (similar to https://github.com/grantmd/ChibiCopter/ ... ster/GPS.c).
This is useful for things like a GPS unit that sends NMEA strings of variable size.
Thank you for any help in advance.
Roland