Flashing ARM Micro using ST Discovery board as a programmer
This guide shows how to program an ARM micro controller using a ST Discovery board as the programmer. The best thing is that this even works in Linux with a graphical user interface. Therefore this is currently my preferred way to flash my Keil board.
There are off course dedicated USB – JTAG programmers available. Keil sells one which works well with their (commercial) Windows only development environment. If you write your code in Linux there is the ARM-USB-OCD from Olimex. I believe this can be set up to work in Eclipse but otherwise I think there is only a command line interface which is pretty painful.
A really cheap and hassle free way to program a board is to just use a ST discovery board as the programmer.
- Install qstlink2 from here. It is licensed under GNU GPL v3.
- Remove the two jumpers from the discovery board to disable programming of the processor on the discovery board (ST-Link setting). Instead the signals are available on the SWD header.
- SWD pin 1 not connected
- SWD pin 2 (SWCLK) to JTAG pin 9 (TCLK)
- SWD pin 3 (GND) to any JTAG GND pin
- SWD pin 4 (SWDIO) to JTAG pin 7 (TMS)
- SWD pin 5 (NRST) to JTAG pin 15 (RESET)
- SWD pin 6 (SWO) to JTAG pin 13 (TDO)
- Connect the signals on the SWD header to the following JTAG signals:
- Plug the discovery board programming interface into your host machine’s USB port.
- Power up your development board and the discovery board.
- Open the qstlink2 program, click connect and upload and download your software as required.
That’s it. Cost effective micro controller programming in Linux with graphical user interface. Dreams come true!