[STM32F103] - Porting MicroPython to the "BluePill" board

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: [STM32F103] - Porting MicroPython to the "BluePill" board

Post by dhylands » Tue Sep 15, 2020 2:49 pm

The readme says
Use stm32loader.py using the UART bootloader to flash usbdfu.bin
.

As simple as what you want, even the minimal micropython is around 70K IIRC

bellad
Posts: 96
Joined: Tue May 14, 2019 1:47 pm

Re: [STM32F103] - Porting MicroPython to the "BluePill" board

Post by bellad » Tue Sep 15, 2020 2:57 pm

ok thank you,
according to you , what program can I use
i see basic https://github.com/Miskatino/miskatino-basic
What do you think ?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: [STM32F103] - Porting MicroPython to the "BluePill" board

Post by dhylands » Tue Sep 15, 2020 4:27 pm

It looks like the the basic that you linked is supported on the BluePill. I've never used it before, so I can't really comment on it.

gabonator
Posts: 1
Joined: Sun Mar 21, 2021 11:12 am

Re: [STM32F103] - Porting MicroPython to the "BluePill" board

Post by gabonator » Sun Mar 21, 2021 11:32 am

Hello guys,

I was trying to strip down the micropython to run on LA104 (based on STM32F103) and by little tweaking I was able to reduce size to 58700 bytes without startup code. And this nicely meets the requirement for 64KB build for blue pill.
There are some limitations though: I had to remove repl interface, floating point and compilation support. Lot of size can be saved by replacing the assert function to remove the string description of asserted condition from binary.

https://github.com/gabonator/LA104/tree ... icropython

What it does is just executing precompiled python binaries from local storage.

Later I realized that the cpu I was using (STM32F103VCT6) has 256KB flash, so I switched to circuitpython and the binary size including REPL and floating point and compilation support is twice as big - 128000 bytes:

https://github.com/gabonator/LA104/tree ... cuitpython

Gabriel

Post Reply