MalphasWats / hawk

Tutorial for making an ARM dev board in KiCAD
472 stars 125 forks source link

Programming the board? #3

Open twopoint718 opened 5 years ago

twopoint718 commented 5 years ago

It looks like "Programming" is coming up an a future installment, but in the mean time could you comment on what sort of debugger/programmer one would need to be able to program this board? For example, would a J-Link (SWD) work?

And thanks for the very clear intro to KiCad!

J-P-Projects commented 5 years ago

I have an assembled board ready to program. Could anyone comment of how this is done?

twopoint718 commented 5 years ago

It may be overkill, but I've picked up a J-LINK EDU which (should) work with pretty much any Cortex-M μC. While googling around I saw that the black magic probe may also work as well. I'll update this issue when I can confirm with my own hardware.

twopoint718 commented 5 years ago

@GHvsBB Okay, I can confirm that I can program the board using a J-Link (EDU model). I used the SWD debugging connection. You'll need to connect up the header pins as follows:

Header pin Function JTAG 20-pin connector
1 SWDIO 7
2 +3.3V 1 (VTRef)
3 SWCLK 9
- N/C -
5 RESET 15
6 GND 4

I'd imagine that there's some kind of breakout/adapter but I just used jumper wires. The VTRef connection is so that the debugger knows the board voltage level (3.3V). There's a separate +5V pin (no. 19) that could be used to supply power to the board (since the board has a voltage regulator), but I didn't use it.

MalphasWats commented 5 years ago

Sorry - I'm not used to having issues in my repos and totally didn't notice your question!

I used a cheap ST-Link V2 clone I found on eBay to program it with SWD.

I am planning to write this up at some point, although it ended up being more complicated than I expected because it required OpenOCD to be patched because of the cheap programmer!

twopoint718 commented 5 years ago

If you're interested, I could write up what I did and run that by you. I was thinking of blogging that anyway.