On Mon, Feb 23, 2015 at 1:52 PM, Matthijs van Duin wrote: > At least on the am335x, the trick actually works! I have a working > demo which configures ICEPick registers and even performs transactions > on the debug interconnect. Nice! > I've been lazy and imported a bunch of files from my baremetal > projects so I could easily mess with the hardware, rudely bypassing > the kernel. The whole implementation is hideous in all sorts of ways, > but it gets the job done: https://github.com/dutchanddutch/jbang > > The key part, how to bitbang JTAG, is reasonably isolated from all > this in src/jbang.cc and glues onto the device-specific part via > hw-subarctic.h. You could probably also turn jbang.cc into plain C > without too much effort and discard the rest... I accept that my code > style is probably a bit of an acquired taste ;-) > > For the omap3, apart from the differences in padconf details, you'll > want to change icepick_init_regs[] to just { 0x23002100 } I think and > hopefully you can then write the DAPCTL regs using ap_write(). I've finally got rid of nTRST pulldown (haven't connected TDO though), created hw-omap3.{h,cc}, but couldn't get it to do anything, until it came to my mind that you may be running ARM on your BBB slower that 1GHz that I'm using on my DM3730. So lowered the clock to 500MHz and voila, it worked! I guess I'll still connect TDO as it's not so much fun without it, going to try connecting to EMU0 too, hopefully it doesn't mess up the boot modes. Before I could get it all to work a coworker lent me an Altera USB Blaster, which I've connected to a pandora prototype board I still have from a long time ago and wasn't that afraid to kill with bad soldering job. And hey, it worked too with your code modified to use USB Blaster in it's bitbang mode over libftdi. This setup also works with openocd, but somewhat unreliably (only occasionally gets through init, often gets register values it doesn't like). My main goal is to have hardware watchpoints on the cased production unit without extra hardware, and it looks like I can finally have that, thanks! > I hope this example is of any help. It sure is! The only thing I do not understand is why are you using that process_vm_readv() call, mmap() already makes unprivileged user mode writable mappings. Anyway I'm attaching my code too, feel free to incorporate it too and/or ultra-modernize to your c++ dialect. GraÅžvydas