A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/micropython/micropython/wiki/Board-STM32F407-Discovery below:

Board STM32F407 Discovery · micropython/micropython Wiki · GitHub

Cortex M4 STM32F407VG

$(info Executing GNUmakefile)
BOARD = STM32F4DISC
$(info BOARD = $(BOARD))
include Makefile
Programming from Linux (via DFU)

This section covers how to flash the STM32F4DISCOVERY from linux (I was using Linux Mint 14, which is derived from ubuntu 12.10).

sudo apt-get install dfu-util
# f055:9800 - STM32F4 Discovery running MicroPython in USB Serial Mode (CN5)
ATTRS{idVendor}=="f055", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="f055", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="f055", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="f055", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="f055", MODE:="0666"
# 0483:df11 - STM32F4 Discovery in DFU mode (CN5)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666"

Tell udev to reload its rules:

sudo udevadm control --reload-rules

On the discovery board, BOOT1 is pulled low through SB19 and a 510 ohm resistor, and BOOT0 is pulled low through SB18 and another 510 ohm resistor. Since BOOT1 is already low, you just need to make BOOT0 high. Conveniently the BOOT0 signal is beside a VDD signal on the P2 header. So you can install a shorting jumper (there are a couple of spares included with the board on JP2 and JP3 on the bottomside of the board) between BOOT0 and VDD and press the reset button.

You should now be able to program the board using:

make BOARD=STM32F4DISC deploy

If your permissions aren't setup properly for the udev rules above, then you should be able to use

sudo make BOARD=STM32F4DISC deploy

Note: The deploy target in the makfile will wind up executing a command similar to this:

dfu-util -a 0 -d 0483:df11 -D build-STM32F4DISC/firmware.dfu

You should get output similar to this:

2196 >sudo dfu-util -a 0 -D build-STM32F4DISC/firmware.dfu
dfu-util 0.5

(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY

dfu-util does currently only support DFU version 1.0

Opening DFU USB device... ID 0483:df11
Run-time device DFU version 011a
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash  /0x08000000/04*016Kg,01*064Kg,07*128Kg"
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
Dfu suffix version 11a
DfuSe interface name: "Internal Flash  "
file contains 1 DFU images
parsing DFU image 1
image for alternate setting 0, (2 elements, total size = 136908)
parsing element 1, address = 0x08000000, size = 392
parsing element 2, address = 0x08020000, size = 136500
done parsing DfuSe file

Remove the BOOT0 jumper and press reset. You should now be able to fire up a terminal emulator (i.e. minicom) on /dev/ttyACM0 and have a micropython prompt.

where you should see something like this:

Welcome to minicom 2.7

OPTIONS: I18n 
Compiled on Jan 11 2014, 10:01:22.
Port /dev/ttyACM0, 23:34:32

Press CTRL-A Z for help on special keys

>>>

If you hit Ctl+D the MCU will do a soft reboot and it will run whatever code is in /src/main.py and the following will be written to the console:

PYB: sync filesystems
PYB: soft reboot

If you hit Ctl+C the running of /src/main.py is interrupted and you will be returned to the python prompt. The following is printed to the console:

Traceback (most recent call last):
  File "0://src/main.py", in <module>
VCPInterrupt()
Micro Python build <git hash> on 25/1/2014; F4DISC with STM32F405RG
Type "help()" for more information.
>>>
Programming from Mac OS X (via DFU)

If you are building on Mac OS X, you could programming like from Linux except install dfu-utils throught homebrew:

You could be able to launch a terminal emulator using screen on /dev/tty.usbmodem411 (ls /dev/tty.usbmodem* confirm the device name) and got a micropython prompt:

screen /dev/tty.usbmodem411

Press Ctrl-a and Ctrl-\ to quit the emulator, else the usbmodem device will be busy and refusing to connect again until you disconnect and plug in usb cable.

###Dealing with multiple DFU devices### When DFU looks for devices, if it only sees one device, then it will pick that device. It's been reported that sometimes other devices may show up, for example on one machine the error:

More than one DFU capable USB device found, you might try `--list' and then disconnect all but one device

was reported and dfu-util --list reported:

ound DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=0, name="UNDEFINED"
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=1, name="UNDEFINED"
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=2, name="UNDEFINED"
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=3, name="UNDEFINED"
Found Runtime: [0a5c:21e6] devnum=0, cfg=1, intf=3, alt=0, name="UNDEFINED"

In this case, the device with the ID 0a5c:21e6 was some type of Broadcom device. In this case you can add --device 0483:df11 to the dfu-util command line to tell it which device to use.

Programming from Windows(via DFU)
  1. download and install DFU programming software: DfuSe_Demo (currently v3.0.5) from http://www.st.com/en/development-tools/stsw-stm32080.html
  2. enter DFU mode (described earlier)
  3. get the latest microPython software (.dfu)
  4. click "Choose..." to pick (item 3.), then click "Upgrade". (it's not called "download", but "upgrade")

Done.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4