Pre-Order Kelboy 2.0 Kit

Ayuda al proyecto y aprovéchate temporalmente del código de descuento GBZEROKELBOY del 10% en pre-orders
kelboy research

Install micropython on STM32F4XX cards

Once you want to get down to it, you have the real dilemma:

What language to choose if I don't want to use the typical Arduino? Can I program in a high-level, interpreted agile language?

The answer is yes, and a good option to answer these questions is to use Python as a programming language.

Agile scheduling of small projects in which we do not want to invest too much capital can sometimes be a bit cumbersome.

The development of this type of small programs with frameworks such as Arduino is common, which is a great framework, but in relative cases it does not give us the agility we are looking for since you may not want to adapt your programs and open a development IDE to In this case, agilely program something fast on a STM32F4XX controller that you had lying around and that you have not given any use, but that in its day you were attracted by its specifications:

MicroPython

Image

Once you want to get down to it, you have the real dilemma:

What language to choose if I don't want to use the typical Arduino? Can I program in a high-level, interpreted agile language?

The answer is yes, and a good option to answer these questions is to use Python as a programming language.


Image

Thanks to a firmware called MicroPython we can use our controller live to test and program whatever we want in our favorite language.

Advance
2

Materials

Material's description


Ok, you have convinced me, how do I install it?

First you must compile it, since there is no official release support for this type of controllers. So you have to proceed with great care.


Build

Resources

The resources that we must download to our computer are:

Let's start

First of all you must clone the micropython repository indicated above. Once you finish you must enter ports / stm32 and clone the second indicated repository.

To have all this prepared you must first compile the necessary tools included in micropython. In the main folder there is a tool called mpy-cross, first of all make a make of this tool and wait for it to finish.

Image

Once finished we go to the path "ports / stm32" and we can proceed to compile it, for this:

make BOARD=MCUDEV_DEVEBOX_F407VGT6

Image

Image


Install the firmware

Once it is finished we can deploy our firmware, for this MicroPython brings a DFU tool called pydfu that will be invoked from we find:

make BOARD=MCUDEV_DEVEBOX_F407VGT6 deploy

Para que todo funcione la tarjeta debe de estar en modo DFU, así que hay que unir las pistas BT0 con 3.3v y conectar el usb antes de invocarlo, si no se hace arrancará el firmware que tenga instalado por defecto y veremos:

Image

Debemos de ver una pantalla tal que así:

Image

Comprobación (lsusb) de que está todo correcto:

Image

Una vez terminado, comprobaremos que todo está subido correctamente accediento a través del usb por serial a nuestra consola de MicroPython:

Image