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


LWIP+FreeRTOS crashing

Posted by slam7211 on July 20, 2017

I am using an FRDM k64 Arduino, and developing a TCP/IP client on it. It works as follows. There is a circular queue that stores data. Periodically that queue gets data put in the queue from external sensors via an interrupt. During free time I check to see if there is data in the queue, if there is data, empty the queue and write the data to a server. To do this I use FreeRTOS plus the netconn API that comes with LWIP. I have 1 thread called TCPThread that creates a connection, and connects to my server. I then have an infinite while loop that checks the queue and runs netconnwrite if there is data (yes I handle looping back on the queue). After few hundred sucessful writes to the server (currently just a C# server on a PC that writes the data to a screen) my MCU crashes. I end up in the default ISR, which points to a bus fault.

If I lower the number of netconnwrite calls by increasing the minimum ammount of data in the queue before we bother to write to the server (for example need 100 bytes vs 1 byte to call netconnwrite) the ammount of time the MCU lasts between crashes goes up (havent checked exact number of calls, but my gut says it will be simmilar). Is there something I am missing here? It seems I am running out of memory and crashing, but because LWIP is an API I really don't have an easy way to malloc for it/shouldn't I not need to because all resources should be freed after a local function (netconn_write) is called?

LWIP+FreeRTOS crashing

Posted by rtel on July 20, 2017

Unfortunately we cannot support lwIP. Trying to support users on lwIP, which is moderately involved third party code, was what lead us to develop our own TCP/IP stack so we could better support TCP users.

Your system could be going wrong in any number of ways. In my experience, the biggest source of problems in lwIP applications is normally the driver, not the lwIP code at all.

You say "I end up in the default ISR, which points to a bus fault." If it is the default ISR, how are you determining that it is a bus fault?

[ 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