Build upython on stm32cube ide?

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
miltmobley
Posts: 29
Joined: Mon Mar 07, 2016 11:44 pm

Build upython on stm32cube ide?

Post by miltmobley » Sun Jul 26, 2020 2:36 am

1. Can micropython and its firmwares be built on STM32Cube IDE using an STM32F405xx (pyboard) processor configuration?
2. Is source available for the threading firmware?
3. In general, how does your firmware differ from the standard stm32 firmware provided by STM32Cube?

User avatar
jimmo
Posts: 2065
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Build upython on stm32cube ide?

Post by jimmo » Mon Jul 27, 2020 3:22 am

miltmobley wrote:
Sun Jul 26, 2020 2:36 am
1. Can micropython and its firmwares be built on STM32Cube IDE using an STM32F405xx (pyboard) processor configuration?
If you can make the IDE run a Makefile, yes. What I'd recommend is following the steps to build the firmware outside the IDE (see https://github.com/micropython/micropyt ... /README.md) and then once that's working you can invoke it from the IDE.

If you want to build the pyboard firmware exactly, then

Code: Select all

make BOARD=PYBV11
otherwise you can copy the ports/stm32/boards/PYBV11 directory, modify whatever you need (e.g. pin assignments) and build that instead

Code: Select all

make BOARD=MYBOARD BOARD_DIR=path/to/MYBOARD
miltmobley wrote:
Sun Jul 26, 2020 2:36 am
2. Is source available for the threading firmware?
It's the same source, just built with a different option.

You can either do this by adding

Code: Select all

#define MICROPY_PY_THREAD (1)
to your mpconfigboard.h

or by adding

Code: Select all

make BOARD= .... CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'
to the make command line.
miltmobley wrote:
Sun Jul 26, 2020 2:36 am
3. In general, how does your firmware differ from the standard stm32 firmware provided by STM32Cube?
Can you explain what you mean by "standard stm32 firmware provided by STM32Cube?"

miltmobley
Posts: 29
Joined: Mon Mar 07, 2016 11:44 pm

Re: Build upython on stm32cube ide?

Post by miltmobley » Thu Jul 30, 2020 2:01 am

I meant the stm32 hal library layer, which I assumed micropython would have some variant of. But after some investigation,
it seems the micropython libs are accessing the hardware directly and not calling through a hal layer.
Thanks for your other answers.

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

Re: Build upython on stm32cube ide?

Post by dhylands » Thu Jul 30, 2020 7:33 pm

Some of the peripherals are accessed through the HAL layer, and some are accessed directly.

Post Reply