Quality RTOS & Embedded Software

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


Loading

Cortex-M4 Hard Float ABI Issue

Posted by namcho on February 24, 2016

Hello, I'm using stm32f429 which is cortex-m4 based also it has got hardware FPU **unit. I'm using Eclipse Luna 4.4.2 with ARM GNU GCC **C++ compiler and GNU-ARM plugin. The version of GNU GCC is 5_2-2015q4.

I'm choosing GCC/ARMCM4F as porting files and my freertos version is 8.2.3. The completion is done without any errors but in run-time when I trying to create any task and let it to start than program suddenly goes into HardFaultHandler().

Here is my simple code:

~~~~ static LedClass led1(LED1, 300), led2(LED2, 600);

int main(int argc, char* argv[]) { HAL_Init();

/* Configure the system clock */ SystemInit(); SystemClock_Config();

MXGPIOInit();

led1.Create("LED1", configMINIMALSTACKSIZE, 1); led2.Create("LED2", configMINIMALSTACKSIZE, 1); FreertosAbstract::PortSysTickHandler();

while(1){ //Error handler } } /* * @brief : 1ms systick timer */ void SysTickHandler(void) { HALIncTick(); FreertosAbstract::PortSysTickHandler(); } ~~~~ The problem occurs after PortSysTickHandler() function was executed. Here is the other simple code which is working well: Leds are blinking...

~~~~ int main(int argc, char* argv[]) { HAL_Init();

SystemClock_Config();

MXGPIOInit();

led1.Create("LED1", configMINIMALSTACKSIZE, 1); led2.Create("LED2", configMINIMALSTACKSIZE, 1); //FreertosAbstract::TaskStartScheduler();

while(1){ HALDelay(100); led1.LedOff(LED1); HALDelay(200); led1.LedOn(LED1); } } /* * @brief : 1ms systick timer */ void SysTickHandler(void) { HALIncTick(); // FreertosAbstract::PortSysTickHandler(); } ~~~~

Other problemed example is: ~~~~ int main(int argc, char* argv[]) { HAL_Init();

SystemClock_Config();

MXGPIOInit();

led1.Create("LED1", configMINIMALSTACKSIZE, 1); led2.Create("LED2", configMINIMALSTACKSIZE, 1); //FreertosAbstract::TaskStartScheduler(); FreertosAbstract::PortSysTickHandler(); //Program is going to HardFault after this statement

while(1){ HALDelay(100); led1.LedOff(LED1); HALDelay(200); led1.LedOn(LED1); } } /* * @brief : 1ms systick timer */ void SysTickHandler(void) { HALIncTick(); // FreertosAbstract::PortSysTickHandler(); } ~~~~ So the problem's cause is the xPortSysTickHandler() function.

Compiler Settings are: Float ABI: FP Instruction hard FPU Type: fpv4-sp-d16

I can share my whole code if necessary.


Cortex-M4 Hard Float ABI Issue

Posted by rtel on February 24, 2016

The problem occurs after PortSysTickHandler() function was executed.

Please place a break point on that line, then step through the code to see at which point the hard fault is triggered. It may also be possible to use the technique described on this link: http://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html to get additional information.

I note you are using a C++ wrapper, which will not of come from us, so people reading the post will first assume there is a problem there, and will not be able to support that directly as its unknown code. You can also try using the native API without the wrapper, or obtaining support whoever supplied the wrapper.

Attachments


Cortex-M4 Hard Float ABI Issue

Posted by namcho on February 24, 2016

Okay there is no problem about freertos with hard fpu compiling. I created new project than has made simple demo, it has worked well with and without wrapper class.

Still I dont know why my first demo wasn't worked. I have to look deeper to find out the root reason. Anyway thanks for allowed time to me have nice days.

Attachments


[ 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