Compiling MicroPython on STM32 specifying build variants?

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
PhilG1300
Posts: 5
Joined: Tue Aug 30, 2016 7:15 pm

Compiling MicroPython on STM32 specifying build variants?

Post by PhilG1300 » 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

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: Compiling MicroPython on STM32 specifying build variants?

Post by jickster » Tue Aug 28, 2018 7:34 pm

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?

PhilG1300
Posts: 5
Joined: Tue Aug 30, 2016 7:15 pm

Re: Compiling MicroPython on STM32 specifying build variants?

Post by PhilG1300 » 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.

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: Compiling MicroPython on STM32 specifying build variants?

Post by jickster » Tue Aug 28, 2018 9:29 pm

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

Post Reply