Skip to content

Investigation into openocd integration #2

@cjheath

Description

@cjheath

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions