Rockbox

Tasklist

FS#8454 - Implement debug() for ARM architectures via JTAG DCC

Attached to Project: Rockbox
Opened by Catalin Patulea (Catalin Patulea) - Sunday, 13 January 2008, 18:41 GMT
Task Type Patches
Category Operating System/Drivers
Status Unconfirmed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

The ARM hardware debugger via JTAG spec (EmbeddedICE) specifies a sideband channel for target<->debugger communication called DCC (Debug Communications Channel). openocd, an open-source debugger compatible with the EmbeddedICE standard, supports using this channel for textual debug messages from the target.

The attached patch implements the target side of this channel. Messages can be enabled in openocd using the "target_request debugmsgs enable" command.

WARNING: If -DDEBUG is enabled and there is no hardware debugger attached to drain the DCC buffer, debug() becomes very slow because it has to wait for the writes to time out. However, this is unlikely to happen because -DDEBUG isn't typically enabled for target builds.
This task depends upon

Comment by Catalin Patulea (Catalin Patulea) - Sunday, 13 January 2008, 19:20 GMT
Fix for "Error: selected processor does not support `bkpt 0'" on non-arm9ej-s architectures (like arm9tdmi).
Comment by Catalin Patulea (Catalin Patulea) - Sunday, 13 January 2008, 20:01 GMT
Oh, and this patch also fixes some concurrency issues with debugf (which is not reentrant because of the static printf buffer).
Comment by Catalin Patulea (Catalin Patulea) - Sunday, 13 January 2008, 20:22 GMT
Now also fixes "undefined reference to `debug_init'" for Normal (as opposed to Bootloader) builds.
Comment by Catalin Patulea (Catalin Patulea) - Sunday, 13 January 2008, 21:14 GMT
Once more with passion! (Fix double-newlines due to openocd appending a newline.)
Comment by Tobias Diedrich (ranma) - Friday, 15 October 2010, 13:43 GMT
I tried your patch, it works fine. With mit USB JTAG interface it's very slow though. Probably more due to USB roundtrip times than JTAG speed (6MHz).
Because it's so slow I think it would be more appropriate to modify logf, as logf is enabled on a file by file basis, whereas debugf is sprinkled all over the place I think.
There would probably need to be an "Enable logf over jtag DCC" configure option because of the long timeouts when no jtag debugger is attached.

Loading...