Well, that was a fun evening, almost felt like an engineer again ;-) I was wondering if the Raspberry Pi could be a debug interface+remote GDB server using openocd.
I checked out the current build from git and checked it worked remotely with a J-Link and gdb - it's fine...so at the very least we know that openocd will run on a Pi when using a 'normal' interface. Speed is decent too, considering. I then hacked (very nastily) the parport.c together with the wiringPi stuff to give me decent digital I/O over the various pins that are available on the Pi board. I configured the pins for bitbanging and wired them to a LPC1768 target that I had laying around - fortunately they're both the same voltage so I was able to get away with bodgewire jumpers to do that. Once I'd removed TRST from the board I was able to get something out of it, but it crashes in ahbap_debugport_init() .... time for bed now, might look again over the weekend. Trace is below. It looks like the Pi could be, at the very least, a bitbanged interface, but there probably needs to be, for the general case, something more intelligent done with the interface in terms of buffers etc. There is also some I2C, PWM and SPI functionality on those bits so it's possible that it might be able to work in a more intelligent way to give more speed. I had hoped to do a speed test, but that's clobbered by the segfault that needs investigating. Hope this lot is useful. If anyone wants the code please drop me a note. Beware that it's really not fit for human consumption, and even animals would be wary...this was just for fun, 'cos that's the whole point of the Pi. Regards DAVE ============== Debug: 139 123 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_gdb_flash_program enable Debug: 140 124 command.c:145 script_debug(): command - gdb_flash_program ocd_gdb_flash_program enable Debug: 142 126 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_init Debug: 143 127 command.c:145 script_debug(): command - init ocd_init Debug: 145 128 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target init Debug: 146 129 command.c:145 script_debug(): command - ocd_target ocd_target init Debug: 148 131 target.c:1183 handle_target_init_command(): Initializing targets... <SNIP> Debug: 179 155 command.c:367 register_command_handler(): registering 'ocd_ps'... Debug: 180 157 parport.c:157 parport_reset(): trst: 0, srst: 0 Debug: 181 157 core.c:1592 adapter_khz_to_speed(): convert khz to interface specific speed value Debug: 182 158 core.c:1595 adapter_khz_to_speed(): have interface set up Debug: 183 159 core.c:1592 adapter_khz_to_speed(): convert khz to interface specific speed value Debug: 184 159 core.c:1595 adapter_khz_to_speed(): have interface set up Info : 185 159 core.c:1399 adapter_init(): clock speed 10 kHz Debug: 186 159 openocd.c:132 handle_init_command(): Debug Adapter init complete Debug: 187 160 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport init Debug: 188 161 command.c:145 script_debug(): command - ocd_transport ocd_transport init Debug: 190 162 transport.c:240 handle_transport_init(): handle_transport_init Debug: 191 162 parport.c:157 parport_reset(): trst: 0, srst: 0 Debug: 192 163 core.c:719 jtag_add_reset(): SRST line released Debug: 193 164 core.c:743 jtag_add_reset(): TRST line released Debug: 194 165 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset Debug: 196 569 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init Debug: 197 570 command.c:145 script_debug(): command - ocd_jtag ocd_jtag arp_init Debug: 198 570 core.c:1412 jtag_init_inner(): Init JTAG chain Debug: 199 571 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset Debug: 200 572 core.c:1048 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS Debug: 201 572 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset Info : 202 573 core.c:951 jtag_examine_chain_display(): JTAG tap: lpc1768.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4) Debug: 203 574 core.c:1208 jtag_validate_ircapture(): IR capture validation scan Debug: 204 574 core.c:1267 jtag_validate_ircapture(): lpc1768.cpu: IR capture 0x01 Debug: 205 575 openocd.c:145 handle_init_command(): Examining targets... Debug: 206 576 target.c:1299 target_call_event_callbacks(): target event 21 (examine-start) Debug: 207 576 arm_adi_v5.c:1097 ahbap_debugport_init(): <A few seconds pause> Segmentation fault ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
