Quality RTOS & Embedded Software

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


Loading

Cortex-M4 Hard Fault. Tmr Svc thread stack corruption.

Posted by arcolight on December 19, 2013

Hi, I'm using cortex-m4 cpu and freertos. I'm using latest stable version - 7.5.2. For some time everything were fine, but at one moment my cpu begans to fail with HardFault at different points, such as calling printf(...), taskYIELD(), calling some local functions, allocations, etc.

Hours of horrible debug shows me, that problem in stack corruption of process "Tmr Svc". Hardware breakpoint triggered at task allocation and, next, at context switch, that normal, but stack have been already corrupted.

Now I'm using freertos-7.4.2 with the same code of my program, and everything works fine. I can suppose, that problem in freertos.

And this bug appears when .bss section becomes large. I'm using heap_3.c and all allocations works fine, i've modified linker script so, that memory for heap is after .stack section.

This bug appears also, if I'm using any other heap, that uses .bss section memory and if I create my own tasks restricted. I supposу cause of this bug is a dense memory organization, but i can't tell exactly.


Cortex-M4 Hard Fault. Tmr Svc thread stack corruption.

Posted by davedoors on December 19, 2013

I'm using latest stable version - 7.5.2.

The latest version if 7.6.0. Try that with configASSERT() defined and look through all the points on http://www.freertos.org/FAQHelp.html


Cortex-M4 Hard Fault. Tmr Svc thread stack corruption.

Posted by dumarjo on December 19, 2013

Hi,

Have you set the stackoverflowcheck ?

http://www.freertos.org/Stacks-and-stack-overflow-checking.html

This can help debugging this kind of problem.

Jonathan Le 2013-12-19 06:51, Dmitriy a écrit : > > Hi, I'm using cortex-m4 cpu and freertos. I'm using latest stable > version - 7.5.2. For some time everything were fine, but at one moment > my cpu begans to fail with HardFault at different points, such as > calling printf(...), taskYIELD(), calling some local functions, > allocations, etc. > > Hours of horrible debug shows me, that problem in stack corruption of > process "Tmr Svc". Hardware breakpoint triggered at task allocation > and, next, at context switch, that normal, but stack have been already > corrupted. > > Now I'm using freertos-7.4.2 with the same code of my program, and > everything works fine. I can suppose, that problem in freertos. > > And this bug appears when .bss section becomes large. > I'm using heap_3.c and all allocations works fine, i've modified > linker script so, that memory for heap is after .stack section. > > This bug appears also, if I'm using any other heap, that uses .bss > section memory and if I create my own tasks restricted. I supposу > cause of this bug is a dense memory organization, but i can't tell > exactly. > > ------------------------------------------------------------------------ > > Cortex-M4 Hard Fault. Tmr Svc thread stack corruption. > https://sourceforge.net/p/freertos/discussion/382005/thread/f9b1bb09/?limit=25#7bc0 > > ------------------------------------------------------------------------ > > Sent from sourceforge.net because you indicated interest in > https://sourceforge.net/p/freertos/discussion/382005/ > > To unsubscribe from further messages, please visit > https://sourceforge.net/auth/subscriptions/ > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner http://www.mailscanner.info/, and is > believed to be clean.


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


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

Latest News

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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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