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 | #define | Description |
---|---|---|
0x02 | PEEK | Read word from memory at word[0]. |
0x03 | POKE | Write word[1] to memory at word[0]. (Not flash.) |
0x30 | CALL | Call Address |
0x31 | EXEC | Execute Arbitrary Code Fragment |
0x80 | CHANGE_BAUD | Change the baud rate. |
0x81 | ECHO | Echo the buffer back. |
0x82 | LIST_APPS | List the supported applications. |
0x90 | RAM_PATTERN | Suicide, filling RAM with a pattern. |
0x91 | RAM_DEPTH | Determine heap/stack depth. |
0xA0 | DIR | Set port direction bits. |
0xA1 | OUT | Set output value. |
0xA2 | IN | Get input value. |
0xB0 | SILENT | Set silence to byte[0] |
0xB1 | CONNECTED | Connection successful. |
0xC0 | READBUF | Dump buffer, takes 16-bit length. |
0xC1 | WRITEBUF | Set buffer, takes 16-bit length. |
0xC2 | SIZEBUF | Return buffer size. |
0xFD | NOP | No operation. |
0xFE | DEBUGHEX | Print a hex value. |
0xFF | DEBUGSTRING | Debug 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.
Byte | Value |
---|---|
0x00 | Default (115200) |
0x01 | 9600 |
0x02 | 19200 |
0x03 | 38400 |
0x04 | 57600 |
0x05 | 115200 |
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.