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


CM0 sometimes hardfaults after SW reset.

Posted by megazap on August 26, 2014

I'm having trouble tracking down a rare hardfault that sometimes happens after doing a SW reset of an Cortex M0 (Atmel SAMD20).

The restored PC=0x00001a70 points to the vPortSVCHandler: __asm volatile ( 1a6c: 4b08 ldr r3, [pc, #32] ; (1a90 ) 1a6e: 6819 ldr r1, [r3, #0] 1a70: 6808 ldr r0, [r1, #0]

r0 = 0x20001308 r1 = 0x20200980 r3 = 0x20000de4

I cant figure out whats corrupted or rather why because everything is reset. To try to isolate things i disable everything from my normal application and only kept a task that waits for 100ms and then do a SW resets. It takes everything from a few hours to a couple days to reproduce with this minimal application.

I have also verified that no other interrupts are enabled other than SVC(prio 0), SV(prio 255) and systick(prio 255, every 1ms).

All help or ideas are welcome.

FreeRTOS version 7.4.2


CM0 sometimes hardfaults after SW reset.

Posted by rtel on August 27, 2014

What is the difference to the SAMD20 between a hard reset and a soft reset? Is it possible that peripherals are still generating interrupts, or that the RAM is not being initialised correctly (or that interrupts are being generated while the RAM is being initialised) after a soft reset?


CM0 sometimes hardfaults after SW reset.

Posted by megazap on August 27, 2014

With a SW reset i refer to a call to NVIC_SystemReset(), a hard reset is done using the external reset pin. The external pin is not affected when doing a SW reset.

The test application never enables any peripheral interrups neither before or after the scheduler is started.

What do u mean with the RAM not being initialized correctly?

r1 = 0x20200980 is way of because the MCU(SAMD20G16) only have 16k RAM.

[ 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