Monitor Application

This application manages local memory, providing access to peripherals and the GoodFET's global configuration.

Clients

All clients deal with the monitor in some way.

Development

The monitor provides access to the local memory of the GoodFET device, and it ought to be used to debug the unit or poke pieces of memory directly. Additionally, it might serve as a standalone bootloader with a few tweaks to the IVT.

Verbs

The following verbs are supported.

Hex#defineDescription
0x02PEEKRead word from memory at word[0].
0x03POKEWrite word[1] to memory at word[0]. (Not flash.)
0x30CALLCall Address
0x31EXECExecute Arbitrary Code Fragment
0x80CHANGE_BAUDChange the baud rate.
0x81ECHOEcho the buffer back.
0x82LIST_APPSList the supported applications.
0x90RAM_PATTERNSuicide, filling RAM with a pattern.
0x91RAM_DEPTHDetermine heap/stack depth.
0xA0DIRSet port direction bits.
0xA1OUTSet output value.
0xA2INGet input value.
0xB0SILENTSet silence to byte[0]
0xB1CONNECTEDConnection successful.
0xC0READBUFDump buffer, takes 16-bit length.
0xC1WRITEBUFSet buffer, takes 16-bit length.
0xC2SIZEBUFReturn buffer size.
0xFDNOPNo operation.
0xFEDEBUGHEXPrint a hex value.
0xFFDEBUGSTRINGDebug a string.

READBUF (0xC0)

This command takes a 16-bit, little-endian length as its parameter, then spits out as many bytes from the beginning of the buffer. The bytes come after the reply command, outside of the command stream.

WRITEBUF (0xC1)

This command takes a 16-bit, little-endian length as its parameter, then reads as many bytes into the beginning of the buffer. The bytes come after the reply command, outside of the command stream.

SIZEBUF (0xC2)

This command returns the size of the monitor buffer.

CHANGE_BAUD (0x80)

The GoodFET defaults to 115200 baud, but alternate baud rates are available by use of the CHANGE_BAUD (0x80) command of the Monitor application. This takes a single byte, which specifies the baud rate as per the following table.

N.B., This command does not generate a reply.

ByteValue
0x00Default (115200)
0x019600
0x0219200
0x0338400
0x0457600
0x05115200

RAM_PATTERN (0x90)

Fill all of RAM with 0xBEEF, then reset to begin the firmware from the start. Unless power is lost, this pattern will only be overwritten by the firmware's use of RAM and the bootloader's caching of write blocks.

The GoodFET will reboot after sending a reply. It is recommended that the client session reset as well.

RAM_DEPTH (0x91)

Measures the size of the 0xBEEF block in the middle of RAM, calculating from that the amount of RAM which has been used by the firmware. Running RAM_PATTERN, then several test cases, followed by RAM_DEPTH, will allow the RAM requirements of the application to be accurately estimated.

See The GoodFET's MSP430 Stack Depth for a description of this command and its usefulness in measuring the RAM usage of a GoodFET.