Page 1 of 1

New compile bug?

Posted: Wed Jul 02, 2014 9:15 am
by Korken
Hi,

I just synced down the latest commits to 3.0.0, and whenever I try to compile now (a completely new and clean project, including demos, with FPU enabled) I get these errors:
Compiling chcore_v7m.c
Compiling chdebug.c
../ChibiOS-RT/os/rt/ports/ARMCMx/chcore_v7m.c: In function 'SVC_Handler':
../ChibiOS-RT/os/rt/ports/ARMCMx/chcore_v7m.c:67:3: error: 'SCB_FPCCR' undeclared (first use in this function)
SCB_FPCCR &= ~FPCCR_LSPACT;
^
../ChibiOS-RT/os/rt/ports/ARMCMx/chcore_v7m.c:67:3: note: each undeclared identifier is reported only once for each function it appears in
../ChibiOS-RT/os/rt/ports/ARMCMx/chcore_v7m.c:67:17: error: 'FPCCR_LSPACT' undeclared (first use in this function)
SCB_FPCCR &= ~FPCCR_LSPACT;
^
make: *** [build/obj/chcore_v7m.o] Error 1
make: *** Waiting for unfinished jobs....

And when I search the entire repository for FPCCR_LSPACT I cannot seem to find its definition.
Is this a new compile bug or have I made an error?

It works if you disable the FPU in:

Code: Select all

ifeq ($(USE_FPU),)
  USE_FPU = softfp
endif

Edit: This is done with the STM32F4xx demos.

Best Regards
Emil

Re: New compile bug?

Posted: Wed Jul 02, 2014 12:09 pm
by Korken
I have worked more on this and Bugfix #512 is the problematic commit.
In chcore_v7m.c:

Code: Select all

#if CORTEX_USE_FPU
  /* Restoring the special register FPCCR.*/
  FPU->FPCCR = (uint32_t)ctxp->fpccr;
  FPU->FPCAR = FPU->FPCAR + sizeof (struct port_extctx);
#endif
is changed to

Code: Select all

#if CORTEX_USE_FPU
  /* Enforcing unstacking of the FP part of the context.*/
  SCB_FPCCR &= ~FPCCR_LSPACT;
#endif
which seems to be causing the problems since FPCCR_LSPACT is undefined.

Edit: Also SCB_FPCCR is only defined in crt0.c:

Code: Select all

#define SCB_FPCCR               *((uint32_t *)0xE000EF34U)
Which also causes problems.

Re: New compile bug?

Posted: Wed Jul 02, 2014 1:55 pm
by Giovanni
Yes, some 2.6 code slipped there, I will fix it ASAP.

Giovanni

Re: New compile bug?

Posted: Wed Jul 02, 2014 1:57 pm
by Korken
Awesome! Thanks Giovanni!

Best Regards
Emil Fresk

Re: New compile bug?

Posted: Thu Jul 03, 2014 9:52 am
by Korken
Hi Giovanni,
I know you said ASAP, but do you have a time frame for the fix? :) I tried going back to an old commit, but I'm not that good with Git...

//Emil

Re: New compile bug?

Posted: Thu Jul 03, 2014 10:36 am
by Giovanni
You are not considering the "AP" part of ASAP.

Giovanni

Re: New compile bug?

Posted: Thu Jul 03, 2014 12:31 pm
by Giovanni
Fixed but not tested yet.

Giovanni

Re: New compile bug?

Posted: Thu Jul 03, 2014 2:48 pm
by Korken
It compiles at least :)
Thanks Giovanni!