This replaces the factory firmware and addresses three main limitations:
- The FPGA UART now runs at 115200 baud.
- The board shows up as two USB serial ports, one for the SPI Flash programmer, one for the FPGA UART. This avoids the need to use the mode switch on the board.
- It's much faster to program.
The programming interface supports XMODEM-CRC and XMODEM1k removing the need for a custom programmer.
See also the compat
branch for firmware that is backwards compatible with the Numato programmer.py (but addresses 1 & 2 above).
There's a prebuilt .hex file in the prebuilt
directory.
Otherwise, get the necessary software:
- PIC development tools
- MPLAB.X
- XC8 compiler for MPLAB.X (e.g. linux version)
- 60-day PRO demo
- XC8 legacy PIC18F perhipheral library (e.g. linux version) (not required just to build).
- mphidflash
Open the project in MPLAB.X, select Run>Build.
Connect a jumper to the FWUP header (just above the left-most seven-segment). Power up the board and it should show up as a HID device (the Microchip HID bootloader).
$ lsusb
...
Bus 001 Device 052: ID 04d8:003c Microchip Technology, Inc.
...
Verify mphidflash can find the device:
$ ./mphidflash-1.6-linux-64
USB HID device found: 12288 bytes free
Device family: PIC18
Use mphidflash to flash the new code:
$ ./mphidflash-1.6-linux-64 -w prebuilt/numato-mimasv2-pic-firmware.production.hex -r
Remove the jumper and power-cycle the board.
$ screen /dev/ttyACM0
mimas> v
1.0
mimas> i
202015
mimas> f
Ctrl-A : exec !! sx -k /path/to/flash.bin
$ python3 -m venv venv
$ . venv/bin/activate
$ pip install pyserial xmodem
$ python3 programmer.py /path/to/flash.bin
$ minicom -D /dev/ttyACM0
mimas> v
1.0
mimas> i
202015
mimas> f
Ctrl-A S
$ screen /dev/ttyACM1 115200
- Make the FPGA UART speed detect automatically from the host. (In progress)
- Set a write offset
- Set a write size (and fill with zeros)