Skip to content

Monitor

varkenvarken edited this page Feb 26, 2020 · 4 revisions

Some documentation on monitor.py

monitor.py is a front-end for the hardware monitor program available in the the Robin SoC.

It is written in Python and offers convenience functions for loading and viewing of data in memory as well as starting programs. It comes with readline functionality (history etc.) and can even function as a primitive terminal when a program is running.

It is also capable of loading binary files created with the assembler as well as reading files in Intel hex format.

calling the monitor program

python3 monitor.py [options] file

usage: monitor.py [-h] [-t] [-i] [-x] [-b BAUDRATE] [-d [DEV]]
              [FILE [FILE ...]]

positional arguments:
  FILE                  files to execute, if not empty implies -t, will not
                        end unless one of the commands encountered is exit or
                        -x is set

optional arguments:
  -h, --help            show this help message and exit
  -t, --test            run in test mode (will not show prompts)
  -i, --ice             find icestick/icebreaker
  -x, --exit            exit after script
  -b BAUDRATE, --baudrate BAUDRATE
                        set baudrate
  -d [DEV], --dev [DEV]
                        serial device to connect to (will default to
                        /dev/ttyUSB1

A typical call would be

monitor.py -i -b 115200

This would connect the monitor to any iCEstick or iCEbreaker device connected to one of the usb ports at a baudrate of 115k2

commands

If you type help on the interactive prompt a list of available commands is shown

Documented commands (type help <topic>):
========================================
break  dumpl  dumpw  eval  file   help  loadl  run   runps  show
dump   dumps  echo   exit  flush  load  loadw  runp  runs   test

Additional information for each of these commands is shown if you type help

A very common workflow is

file myprog.bin
run 0x200
run 0x2000
show

This will load the file myprog.bin (the file command supports autocompletion if you press TAB), start running the program at address 0x200, then run the program at address 0x2000 (firmware program that dumps all cpu registers to address 0x80) and finally shows the data at address 0x80 in a neatly formatted manner.

Clone this wiki locally