New compile bug?

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
User avatar
Korken
Posts: 270
Joined: Wed Apr 02, 2014 4:09 pm
Has thanked: 5 times
Been thanked: 6 times

New compile bug?

Post 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
User avatar
Korken
Posts: 270
Joined: Wed Apr 02, 2014 4:09 pm
Has thanked: 5 times
Been thanked: 6 times

Re: New compile bug?

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: New compile bug?

Post by Giovanni »

Yes, some 2.6 code slipped there, I will fix it ASAP.

Giovanni
User avatar
Korken
Posts: 270
Joined: Wed Apr 02, 2014 4:09 pm
Has thanked: 5 times
Been thanked: 6 times

Re: New compile bug?

Post by Korken »

Awesome! Thanks Giovanni!

Best Regards
Emil Fresk
User avatar
Korken
Posts: 270
Joined: Wed Apr 02, 2014 4:09 pm
Has thanked: 5 times
Been thanked: 6 times

Re: New compile bug?

Post 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
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: New compile bug?

Post by Giovanni »

You are not considering the "AP" part of ASAP.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: New compile bug?

Post by Giovanni »

Fixed but not tested yet.

Giovanni
User avatar
Korken
Posts: 270
Joined: Wed Apr 02, 2014 4:09 pm
Has thanked: 5 times
Been thanked: 6 times

Re: New compile bug?

Post by Korken »

It compiles at least :)
Thanks Giovanni!
Post Reply