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


Hard fault - Sometimes

Posted by joe_her on June 5, 2016

I have an extremely difficult to catch hard fault. I suspect it happens somewhere during initialization, as if the system starts running it will run for days with no issues. However, once in a while, a hard fault happens after reset. I set a break point at the hard fault interrupt, and I can see that the call stack is empty, only shows "void f() ",

Can the FreeRTOS+ Trace be used to find out what is going on? My ARM assembly knowledge is very low.

Thanks for any help...


Hard fault - Sometimes

Posted by rtel on June 5, 2016

I suspect it happens somewhere during initialization

FreeRTOS will leave interrupts disabled as soon as you start to call FreeRTOS API functions. That is done to ensure interrupts do not execute until after the scheduler has started, in case an interrupt service routine attempts to use the FreeRTOS API, and the API function called attempts a context switch (which would not make sense before any tasks were running).

If you are hitting a hard fault before the scheduler is started, could it be that something you are doing during initialisation is enabling interrupts?

Can you put a break point in your ISRs, or simply set a variable that can be inspected from the hard fault handler to see if any ISRs have executed, to see if this is the case?


Hard fault - Sometimes

Posted by joe_her on June 6, 2016

I will set a counting variable on each interrupt entry, and will check. Thanks.

Hard fault - Sometimes

Posted by joe_her on June 6, 2016

Can't believe did this, but I forgot to call one xEventGroupCreate() ...

I wonder how it worked at all sometimes.


[ 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