Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Asynchronous serial data with 115200 bit/sec

Posted by Jonas Poulsen on September 4, 2009
I know this is not the first time this topic has been discussed, so please forgive me.

I am working with FreeRTOS 5.2.0 on a NEC 78K0R-KG3 (12 kb RAM/ 256 FLASH / ~14 MHz) in preemptive mode with approx. 5 tasks. FreeRTOS is brilliant – easy to work with and stable!

My device interfaces another device using the built-in UART running 115200 bit/sec. Unfortunately I have no flow control available (neither sw./hw.) so I am really struggling to find a solution so I do not lose characters in my Rx interrupt. I believe the enter/exit critical section in for instance vTaskDelay (calls xTaskResumeAll() ) can take longer than the approx. 80 us I have between my incoming characters.

I have two onboard DMA controllers that can help me, but I have a total of 4 UARTS that I may, or may not, want to use in 115200 bit/sec.

Can anyone confirm that there is no easy way to solve this type of problem, other than using either DMA or implementing some kind of flow control.

Best regards,

Jonas, Denmark

RE: Asynchronous serial data with 115200 bit/sec

Posted by Peter on September 4, 2009
Hi Jonas,
try to define the uart interrupt priority higher than all rtos related tasks. So the uart isr can interrupt the scheduler. Within the interrupt write the received character into a receive buffer (FIFO). Back in your task you can access the buffer.
Could be that a solution?

RE: Asynchronous serial data with 115200 bit/sec

Posted by Jonas Poulsen on September 4, 2009
Hi Peter
I have prioritized my UART RX interrupt at the highest possible level, but the problem is that interrupts are completely disabled when FreeRTOS execute some operations. No matter how the UART RX interrupt is prioritized it will not be executed....


RE: Asynchronous serial data with 115200 bit/sec

Posted by Jonas Poulsen on September 5, 2009
** Update **
I have implemented a work-around using the two onboard DMA controllers, but I am still wondering if their is another solution.


RE: Asynchronous serial data with 115200 bit/

Posted by Dave on September 5, 2009
I would not call that a work around but the reason why the DMA is provided in the first place and what is expected to be done.

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner