Page 1 of 1
2.6.0 & FPU
Posted: Sat Jun 15, 2013 8:12 am
by russian
I am migrating my project from 2.4.3 to 2.6.0 and it dies on startup, while printing the first line of the console greeting.
I was able to isolate the problem to CORTEX_USE_FPU in chconf.h - everything works without FPU option (#define CORTEX_USE_FPU FALSE) but breaks when I change this to TRUE. I am using stm32f4 discovery, optimization none -O0 and "-mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant" - these flags used to work for me with 2.4.3
Please advice
Re: 2.6.0 & FPU
Posted: Sat Jun 15, 2013 8:42 am
by Tectu
I don't know about the FPU thing but lately there were some issues with the -O0 thing. Since you posted on the ChibiOS/GFX sub forum, I assume that you're using that as well, right? Can you please try to compile the application with -O2? The talk is going on
here.
~ Tectu
Re: 2.6.0 & FPU
Posted: Sat Jun 15, 2013 8:54 am
by russian
I am reproducing this with my "hello Chibi" application - so, no GFX here, just a shell. Anyway, I have recompiled it with -O2 but it did not help

Re: 2.6.0 & FPU
Posted: Sat Jun 15, 2013 9:28 am
by Giovanni
Could you try one of the standard demos and see if it fails for you when enabling the FPU? this would allow me to test this on my side.
Giovanni
Re: 2.6.0 & FPU
Posted: Sat Jun 15, 2013 4:58 pm
by russian
Standard demo compiled with standard Makefile (with the addition of 'USE_FPU = yes') does work.
I have adjusted the Makefile to compile my project and it also works fine now with FPU. Historically I was always using Eclipse to compile my stuff, I will now try to figure out how to bring Eclipse compiler/linker preferences in sync with the Makefile and report which option was causing the issue.
PS: there is a typo in the makefile:
# Enable this if you really want to use the STM FWLib.
ifeq ($(USE_FPU),)
USE_FPU = no
endif
Re: 2.6.0 & FPU
Posted: Sat Jun 15, 2013 5:55 pm
by Giovanni
I am glad you resolved the problem and thanks for finding the typo.
Giovanni
Re: 2.6.0 & FPU
Posted: Sat Jun 15, 2013 8:18 pm
by russian
In order to fix Eclipse compilation, I had to explicitly define a global symbol "-DCORTEX_USE_FPU=TRUE" - the '#define CORTEX_USE_FPU TRUE' line in chconf.h without the global symbol was causing the issue.
I believe this was not the case with 2.4.3.
Is it expected behavior that this setting is expected to be defined as a global symbol and not just as a line in the chconf.h now?
Re: 2.6.0 & FPU
Posted: Sat Jun 15, 2013 8:32 pm
by Giovanni
It should work even in chconf.h if accompanied by the proper compiler options, CORTEX_USE_FPU is not sufficient.
Giovanni
Re: 2.6.0 & FPU
Posted: Sat Jun 15, 2013 8:41 pm
by russian
Giovanni wrote:It should work even in chconf.h if accompanied by the proper compiler options, CORTEX_USE_FPU is not sufficient.
Giovanni
I am not sure what you are saying

Here are my results (all other options are the same across all configurations)
2.4.3: works with only "#define CORTEX_USE_FPU TRUE" without "-DCORTEX_USE_FPU=TRUE"
2.6.0: unhandedException indefinite loop in case of "#define CORTEX_USE_FPU TRUE" without "-DCORTEX_USE_FPU=TRUE" (change in behavior comparing to 2.4.3)
2.6.0: works with "#define CORTEX_USE_FPU TRUE" AND "-DCORTEX_USE_FPU=TRUE"