You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Damien George 4ec803a42a all: Make static dicts use mp_rom_map_elem_t type and MP_ROM_xxx macros. 6 years ago
Makefile all: Make use of $(TOP) variable in Makefiles, instead of "..". 6 years ago minimal: Add ability and description to build without the compiler. 6 years ago
frozentest.mpy py: Add LOAD_SUPER_METHOD bytecode to allow heap-free super meth calls. 6 years ago minimal: Add example of frozen persistent bytecode (.mpy file). 7 years ago
main.c esp8266,minimal,pic16bit: Use size_t for mp_builtin_open argument. 6 years ago
mpconfigport.h all: Make static dicts use mp_rom_map_elem_t type and MP_ROM_xxx macros. 6 years ago
mphalport.h all: Add py/mphal.h and use it in all ports. 7 years ago
qstrdefsport.h minimal: New port, intended to represent minimal working code. 8 years ago
stm32f405.ld all: Remove trailing spaces, per coding conventions. 6 years ago
uart_core.c minimal: Add enough code to run minimal build on STM32F4xx hardware. 7 years ago

The minimal port

This port is intended to be a minimal MicroPython port that actually runs. It can run under Linux (or similar) and on any STM32F4xx MCU (eg the pyboard).

Building and running Linux version

By default the port will be built for the host machine:

$ make

To run a small test script do:

$ make run

Building for an STM32 MCU

The Makefile has the ability to build for a Cortex-M CPU, and by default includes some start-up code for an STM32F4xx MCU and also enables a UART for communication. To build:

$ make CROSS=1

If you previously built the Linux version, you will need to first run make clean to get rid of incompatible object files.

Building will produce the build/firmware.dfu file which can be programmed to an MCU using:

$ make CROSS=1 deploy

This version of the build will work out-of-the-box on a pyboard (and anything similar), and will give you a MicroPython REPL on UART1 at 9600 baud. Pin PA13 will also be driven high, and this turns on the red LED on the pyboard.

Building without the built-in MicroPython compiler

This minimal port can be built with the built-in MicroPython compiler disabled. This will reduce the firmware by about 20k on a Thumb2 machine, and by about 40k on 32-bit x86. Without the compiler the REPL will be disabled, but pre-compiled scripts can still be executed.

To test out this feature, change the MICROPY_ENABLE_COMPILER config option to "0" in the mpconfigport.h file in this directory. Then recompile and run the firmware and it will execute the file.