Flashing MicroPython on to Nucleo-F401RE board using ST-Link

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.
Post Reply
sadashivakamath
Posts: 1
Joined: Tue Dec 01, 2020 4:41 pm

Flashing MicroPython on to Nucleo-F401RE board using ST-Link

Post by sadashivakamath » Tue Dec 01, 2020 5:28 pm

Hi,

I'm new to MicroPython.

I have flashed MicroPython on to Nucleo-F401RE board using ST-Link using ELF file which was available from below forum page.
MicroPython is working now in Nucleo-F401RE board.

viewtopic.php?t=3709

2 questions -
1) What is the best way to convert Nucleo-F401RE board's latest .dfu file into .bin/.out/.hex/.elf?
2) ST-Link is not working Nucleo-F401RE now. How to revert back to original Nucleo-F401RE firmware?

Maray97
Posts: 2
Joined: Tue Dec 15, 2020 3:38 pm

Re: Flashing MicroPython on to Nucleo-F401RE board using ST-Link

Post by Maray97 » Tue Dec 15, 2020 3:44 pm

For the second question just do

Code: Select all

st-flash erase
on your terminal

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

Re: Flashing MicroPython on to Nucleo-F401RE board using ST-Link

Post by dhylands » Tue Dec 15, 2020 4:12 pm

You can use the dfu.py tool (found in the micropython/tools directory) to convert a .dfu file into 2 .bin files:

Code: Select all

$ ./tools/dfu.py --dump firmware.dfu 
File: "firmware.dfu"
DfuSe v1, image size: 299941, targets: 1
Target 0, alt setting: 0, name: "ST...", size: 299656, elements: 2
  0, address: 0x08000000, size: 14800
    DUMPED IMAGE TO "firmware.dfu.target0.image0.bin"
  1, address: 0x08020000, size: 284840
    DUMPED IMAGE TO "firmware.dfu.target0.image1.bin"
usb: 0483:df11, device: 0x0000, dfu: 0x011a, UFD, 16, 0x8d9c418b
You can then use st-flash to flash each .bin file:

Code: Select all

st-flash write firmware.dfu.target0.image0.bin 0x08000000
st-flash write firmware.dfu.target0.image1.bin 0x08020000

Post Reply