Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


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 ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists