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