Quality RTOS & Embedded Software

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


Loading

"static clustering" option on IAR optimization causes hard fault

Posted by kilombo on December 7, 2014

Hello all...

I am using STM32L151 family with IAR 6.21 on my FreeRTOS project and I have encountered some problems with "xQueueSend" and "xQueueSendFromISR" functions.

When using these functions from my tasks, it causes the CPU generate a "hard fault" interrupt. I traced the problem to the function that copies the data to the queue( where the number of bytes to copy is messed up). After a lot of debugging time, I have found that when I un-check the box of "static clustering" option on IAR optimizer, the program runs fine without the "hard fault".

So, I have a few qeustions regarding this phenomena. Have anyone encountered a similar problem? Anyone knows what is "static clustering" option on IAR optimizer (I have looked on IAR documentation but the explanation is hardly satisfaing)? And the most important, what can I do to make it work? Assume I want to keep the level of optimization as high as possible.

Thank you. Itay


"static clustering" option on IAR optimization causes hard fault

Posted by rtel on December 7, 2014

This is a known thing, and is 'normally' the case. Generally in EWARM you can set optimisaiton to maximum, then manually uncheck the static clustering option. I have never worked out why, and, as you say, the documentation on what static clustering does is not informative (just something like "makes statics cluster", or "clusters statics when turned on", ...). I would guess it was doing something to place certain variables near each other for faster access, but it is a guess.

All demos are tested with zero, maximum speed and maximum code size optimisations, and this one option (specific to IAR) is the only one we are aware of that causes an issue.

Regards.


"static clustering" option on IAR optimization causes hard fault

Posted by kilombo on December 7, 2014

Thank you very much for the quick response.

Itay.


[ 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