Quality RTOS & Embedded Software

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


Getting unaligned exception on CM4 without FPU

Posted by jvgediya on September 19, 2017


I am getting unaligned exception(Usage fault) in function vListInsertEnd exaclty at below mentioned statement,

pxNewListItem->pxPrevious = pxIndex->pxPrevious;

However when i remove portYIELDFROMISR and taskYIELD from my task code, the frequency of the above exception reduces.

I am developing a product related to networking and i am receiving high number of interrupts. I offload the packet processing to the task from the interrupt handler using Queues.

Do anyone have any idea about the possible issue? I suspect memory corruption but i am not getting any pointers to move ahead in debugging.

Thanks, Jags

Getting unaligned exception on CM4 without FPU

Posted by rtel on September 19, 2017

Yes, I expect memory corruption too, accessing pxNewListItem or writing to pxNewListItem->pxPrevious, or accessing pxIndex must be causing the exception, which would indicate that one of those three have been corrupted.

First the normal pointers, which I suspect you will have looked at already:

  • Do you have configASSERT() defined?

  • Do you have stack overflow checking set to 2?

  • Are you using a recent version of FreeRTOS, as the more recent the more assert() points there are to catch interrupt priority problems. The head revision from SVN is recommended there as it will assert() on just about all misconigurations now.

Links can be found on this page: http://www.freertos.org/FAQHelp.html

Then, are you sure your interrupt stack is large enough? Interrupts use the same stack as main(), so the stack set up by your C run time, often in the linker script (depending on the tools). Overflows in the stack used by interrupts will not be caught by the stack overflow detection.

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

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

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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