Page 1 of 1

Compiling MicroPython on STM32 specifying build variants?

Posted: Tue Aug 28, 2018 7:09 pm
by PhilG1300
Hi,
I am new to locally compiling MicroPython for a NUCLEO_F411RE board.
I am successfully compiling on a Linux box and programming my board.
My question is how do I specify the build variants for compiling 'standard' or 'double FP' ?
Regards
Phil

Re: Compiling MicroPython on STM32 specifying build variants?

Posted: Tue Aug 28, 2018 7:34 pm
by jickster
PhilG1300 wrote:
Tue Aug 28, 2018 7:09 pm
Hi,
I am new to locally compiling MicroPython for a NUCLEO_F411RE board.
I am successfully compiling on a Linux box and programming my board.
My question is how do I specify the build variants for compiling 'standard' or 'double FP' ?
Regards
Phil

Are you talking about micropython support for single- or double-precision floating point
OR
whether the usage of floating-point in C-code results in software emulation vs floating point hardware?

Re: Compiling MicroPython on STM32 specifying build variants?

Posted: Tue Aug 28, 2018 8:37 pm
by PhilG1300
I’m talking about MicroPython compiling the standard or double precision versions.
These variants are given on the firmware website as precompiled files but I wish to compile them myself.

Re: Compiling MicroPython on STM32 specifying build variants?

Posted: Tue Aug 28, 2018 9:29 pm
by jickster
PhilG1300 wrote:
Tue Aug 28, 2018 8:37 pm
I’m talking about MicroPython compiling the standard or double precision versions.
These variants are given on the firmware website as precompiled files but I wish to compile them myself.
The macro to config is

Code: Select all

#define MICROPY_FLOAT_IMPL
and you set it to one of

Code: Select all

// Float and complex implementation
#define MICROPY_FLOAT_IMPL_NONE (0)
#define MICROPY_FLOAT_IMPL_FLOAT (1)
#define MICROPY_FLOAT_IMPL_DOUBLE (2)
If mpconfigport.h exists, do it inside that file.
Otherwise, you can do it in mpconfig.h