Solutions using SWD
The SWD protocol is a protocol implemented by ST boards to communicate with the chips, allowing debug as well as flashing the memory.
it is available with any STM32 Discovery board by removing two jumpers and is thus very affordable (discovery boards start at 10€). Just connect the SWD connector.
The software used can be either openOCD or stlink by texane ( https://github.com/texane/stlink ) . Google it, there are some nice tutorials about it. I use texane stlink a lot !
it will allow you to flash directly your bitbox or run a debug server (you run the st-util and connect to it locally)
This is a really nice solution for any software developer since it allows reading any part of the memory, step by step debugging ...
Here is a picture on how to plug it (click to enlarge).
Instructions concerning the software used to upload can be seen on the development tutorial posts. Useful software can be st-util/st-flash , STM own stlink on win32 , openOCD.
Solutions using USB and the internal bootloader
Bitbox can be flashed using just an USB connection with no additional hardware.
Here are the instructions :
- solder the solder jumpers SJ1 and SJ2 on the back of the board. They are there because you shouldn't have it plugged at the same time as USB2 ; so beware !
- Plug the micro USB to a PC to bitbox using a micro USB cable
- Connect the jumper on the top of the board, close to the VGA connector. This will pull the BOOT0 Up (it is normally pulled down). BOOT1 is always pulled down.
- Reset your board.
The STM32f4 states that:
The hardware required to put the STM32F4xx into System memory boot mode consists of any circuitry, switch or jumper, capable of holding the BOOT0 pin high and the BOOT1 pin low during reset.Well, that's just what we did. So the box can accept connections from USB
(next steps are valid on linux ubuntu)
- if it's not present, install the dfu-util software using
sudo apt-get install dfu-util
-check your board connection with
> dfu-util -l
or lsusb, where a line like
Bus 003 Device 083: ID 0483:df11 STMicroelectronics STM Device in DFU Mode
will appear
- then you can load a dfu file or a bin file ! Example (thanks to marcus) :
> sudo dfu-util -d 0483:df11 -c 1 -i 0 -a 0 -s 0x08000000 -D testkernel.bin
(you can use the micropython udev rules linked hereafter to omit the sudo thing ..)
useful pointers :
- https://github.com/micropython/micropython/wiki/Board-STM32F407-Discovery
- http://dfu-util.gnumonks.org/
- http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
Solutions using a bus pirate or a FTDI chip
The above solution can be used to program your chip with the bootloader and an USB connector, but the bootloader can also be used to program the chip with a Serial connection. USART 1 and 3 can be used to program the chip with the bootloader, and the USART3 is available right on the UEXT connector !
Everything is explained in this document by ST. Jump to page 71 for the STM32F405.
So you can use any serial line to program the chip. Well, if you have the software ; it seems stm32flash can be used.
No comments:
Post a Comment