Announcements
IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

Anonymous
Not applicable

What do I need to do to get the tool chain to build for the HW FPU on the STM32F4xx?

Thanks.

0 Likes
1 Solution
Anonymous
Not applicable

The entire build flags I am using are:

CPU_CFLAGS     := -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=vfpv4

CPU_CXXFLAGS   := -mthumb -mcpu=cortex-m4

CPU_ASMFLAGS   := -mcpu=cortex-m4

CPU_LDFLAGS    := -mthumb -mcpu=cortex-m4


If I try building =hard, the lib errors follow:

wiced-sdk/tools/arm_gnu/bin/win32/arm-none-eabi-ld.exe: error: build/waf_bootloader-NoOS-NoNS-IHM-SDIO/Binary/waf_bootloader-NoOS-NoNS-IHM-SDIO.elf uses VFP register arguments, c:/users/risleym/desktop/ihm/ptolemy/wiced-sdk/tools/arm_gnu/bin/win32/../../lib/thumb/v7m\libc.a(lib_a-errno.o) does not


I wanted to find the specific instruction that was causing this hard fault, so I followed the steps in this guide:

http://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html


Executing this left me with a program counter of 0x800FECA, which lies within _tx_thread_system_return() here:

0x0800fec0: mrs r0, PRIMASK

0x0800fec4: push {r0}

0x0800fec6: cpsie i

0x0800fec8: svc 0

0x0800feca:   nop

0x0800fecc: pop {r0}

0x0800fece: msr PRIMASK, r0


Program Status Register: 0x41000248

Link Register: 0x800E899


I also find that this occurs prior to any floating point operations. I hope this information is valuable, please let me know your thoughts & any direction I can take this in.

View solution in original post

0 Likes
5 Replies
Anonymous
Not applicable

Broadcom Team,

Does the WICED toolchain have M4 FPU support?? Are the lib's compiled for it?

I am building with the following flags:

CPU_CFLAGS := -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=vfpv4

Building with these options does create "vmla", "vcvt" and other floating-point instructions. However, I incur a hard fault immediately. Building with "-mfloat-abi=hard" yields incompatible libc.a build errors.

Are we wasting our time here, or is FPU support really included?

0 Likes
Anonymous
Not applicable

Information from this site http://stackoverflow.com/questions/18772848/fpu-in-stm32f4-processors indicates that you must enable the FPU on the STM32F4 prior to using floating point instructions.

Currently the STM32F4xx platform files do not initialize the FPU automatically however you should ideally add the instruction that enables the FPU in the STM32f4xx init_architecture() function.


We appreciate the time you've spent investigating this and we hope we can work together to get this working.

0 Likes
Anonymous
Not applicable

Hi Nikvh,

We are enabling the FPU explicitly in init_architecture(), just before the watchdog is initiated. The exact line is:

  

     /* set CP10 and CP11 Full Access */

    SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2));

0 Likes
Anonymous
Not applicable

The entire build flags I am using are:

CPU_CFLAGS     := -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=vfpv4

CPU_CXXFLAGS   := -mthumb -mcpu=cortex-m4

CPU_ASMFLAGS   := -mcpu=cortex-m4

CPU_LDFLAGS    := -mthumb -mcpu=cortex-m4


If I try building =hard, the lib errors follow:

wiced-sdk/tools/arm_gnu/bin/win32/arm-none-eabi-ld.exe: error: build/waf_bootloader-NoOS-NoNS-IHM-SDIO/Binary/waf_bootloader-NoOS-NoNS-IHM-SDIO.elf uses VFP register arguments, c:/users/risleym/desktop/ihm/ptolemy/wiced-sdk/tools/arm_gnu/bin/win32/../../lib/thumb/v7m\libc.a(lib_a-errno.o) does not


I wanted to find the specific instruction that was causing this hard fault, so I followed the steps in this guide:

http://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html


Executing this left me with a program counter of 0x800FECA, which lies within _tx_thread_system_return() here:

0x0800fec0: mrs r0, PRIMASK

0x0800fec4: push {r0}

0x0800fec6: cpsie i

0x0800fec8: svc 0

0x0800feca:   nop

0x0800fecc: pop {r0}

0x0800fece: msr PRIMASK, r0


Program Status Register: 0x41000248

Link Register: 0x800E899


I also find that this occurs prior to any floating point operations. I hope this information is valuable, please let me know your thoughts & any direction I can take this in.

View solution in original post

0 Likes
Anonymous
Not applicable

Thank you for your detailed analysis and the wealth of information.

We are working on building a new libc library with the additional CFLAGS.

0 Likes