STM32F429-Disc

Hi everyone
Tryin’ to figure out how to load MicroPython on STM32F… board
I can use some help
Please advise

Hi @Jimphelps678,

According to MicroPython’s website, this build should work:

https://micropython.org/resources/firmware/STM32F429DISC-20200902-v1.13.dfu

What’s your board doing when you try to install that *.dfu file?

Regards,

I gave it a few shot but when I click on “choose” in the dfu demo; I don’t know which file should I browse?

Looking more into it, the F429 Disco can’t be flashed with dfu: (due to design of the USB ports)

You need to build the firmware.bin and copy that over:

Regards,

I watched this video on YouTube that gave me the idea of how to do it and I followed that up
Let me send you the link to that and perhaps you figure out and let me know
Just google stm32 MicroPython YouTube
Appreciate it

Thanks Robert,
Could you walk me through building the firmware and how to copy that and how to load it on board
Appreciate it
Jim

HI @Jimphelps678, just to clarify, which board do you have exactly? As the directions are for specific boards…

For example: THe STM32F429-DISC1: https://www.st.com/en/evaluation-tools/32f429idiscovery.html#overview

What OS are you building with Ubuntu/Debian/WIndows/Mac??

So for Debian:

git clone https://github.com/micropython/micropython.git
cd ./micropython/mpy-cross
make
cd ../ports/stm32/
make BOARD=STM32F429DISC

If you have a DISC1, you can also issue:

arm-none-eabi-objcopy -O binary build-STM32F429DISC/firmware.elf build-STM32F429DISC/firmware.bin

And then copy the firmware.bin with the STLinkV2 mass storage device when you plug it into a development machine…

mpy-cross build would look like:

voodoo@hestia:~/micropython/mpy-cross$ make
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build/genhdr
GEN build/genhdr/mpversion.h
GEN build/genhdr/moduledefs.h
GEN build/genhdr/qstr.i.last
GEN build/genhdr/qstr.split
GEN build/genhdr/qstrdefs.collected.h
QSTR updated
GEN build/genhdr/qstrdefs.generated.h
mkdir -p build/lib/utils/
mkdir -p build/py/
CC ../py/mpstate.c
CC ../py/nlr.c
CC ../py/nlrx86.c
CC ../py/nlrx64.c
CC ../py/nlrthumb.c
CC ../py/nlrpowerpc.c
CC ../py/nlrxtensa.c
CC ../py/nlrsetjmp.c
CC ../py/malloc.c
CC ../py/gc.c
CC ../py/pystack.c
CC ../py/qstr.c
CC ../py/vstr.c
CC ../py/mpprint.c
CC ../py/unicode.c
CC ../py/mpz.c
CC ../py/reader.c
CC ../py/lexer.c
CC ../py/parse.c
CC ../py/scope.c
CC ../py/compile.c
CC ../py/emitcommon.c
CC ../py/emitbc.c
CC ../py/asmbase.c
CC ../py/asmx64.c
CC ../py/emitnx64.c
CC ../py/asmx86.c
CC ../py/emitnx86.c
CC ../py/asmthumb.c
CC ../py/emitnthumb.c
CC ../py/emitinlinethumb.c
CC ../py/asmarm.c
CC ../py/emitnarm.c
CC ../py/asmxtensa.c
CC ../py/emitnxtensa.c
CC ../py/emitinlinextensa.c
CC ../py/emitnxtensawin.c
CC ../py/formatfloat.c
CC ../py/parsenumbase.c
CC ../py/parsenum.c
CC ../py/emitglue.c
CC ../py/persistentcode.c
CC ../py/runtime.c
CC ../py/runtime_utils.c
CC ../py/scheduler.c
CC ../py/nativeglue.c
CC ../py/pairheap.c
CC ../py/ringbuf.c
CC ../py/stackctrl.c
CC ../py/argcheck.c
CC ../py/warning.c
CC ../py/profile.c
CC ../py/map.c
CC ../py/obj.c
CC ../py/objarray.c
CC ../py/objattrtuple.c
CC ../py/objbool.c
CC ../py/objboundmeth.c
CC ../py/objcell.c
CC ../py/objclosure.c
CC ../py/objcomplex.c
CC ../py/objdeque.c
CC ../py/objdict.c
CC ../py/objenumerate.c
CC ../py/objexcept.c
CC ../py/objfilter.c
CC ../py/objfloat.c
CC ../py/objfun.c
CC ../py/objgenerator.c
CC ../py/objgetitemiter.c
CC ../py/objint.c
CC ../py/objint_longlong.c
CC ../py/objint_mpz.c
CC ../py/objlist.c
CC ../py/objmap.c
CC ../py/objmodule.c
CC ../py/objobject.c
CC ../py/objpolyiter.c
CC ../py/objproperty.c
CC ../py/objnone.c
CC ../py/objnamedtuple.c
CC ../py/objrange.c
CC ../py/objreversed.c
CC ../py/objset.c
CC ../py/objsingleton.c
CC ../py/objslice.c
CC ../py/objstr.c
CC ../py/objstrunicode.c
CC ../py/objstringio.c
CC ../py/objtuple.c
CC ../py/objtype.c
CC ../py/objzip.c
CC ../py/opmethods.c
CC ../py/sequence.c
CC ../py/stream.c
CC ../py/binary.c
CC ../py/builtinimport.c
CC ../py/builtinevex.c
CC ../py/builtinhelp.c
CC ../py/modarray.c
CC ../py/modbuiltins.c
CC ../py/modcollections.c
CC ../py/modgc.c
CC ../py/modio.c
CC ../py/modmath.c
CC ../py/modcmath.c
CC ../py/modmicropython.c
CC ../py/modstruct.c
CC ../py/modsys.c
CC ../py/moduerrno.c
CC ../py/modthread.c
CC ../py/vm.c
CC ../py/bc.c
CC ../py/showbc.c
CC ../py/repl.c
CC ../py/smallint.c
CC ../py/frozenmod.c
CC main.c
CC gccollect.c
CC ../lib/utils/gchelper_generic.c
LINK mpy-cross
   text	   data	    bss	    dec	    hex	filename
 287945	  17136	    904	 305985	  4ab41	mpy-cross

