Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigation into openocd integration #2

Open
cjheath opened this issue May 11, 2013 · 1 comment
Open

Investigation into openocd integration #2

cjheath opened this issue May 11, 2013 · 1 comment

Comments

@cjheath
Copy link

cjheath commented May 11, 2013

Hi man, good work. I was looking to see whether something like this was already implemented in the stlink-v2->openocd->gdb toolchain, and found your work here. I was reading the source code of openocd tonight. The src/server/gdb_server.c sets a log callback function by calling log_add_callback in src/helper/log.c, which means that any part of openocd which wants to send a text message to GDB just has to call log_printf or log_printf_lf. This results in a packet sent by the gdbserver function gdb_output_con() to gdb. The packet is a VERBOSE REPLY which has a first byte of "O". The contents of the string are hex-encoded bytes. See for the protocol doc for example at
http://sourceware.org/gdb/talks/esc-west-1999/protocol.html.

So the easy integration for your ITM code into openOCD is to call log_printf with any received string, and it should get sent by openocd's gdb stub to be displayed in gdb.

Hopefully you can figure out the rest? I'm still inexperienced with the STM32 but I'd love to have ITM working for my programs.

@obe1line
Copy link
Owner

Thanks for the information - looks like the log_printf is a good way to progress.
I will take a look when I get some spare time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants