Skip to main content
Visitor II
March 14, 2014
Question

How to enable the FPU in Atollic for the STM32F4-Discovery

  • March 14, 2014
  • 3 replies
  • 2746 views
Posted on March 14, 2014 at 16:03

If someone could give me an idea, that'd be great. I need it to speed up math operations.

    This topic has been closed for replies.

    3 replies

    Graduate II
    March 14, 2014
    Posted on March 14, 2014 at 16:21

    Don't some of the template projects do so? Probably buried in a compiler/target option pane some place.

    Remember the FPU supports only 32-bit float operations, ie sqrtf(), cosf(), etc The FPU is typically physically enabled in SystemInit() within system_stm32f4xx.c, note the defines the compiler generates when the FPU is enabled, this likely also impacts the libraries pulled in by the linker.

    void SystemInit(void)
    {
    /* FPU settings ------------------------------------------------------------*/
    #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
    SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
    #endif
    //..

    Visitor II
    March 14, 2014
    Posted on March 14, 2014 at 16:40

    Hi

    Right click on the project and select properties.

    Open the ''C/C++ Build'' on the left hand panel.

    Select ''Settings'' in the left hand panel.

    In the main panel - select the ''Tool Setting'' panel (2nd one along)

    This should list the settings for Assembler, C Compiler, C linker, Other

    Open the C Compiler list and select ''Target''

    In the panel : there should be ''Floating point'' and ''FPU'' drop downs.

    In the FPU drop down select ''FPV4-SP-D16''

    BE WARNED - if you change the processor - it will wipe ALL the other settings!

    This is a known problem with Atollic/Eclipse

    Explorer II
    May 25, 2024

    left click to properties section --> on left side select C/C++ build. look for Tool Settings tab and inside that click on MCU settings. look out for Floating - point unit options and select "None". Below that select Floating-point ABI as "Software Implementation". 

     

    I hope that helps :)

    Graduate II
    May 25, 2024

    Only a decade late...