Quality RTOS & Embedded Software

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


Loading

Hard Fault exception

Posted by joe_her on February 13, 2019

I get a Hard Fault exception whil progrma is running. Call stack is not much help (attched) Is there a better way to hunt this? Thanks


Hard Fault exception

Posted by waveringradiant on February 13, 2019

This is probably a good place to start, FreeRTOS article on debugging hard faults.

Attachments


Hard Fault exception

Posted by neicdech on February 13, 2019

Most hardfault comes from the processor trying to access a peripheral which has not not been properly initialised. for instance , you forgot to enable the clock to a peripheral. Or accessing invalid memory or something you forgot to do. so step through the code and see where the fault comes from.

Attachments


Hard Fault exception

Posted by waveringradiant on February 13, 2019

Most hardfault comes from the processor trying to access a peripheral which has not not been properly initialised. for instance , you forgot to enable the clock to a peripheral. Or accessing invalid memory or something you forgot to do. so step through the code and see where the fault comes from.

I'm not sure I'd agree with that... some of the many, many examples that can cause hard fault include: * stack overflow * pointer corruption * uninitialized pointer (from OP's picture I suspect this might be the case) * handling for disabled exceptions, e.g.,unprivileged access, MPU, bus fault

Here the SCB's HFSR (0xE000ED2C) will give you some hints. If you step through pvPortStartFirstTask(), I suspect that a pointer that you are responsible for isn't set up correctly.

Goodl luck. Let us know if you discover the issue or if you have further clues/details

Attachments


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


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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Mediatek

Renesas

RISC-V

SiFIve RISC-V

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

Xilinx Microblaze and Zynq partner