Quality RTOS & Embedded Software

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




Loading

flop.c fail after cache enable

Posted by zhuchunxia on July 18, 2016

Hi:

when I enable data cache, flop.c fails in float data calculate. but it is correct when I disable cache. I found vCompetingMathTask3 and vCompetingMathTask4 malloc a memory space to save result. and those result changes in malloced memory sometimes.. but vCompetingMathTask1 and vCompetingMathTask2 never fails in both cache enable or disable.. anyone can help ?

Vincent


flop.c fail after cache enable

Posted by davedoors on July 18, 2016

Which port? Sometimes you must call portTASKUSESFLOATING_POINT() in a task before it uses floating point instructions.


flop.c fail after cache enable

Posted by zhuchunxia on July 18, 2016

my cpu is a special cpu which is not in demo project... I don't see flop.c call portTASKUSESFLOATING_POINT() the API ? how to port the API ? is there a example ?


flop.c fail after cache enable

Posted by zhuchunxia on July 18, 2016

anyway, I am alwaysing use soft float point... there is no FPU inside


flop.c fail after cache enable

Posted by rtel on July 18, 2016

If you are using soft floating point, then the floating point routines are just C function, so there should be no difference in behaviour when you call a C function that is not using floating point instructions to one that is using floating point instructions.

Maybe the floating point emulation functions are using a lot of stack - do you have stack overflow checking switched on? As this is your own port, are you absolutely sure the tack overflow checking is working? Is your port saving and restoring all the processor's special purpose registers correctly? Are the floating point emulation functions thread safe?


flop.c fail after cache enable

Posted by zhuchunxia on July 18, 2016

before cache off, all demo common example run smoothly and work well ... but after cache on, I only found flop.c fail so far... I enable #define configCHECKFORSTACK_OVERFLOW 1 in config file...

Are the floating point emulation functions thread safe? what does it mean ? I only call vStartMathTasks to create 8 task to run floadting point function and check it with another task ... I also dump all tasks stack status and do not find any overflow in stack.


flop.c fail after cache enable

Posted by rtel on July 18, 2016

Are the floating point emulation functions thread safe? > what does it mean ?

If you do not have a floating point unit then the compiler will generate a function call for each floating point operation. Are the functions inserted by the compiler safe to call from more than one thread of execution at a time? If they use global variables or shared buffers then they won't be.


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




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

Latest News

FreeRTOS kernel V10 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