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




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 ]    [ 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