Quality RTOS & Embedded Software

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




Loading

FreeRTOS - PIC32 Crash log and System backup before restarting

Posted by muruganandamd on March 13, 2014

Hi,

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.

Regards.


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.

Regards.


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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