AnsweredAssumed Answered

smt32f4 - arm-none-eabi makefile

Question asked by nanos on Sep 23, 2013
Latest reply on Sep 24, 2013 by Clive One
Hi all,
I'm trying to write a makefile for arm-none-eabi toolchain (Menthor arm-2013.05-23-arm-none-eabi-i686-pc-linux-gnu). The file compile all project without error but I have several questions about this procedure.
The first question is about CFLAG. I have set this parameters:
CFLAGS  = -g -O2 -Wall -Tstm32_flash.ld
CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
CFLAGS += -mfloat-abi=soft -mfpu=fpv4-sp-d16.

I want to change -mfloat-abi=soft in =hard... but the the compiler returns an error:
/tmp/ccW1HQgE.o uses VFP register arguments, main.elf does not
How to include the HARD FPU support ?

The building strucure:
├── doc
├── inc
│   └── stm32f4xx_conf.h
├── lib
│   ├── inc
│   ├── libstm32f4.a
│   ├── Makefile
│   ├── src
│   └── startup_stm32f4xx.s
├── list.txt
├── Makefile
├── src
│   ├── main.c
│   └── system_stm32f4xx.c
└── stm32_flash.ld

Another question is about a warning that occurs when I try to include the CMIS library (Math DSP libraries).
When I've included the library (for example arm_abs) in the structure compiled by the Makefile the compiler returns:
arm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=soft -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -Iinc/private -c -o arm_abs_f32.o src/core/BasicMathFunctions/arm_abs_f32.c
In file included from src/core/BasicMathFunctions/arm_abs_f32.c:36:0:
inc/core/arm_math.h: In function 'arm_pid_q15':
inc/core/arm_math.h:5316:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

For your considerations I attach the makefile included in the compilation of libraries (not the main makefile)... the file include the last line (of SRC section) in which I pass the argument "arm_abs_f32.c" (but the problem extist also with other DSP libraries)...
Another thing that I did is that I had to define a constant in a main.c in which I declare :
#define ARM_MATH_CM4.
If not the building compilation break because it don't find ARMCM4.h (and I have not).

Anyone know how to fix these problems??

Thank you for your attention & your time.