and the final build would look like:

voodoo@hestia:~/micropython/ports/stm32$ make BOARD=STM32F429DISC
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build-STM32F429DISC/genhdr
GEN build-STM32F429DISC/genhdr/pins.h
GEN stmconst build-STM32F429DISC/modstm_qstr.h
GEN build-STM32F429DISC/genhdr/mpversion.h
GEN build-STM32F429DISC/genhdr/moduledefs.h
GEN build-STM32F429DISC/genhdr/pybcdc.inf
GEN build-STM32F429DISC/genhdr/pybcdc_inf.h
GEN build-STM32F429DISC/genhdr/pllfreqtable.h
GEN build-STM32F429DISC/genhdr/qstr.i.last
GEN build-STM32F429DISC/genhdr/qstr.split
GEN build-STM32F429DISC/genhdr/qstrdefs.collected.h
QSTR updated
GEN build-STM32F429DISC/genhdr/qstrdefs.generated.h
GEN build-STM32F429DISC/genhdr/compressed.split
GEN build-STM32F429DISC/genhdr/compressed.collected
Compressed data updated
GEN build-STM32F429DISC/genhdr/compressed.data.h
mkdir -p build-STM32F429DISC/build-STM32F429DISC/
mkdir -p build-STM32F429DISC/drivers/bus/
mkdir -p build-STM32F429DISC/drivers/dht/
mkdir -p build-STM32F429DISC/drivers/memory/
mkdir -p build-STM32F429DISC/extmod/
mkdir -p build-STM32F429DISC/lib/embed/
mkdir -p build-STM32F429DISC/lib/libc/
mkdir -p build-STM32F429DISC/lib/libm/
mkdir -p build-STM32F429DISC/lib/mp-readline/
mkdir -p build-STM32F429DISC/lib/netutils/
mkdir -p build-STM32F429DISC/lib/oofatfs/
mkdir -p build-STM32F429DISC/lib/stm32lib/CMSIS/STM32F4xx/Source/Templates/
mkdir -p build-STM32F429DISC/lib/stm32lib/CMSIS/STM32F4xx/Source/Templates/gcc/
mkdir -p build-STM32F429DISC/lib/stm32lib/STM32F4xx_HAL_Driver/Src/
mkdir -p build-STM32F429DISC/lib/timeutils/
mkdir -p build-STM32F429DISC/lib/utils/
mkdir -p build-STM32F429DISC/py/
mkdir -p build-STM32F429DISC/usbdev/class/src/
mkdir -p build-STM32F429DISC/usbdev/core/src/
CC ../../py/mpstate.c
CC ../../py/nlr.c
CC ../../py/nlrx86.c
CC ../../py/nlrx64.c
CC ../../py/nlrthumb.c
CC ../../py/nlrpowerpc.c
CC ../../py/nlrxtensa.c
CC ../../py/nlrsetjmp.c
CC ../../py/malloc.c
CC ../../py/gc.c
CC ../../py/pystack.c
CC ../../py/qstr.c
CC ../../py/vstr.c
CC ../../py/mpprint.c
CC ../../py/unicode.c
CC ../../py/mpz.c
CC ../../py/reader.c
CC ../../py/lexer.c
CC ../../py/parse.c
CC ../../py/scope.c
CC ../../py/compile.c
CC ../../py/emitcommon.c
CC ../../py/emitbc.c
CC ../../py/asmbase.c
CC ../../py/asmx64.c
CC ../../py/emitnx64.c
CC ../../py/asmx86.c
CC ../../py/emitnx86.c
CC ../../py/asmthumb.c
CC ../../py/emitnthumb.c
CC ../../py/emitinlinethumb.c
CC ../../py/asmarm.c
CC ../../py/emitnarm.c
CC ../../py/asmxtensa.c
CC ../../py/emitnxtensa.c
CC ../../py/emitinlinextensa.c
CC ../../py/emitnxtensawin.c
CC ../../py/formatfloat.c
CC ../../py/parsenumbase.c
CC ../../py/parsenum.c
CC ../../py/emitglue.c
CC ../../py/persistentcode.c
CC ../../py/runtime.c
CC ../../py/runtime_utils.c
CC ../../py/scheduler.c
CC ../../py/nativeglue.c
CC ../../py/pairheap.c
CC ../../py/ringbuf.c
CC ../../py/stackctrl.c
CC ../../py/argcheck.c
CC ../../py/warning.c
CC ../../py/profile.c
CC ../../py/map.c
CC ../../py/obj.c
CC ../../py/objarray.c
CC ../../py/objattrtuple.c
CC ../../py/objbool.c
CC ../../py/objboundmeth.c
CC ../../py/objcell.c
CC ../../py/objclosure.c
CC ../../py/objcomplex.c
CC ../../py/objdeque.c
CC ../../py/objdict.c
CC ../../py/objenumerate.c
CC ../../py/objexcept.c
CC ../../py/objfilter.c
CC ../../py/objfloat.c
CC ../../py/objfun.c
CC ../../py/objgenerator.c
CC ../../py/objgetitemiter.c
CC ../../py/objint.c
CC ../../py/objint_longlong.c
CC ../../py/objint_mpz.c
CC ../../py/objlist.c
CC ../../py/objmap.c
CC ../../py/objmodule.c
CC ../../py/objobject.c
CC ../../py/objpolyiter.c
CC ../../py/objproperty.c
CC ../../py/objnone.c
CC ../../py/objnamedtuple.c
CC ../../py/objrange.c
CC ../../py/objreversed.c
CC ../../py/objset.c
CC ../../py/objsingleton.c
CC ../../py/objslice.c
CC ../../py/objstr.c
CC ../../py/objstrunicode.c
CC ../../py/objstringio.c
CC ../../py/objtuple.c
CC ../../py/objtype.c
CC ../../py/objzip.c
CC ../../py/opmethods.c
CC ../../py/sequence.c
CC ../../py/stream.c
CC ../../py/binary.c
CC ../../py/builtinimport.c
CC ../../py/builtinevex.c
CC ../../py/builtinhelp.c
CC ../../py/modarray.c
CC ../../py/modbuiltins.c
CC ../../py/modcollections.c
CC ../../py/modgc.c
CC ../../py/modio.c
CC ../../py/modmath.c
CC ../../py/modcmath.c
CC ../../py/modmicropython.c
CC ../../py/modstruct.c
CC ../../py/modsys.c
CC ../../py/moduerrno.c
CC ../../py/modthread.c
CC ../../py/vm.c
CC ../../py/bc.c
CC ../../py/showbc.c
CC ../../py/repl.c
CC ../../py/smallint.c
CC ../../py/frozenmod.c
CC ../../extmod/moduasyncio.c
CC ../../extmod/moductypes.c
CC ../../extmod/modujson.c
CC ../../extmod/modure.c
CC ../../extmod/moduzlib.c
CC ../../extmod/moduheapq.c
CC ../../extmod/modutimeq.c
CC ../../extmod/moduhashlib.c
CC ../../extmod/moducryptolib.c
CC ../../extmod/modubinascii.c
CC ../../extmod/virtpin.c
CC ../../extmod/machine_mem.c
CC ../../extmod/machine_pinbase.c
CC ../../extmod/machine_signal.c
CC ../../extmod/machine_pulse.c
CC ../../extmod/machine_i2c.c
CC ../../extmod/machine_spi.c
CC ../../extmod/modbluetooth.c
CC ../../extmod/modussl_axtls.c
CC ../../extmod/modussl_mbedtls.c
CC ../../extmod/modurandom.c
CC ../../extmod/moduselect.c
CC ../../extmod/moduwebsocket.c
CC ../../extmod/modwebrepl.c
CC ../../extmod/modframebuf.c
CC ../../extmod/vfs.c
CC ../../extmod/vfs_blockdev.c
CC ../../extmod/vfs_reader.c
CC ../../extmod/vfs_posix.c
CC ../../extmod/vfs_posix_file.c
CC ../../extmod/vfs_fat.c
CC ../../extmod/vfs_fat_diskio.c
CC ../../extmod/vfs_fat_file.c
CC ../../extmod/vfs_lfs.c
CC ../../extmod/utime_mphal.c
CC ../../extmod/uos_dupterm.c
CC ../../lib/embed/abort_.c
CC ../../lib/utils/printf.c
MPY uasyncio/__init__.py
MPY uasyncio/core.py
MPY uasyncio/event.py
MPY uasyncio/funcs.py
MPY uasyncio/lock.py
MPY uasyncio/stream.py
MPY dht.py
MPY lcd160cr.py
MPY lcd160cr_test.py
MPY onewire.py
GEN build-STM32F429DISC/frozen_content.c
CC build-STM32F429DISC/frozen_content.c
CC ../../lib/libc/string0.c
CC ../../lib/mp-readline/readline.c
CC ../../lib/netutils/netutils.c
CC ../../lib/netutils/trace.c
CC ../../lib/netutils/dhcpserver.c
CC ../../lib/timeutils/timeutils.c
CC ../../lib/utils/gchelper_native.c
CC ../../lib/utils/pyexec.c
CC ../../lib/utils/interrupt_char.c
CC ../../lib/utils/sys_stdio_mphal.c
CC ../../lib/utils/mpirq.c
CC ../../lib/libm/math.c
CC ../../lib/libm/acoshf.c
CC ../../lib/libm/asinfacosf.c
CC ../../lib/libm/asinhf.c
CC ../../lib/libm/atan2f.c
CC ../../lib/libm/atanf.c
CC ../../lib/libm/atanhf.c
CC ../../lib/libm/ef_rem_pio2.c
CC ../../lib/libm/erf_lgamma.c
CC ../../lib/libm/fmodf.c
CC ../../lib/libm/kf_cos.c
CC ../../lib/libm/kf_rem_pio2.c
CC ../../lib/libm/kf_sin.c
CC ../../lib/libm/kf_tan.c
CC ../../lib/libm/log1pf.c
CC ../../lib/libm/nearbyintf.c
CC ../../lib/libm/roundf.c
CC ../../lib/libm/sf_cos.c
CC ../../lib/libm/sf_erf.c
CC ../../lib/libm/sf_frexp.c
CC ../../lib/libm/sf_ldexp.c
CC ../../lib/libm/sf_modf.c
CC ../../lib/libm/sf_sin.c
CC ../../lib/libm/sf_tan.c
CC ../../lib/libm/wf_lgamma.c
CC ../../lib/libm/wf_tgamma.c
CC ../../lib/libm/thumb_vfp_sqrtf.c
CC ../../extmod/modonewire.c
CC ../../drivers/bus/softspi.c
CC ../../drivers/bus/softqspi.c
CC ../../drivers/memory/spiflash.c
CC ../../drivers/dht/dht.c
CC main.c
CC stm32_it.c
CC usbd_conf.c
CC usbd_desc.c
CC usbd_cdc_interface.c
CC usbd_hid_interface.c
CC usbd_msc_interface.c
CC mphalport.c
CC mpthreadport.c
CC irq.c
CC pendsv.c
CC systick.c
CC softtimer.c
CC powerctrl.c
CC powerctrlboot.c
CC rfcore.c
CC pybthread.c
CC factoryreset.c
CC timer.c
CC led.c
CC pin.c
CC pin_defs_stm32.c
CC pin_named_pins.c
CC bufhelper.c
CC dma.c
CC i2c.c
CC pyb_i2c.c
CC spi.c
CC pyb_spi.c
CC qspi.c
CC uart.c
CC can.c
CC fdcan.c
CC pyb_can.c
CC usb.c
CC wdt.c
CC eth.c
CC gccollect.c
CC help.c
CC machine_adc.c
CC machine_i2c.c
CC machine_spi.c
CC machine_timer.c
CC machine_uart.c
CC modmachine.c
CC modpyb.c
CC modstm.c
CC moduos.c
CC modutime.c
CC modusocket.c
CC network_lan.c
CC modnetwork.c
CC extint.c
CC usrsw.c
CC rng.c
CC rtc.c
CC flash.c
CC flashbdev.c
CC spibdev.c
CC storage.c
CC sdcard.c
CC sdram.c
CC fatfs_port.c
CC lcd.c
CC accel.c
CC servo.c
CC dac.c
CC adc.c
AS ../../lib/stm32lib/CMSIS/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s
CC ../../lib/stm32lib/CMSIS/STM32F4xx/Source/Templates/system_stm32f4xx.c
CC system_stm32.c
AS resethandler.s
AS ../../lib/utils/gchelper_m3.s
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_mmc.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sdram.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi.c
CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c
CC usbdev/core/src/usbd_core.c
CC usbdev/core/src/usbd_ctlreq.c
CC usbdev/core/src/usbd_ioreq.c
CC usbdev/class/src/usbd_cdc_msc_hid.c
CC usbdev/class/src/usbd_msc_bot.c
CC usbdev/class/src/usbd_msc_scsi.c
CC ../../lib/oofatfs/ff.c
CC ../../lib/oofatfs/ffunicode.c
CC build-STM32F429DISC/pins_STM32F429DISC.c
LINK build-STM32F429DISC/firmware.elf
   text	   data	    bss	    dec	    hex	filename
 332828	     16	  27344	 360188	  57efc	build-STM32F429DISC/firmware.elf
GEN build-STM32F429DISC/firmware.dfu
GEN build-STM32F429DISC/firmware.hex

Then:

voodoo@hestia:~/micropython/ports/stm32$ arm-none-eabi-objcopy -O binary build-STM32F429DISC/firmware.elf build-STM32F429DISC/firmware.bin
voodoo@hestia:~/micropython/ports/stm32$ ls build-STM32F429DISC/*.bin
build-STM32F429DISC/firmware0.bin  build-STM32F429DISC/firmware1.bin  build-STM32F429DISC/firmware.bin

Here is a zipped copy:

firmware.zip (215.3 KB)

Regards,