Quality RTOS & Embedded Software

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


Serial-Ethernet bridge (Using lwIP on str91x)

Posted by Vinay Verma on July 18, 2008
I have been struggling with the implementation of a "Serial-Ethernet bridge" for quite few weeks. If anyone has an idea kindly reply on the following query (Thanks in Advance):

On sending continous data (@115200) on the serial port (UART async rs232) for around 7-8 hrs, the serial interrupt stops triggering (I have verified this by putting a break point in the UART IRQ handler routine, when the problem occured. I am using IAR embedded workbench).

Following is the implementation:

- The UART IRQ handler fills the data into a queue (using xQueueSendFromISR).
- A free running task keep waiting on the queue & whenever there is any data in the queue, it forwards it to the TCP (tcp_write & tcp_output).
- This bridge is just a part of the system, in all there are around 10 tasks running in the system.

Kindly reply if anyone has an idea.

RE: Serial-Ethernet bridge (Using lwIP on str

Posted by Çağlar Akyüz on July 18, 2008
Maybe you're not freeing some pbufs, or some other task is disabling serial interrupts after some time. IMHO,
these kind of problems are hard to track. If I were you, I would:

1st : Remove all other tasks and just forward data to the ethernet port. This will help localizing the problem.
2nd : Check if ethernet is working after serial interrupts stop working.


RE: Serial-Ethernet bridge (Using lwIP on str

Posted by Vinay Verma on July 18, 2008
Hi Caglar,

you are write. I have already made a setup running with only the bridge task..I may have results after another 7-8 hrs..btw ethernet was working when the serial interrupt stopped....I would share the results tomorrow morning (my morning INDIA :)..Thanks for the reply..


RE: Serial-Ethernet bridge (Using lwIP on str

Posted by damien h on July 23, 2008
Hi Vinay,

I had a problem like this : when i was enabling a RTC interrupt on my STR912, my software was reseting after 3-4-6 hours of running... I don't know if you are in this case or not...

Maybe the following thread could help you:

OtherWise: the usual problem of stack overflow could be interesting to check, if not already done...

I write the following code to look the memory usage of each task, the function is the following (this function locate in the stack the last: 0xa5a5a5a5)(To use it, you need to cut - copy the structure definition: tskTCB to a *.h file to 'export' the type)(UTILS_TRACE_STACK is used as a printf function (vsprintf) to send debug info to an hyperterminal)

Another thing you can check is the stack available in IRQ mode.



* \fn u8 UTILS_PrintStackUsage (xTaskHandle TaskHandle)
* \brief This function will print (trough RS232) information about stack usage on a dedicated task
* \return Always 0
u8 UTILS_PrintStackUsage (xTaskHandle TaskHandle)
tskTCB *TaskStack = (tskTCB*)TaskHandle;


if (TaskHandle != NULL)
//print direct available info
UTILS_TRACE_STACK2("---- %s ----",TaskStack->pcTaskName);
UTILS_TRACE_STACK3("Stack Start - End : 0x%.8x - 0x%.8x",TaskStack->pxStack,TaskStack->pxTopOfStack);

// init the current memory cell on the beginning of the task
CurrentCell = TaskStack->pxStack;

while ( (*CurrentCell == 0xa5a5a5a5)&& (CurrentCell <= TaskStack->pxTopOfStack))

UTILS_TRACE_STACK3("Stack size: %i, Lowest free space ava. %i",(TaskStack->pxTopOfStack - TaskStack->pxStack),(CurrentCell - TaskStack->pxStack));

return (0);

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

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

Latest News

Version 10.1.0 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