From: David B. <da...@we...> - 2014-04-30 17:58:12
|
Hi, I am trying to use OpenOCD (version 0.8.0, currently on Windows but also testing on Linux) for programming Kinetis K10 devices. I am using an Luminary Micros ICDI debugger using interface/ftdi/luminary-icdi.cfg. I also have access to CodeWarrior and a PE Micro USB device, which I have used during development - but I want to move to OpenOCD and gdb on Linux for development, and also use OpenOCD for programming (because we have several ICDI debugger boards). With an unsecured Kinetis, I can access it, erase the flash, and program the device. But if the Kinetis is secured (as indicated by a particular value at address 0x40c in flash), then I cannot get any access - most of the JTAG debugging functionality is disabled. To be able to re-enable the device, I have to be able to issue a bulk erase command. This can be done using the ARM Debug Access Port (DAP) which is still active. The MDM-AP is accessible as Debug Access Port 1, with these registers available: 0x0100_0000 = Status 0x0100_0004 = Control 0x0100_00fc = ID (read only, always reads 0x001c0000) With the device secured, and most debug features disabled, I can still write dap apsel 1 to select access port 1. The reply I get is: ap 1 selected, identification register 0x001c0000 So far, so good. To issue a "bulk erase" command, all I need to do is set the Control register to 0x00000001. (I'd also like to be able to read the Status register.) But now I am stuck - I can find no way to access these other DAP registers. I am hoping that there is some OpenOCD command that I haven't noticed, or perhaps some way to use the low-level JTAG commands for this purpose (I don't know the details of how JTAG works). I would prefer not to have to change the source code for OpenOCD, though I suspect that will be necessary at some point to make the process more user-friendly or even automatic. The main reason for this is that I need to be able to run the end result on a Windows machine - and while I am quite happy editing and rebuilding OpenOCD on Linux, I don't have a appropriate compiler tools configured for Windows builds. Any help here would be much appreciated. David |