Some packets designed more recently assume an eight-bit clean connection, and use a more efficient encoding to send and receive binary data.
The binary data representation uses 7d (ASCII ‘}’) as an escape character. Any escaped byte is transmitted as the escape character followed by the original character XORed with 0x20. For example, the byte 0x7d would be transmitted as the two bytes 0x7d 0x5d. The bytes 0x23 (ASCII ‘#’), 0x24 (ASCII ‘$’), and 0x7d (ASCII ‘}’) must always be escaped. Responses sent by the stub must also escape 0x2a (ASCII ‘*’), so that it is not interpreted as the start of a run-length encoded sequence (described next).
One of the packets using binary data is the X packet for writing memory, used by the GDB load command.
wishbone-tool doesn't appear to be unescaping the binary data before writing memory; when using GDB to load a file of incrementing numbers into ram, this is the resulting memory contents:
Per GDB remote protocol overview:
One of the packets using binary data is the
X
packet for writing memory, used by the GDBload
command.wishbone-tool doesn't appear to be unescaping the binary data before writing memory; when using GDB to load a file of incrementing numbers into ram, this is the resulting memory contents: