0

I am trying to use Python on the STM32 micro controller family and am using the STM32F4 Discovery board with the STM32F429 MCU for experimentation.

The MicroPython Github ReadMe has a walk through for the STMs but I keep failing at the deployment step where it keeps raising the value error 'No DFU device found'. (This happens on Manjaro inside Virtualbox on a Windows host)

Now I've tried simply getting the board recognized as DFU device on both Linux and the Windows host machine, to no avail. Windows does show the board in the hardware manager, but it always shows it as "STM32 STLink". It also is not recognized by the file system as mass storage, as opposed to a STM32F103 Nucleo-64 board that I've also tried, which was (on both Windows and Linux). Then again, the F103 Nucleo does also not get recognized as DFU device (although I may not have had the proper boot pin up/down pulling with that one).

I tried following an official tutorial using DfuSe here: https://www.youtube.com/watch?v=Kx7yWVi8kbU However at around 3:45 when the device gets recognized as "STM Device in DFU mode", it doesn't for me. And it doesn't show any "Available DFU Devices" in the respective drop down in DfuSe. I tried looking for a driver called "STM Device in DFU mode", but came across nothing official or hope-inspiring.

My setup:

  • the boot0 pin is pulled up by bridging it with VDD
  • connect the STLink part of the board (CN1) to the PC via mini-USB-to-USB cable
  • the jumpers at CN4 are both connected
  • the jumper at Idd (JP3) is connected
  • Windows 10 Pro (and Manjaro on a Virtualbox VM)

what I've tried so far:

  • installing DfuSe
  • installing the DfuSe drivers that come shipped with it manually
  • downloading and installing USB drivers from the official STMicroelectronics webpage
  • using dfu-util on linux
  • installing the Virtual COM Port driver from the ST webpage
  • installing the ST-Link Utility

The only success at all that I had so far was getting STLink Utility to recognize the board and being able to upload .hex files with it. Sadly that doesn't really help me in respect to MicroPython.

So my real question would be how to get MicroPython onto the STM32F4, the important question would probably be how to get the board recognized as DFU device.

mkirche
  • 11
  • 1
  • 2
  • You cant use the built in bootloader via the st-link :). You need the usb connections to the target uC, so connecting the ST-Link to the PC is pointless. Use (if populated the one on the other side of the board). If it is the one used by the internal bootloader it will work then. – 0___________ May 22 '18 at 08:12
  • @PeterJ_01 You mean I should connect the board to my computer via the "USB USER" port (CN6)? Can I still power it through the other usb port or do I need to get a 5V source and connect that to the respective pin? – mkirche May 22 '18 at 12:02
  • Of course you need to connect there. What did take you to the another conclusion. You can power it thorough the St-Link - but it is only safe if the computers connected are powered from the same mains. – 0___________ May 22 '18 at 12:06
  • Well considering I'm completely new to embedded programming (only worked with RPi's before) and that I didn't find a decent step by step tutorial for dummies, I was basically guessing... If you have any more resources for me I'd appreciate it. Always trying to learn! Thanks for your help so far – mkirche May 23 '18 at 13:53
  • Also I have tried it with the USER USB and sadly my computer does not recognize the board. Any other ideas? the jumpers are just the way they are in the ST youtube vid. But there it's a different board so maybe that's the problem? – mkirche May 23 '18 at 14:10

2 Answers2

0

assuming you have already built the micropython firmare for the STM32F4DISCOVERY you can use st-util and gdb to load the firmware.

terminal 1:
st-util

terminal2:
$gdb firmware.elf
(gdb) target extended localhost:4242
(gdb) load
Vega
  • 27,856
  • 27
  • 95
  • 103
Andrew
  • 1
0

It's better to ask these question here https://forum.micropython.org

STM32F429's USB connections are not exposed to the ST-LINK V2 connector. Hence in case, you need to do a DFU, use the following connections with the help of this connector https://robu.in/product/micro-usb-turn-dip2-54-mm-upright-mother-5p-type-b-mike-patch-straight-plug-adapter-plate-welding-head/

I tried this on NUCLEO-F401RE which also didn't have DFU exposed on to STLINK-V2 header.

`Connections :

USB Connector Discovery Kit

D+ ------> PA12
D- ------> PA11

GND ------> GND

Now you should be able to do a DFU successfully!`

RLN
  • 48
  • 6