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


FreeRTOS - PIC32 Crash log and System backup before restarting

Posted by muruganandamd on March 13, 2014


We are using PIC32Mx MCU with Freertos version V6.0.2 on our product.

We are planning to add a crash information logging and the required system back up(application related) into external flash memory(SPI Bus) before restarting the system whenever STACK over flow triggers . We need to add this functionlity in the production firmware for field monitoring purpose. Is there any better way to do this?

Since vApplicationStackOverflowHook() function called from scheduler tick, is it possible to add this functionlity on that function with external flash memory read/write functionlity for this backup process?

Thanks Muruganandam

FreeRTOS - PIC32 Crash log and System backup before restarting

Posted by rtel on March 13, 2014

For crash logging I would recommend adding your crash report function to the PIC32 exception handlers, and the configASSERT() macro (which would require updating to a later version of FreeRTOS, it is currently on V8). You can then add a call to configASSERT() in the malloc failed and stack overflow hook functions.

There will be no problem in doing what you want from the kernel tick on the assumption you are not going to try and recover from the crash - so once you are inside the error handler (called from the interrupt) do whatever you need to do then just sit in a null loop or reset the system rather than trying to return from the error handler.


FreeRTOS - PIC32 Crash log and System backup before restarting

Posted by muruganandamd on April 28, 2014

Thanks for the details.

Can we add some new functions in the existing task.c file of freertos? we need to get the size of TCB, TOP of the stack, name etc.. during crash information logging. Since there is no hook function to get the TCB size, can we add a new function in the existing task.c file to get these details? or Is there any other way to achive this? Is there any issue on the GPL license when we add new functions in the task.c?

Thanks, Muruganandam

FreeRTOS - PIC32 Crash log and System backup before restarting

Posted by rtel on April 28, 2014

If you add or modify code in the core kernel then technically you should offer to make those changes available to other people. The easiest way to do that is just to post them to the FreeRTOS Interactive site (http://interactive.freertos.org) so other people can just view them and download them if they want.


[ 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