cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 CubeMX FreeRTOS issue

Hans Jonker
Associate III
Posted on April 22, 2016 at 09:40

Anybody,

I have an issue on the next combination:

32L476..

CubeMX (4.14.0, package repo updated as of today (april 22))

FreeRTOS

I have set cube to generate code for 'Other toolchains'. This gives me 3 flavours of RTOS implementation (GCC/IAR/RVDS).

Each of these flavours include a map ARM_CM4F (NOTE: F, not L...)

These maps each contain the files port.c and portmacro.h.  The IAR flavour also contains portasm.s

I am using GCC, but this comes up with an error stating the assembly instructions vstmdbeq and vldmiaeq cannot be used in THUMB mode, + some instructions are not allowed in IT block.

I checked  each of the other flavours manually, and each of them at least contain the assembly instructions mentioned before.

Since The L4 does not support ARM mode, this is a bit of an issue.

The function involved is ''xPortPendSVHandler'' but I have not checked all files (the make util aborts on this issue)

Anybody for a solution??

Thanks in advance

Kind regards,

    Hans Jonker
6 REPLIES 6
Walid FTITI_O
Senior II
Posted on April 22, 2016 at 10:47

Hi jonker.hans,

Thanks for the feedbacks. I will report this to our CubeMx team for check and come back to you.

-Hannibal-

carmine
Associate II
Posted on April 22, 2016 at 16:34

The 'F' inside the ARM_CM4F has nothing related to the STM32F MCUs. Cortex-M4F are those Cortex-M4 cores providing an FPU. And the STM32L4 is a Cortex-M4F based MCU. So you need to use the ARM_CM4F port of FreeRTOS, which provides the context switch routine able to save FPU registers.

The error you are receiving (I suppose) is related to the fact you need to enable the FPU support in GCC, by passing the parameter -ffpv4-sp-d16.

Hans Jonker
Associate III
Posted on April 25, 2016 at 07:39

First of all, thanks for the respons.

The error I'm getting says:

''Error: selected processor does not support `vstmdbeq r0!,{s16-s31}' in Thumb mode''

To me, this does not seem to relate to floating point, if it does the error respons could be improved...

With the fact that the 32L4 does not support arm mode, (read only supports thumb mode), to me this is not an easy one to fix.

I tried your option which gives the next errror:

''error: unrecognized command line option '-ffpv4-sp-d16'''

carmine
Associate II
Posted on April 25, 2016 at 08:55

The exact options to pass to GCC are the following ones:

-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16

However, it could be that your toolchain uses different options (even if this is uncommon).

Best regards

carmine
Associate II
Posted on April 25, 2016 at 08:56

I forget to mention that you HAVE to recompile the WHOLE source tree, after you have enabled that command line options.

Hans Jonker
Associate III
Posted on April 25, 2016 at 10:47

Thanks, that helped..

I have to say that the compiler error realy puts you in the wrong direction...

It is complaining about instructions not supported in  thumb mode, where it actually is instructions supported by the FPunit...

Thanks again..