Skip to content

Instantly share code, notes, and snippets.

View nazgee's full-sized avatar

Michal Stawinski nazgee

  • Poland, Wroclaw
View GitHub Profile
@nazgee
nazgee / notes.md
Created May 21, 2016 21:32 — forked from natevw/notes.md
Using Bus Blaster v4 with STM32F4x SWD

Using Bus Blaster v4 with STM32F4x SWD

For SWD (instead of normal JTAG) you need a different CPLD "buffer logic" image on the Bus Blaster, the KT-Link compatible ones seem like the recommended means.

# with buffer logic at https://github.com/dergraaf/busblaster_v4/blob/master/ktlink/ktlink.svf
# via http://dangerousprototypes.com/forum/viewtopic.php?f=37&t=5954 from https://github.com/mchck/mchck/wiki/Getting-Started#wiki-bus-blaster
curl -O https://github.com/dergraaf/busblaster_v4/raw/master/ktlink/ktlink.svf
openocd -f board/dp_busblaster_v3.cfg -c "adapter_khz 1000; init; svf /Users/natevw/Downloads/ktlink.svf; shutdown"
// Note that I wrote this in java in Processing - paste this GIST into processing to see it in action.
// It is not the most elegant thing ever but it does deal with end caps and ribbon loops and the like.
// If you port this over to say objective-c / opengl / c etc - you may need to deal with polygon direction
// here is a snapshot of it running : http://www.flickr.com/photos/anselmhook/6507471719/in/photostream
int nvertices = 0;
float[] vertexpool = new float[3000];
float x1,x2,y1,y2;
void intersect(int kind, float x0, float y0, float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4) {