Harald Welte | d645d44 | 2020-12-14 19:20:38 +0100 | [diff] [blame] | 1 | [[firmware]] |
| 2 | == icE1usb Firmware |
| 3 | |
| 4 | The icE1usb _firmware_ is a small amount of bare-iron software running |
| 5 | on the picoRISCV soft-core of the _gateware_. |
| 6 | |
| 7 | It mainly consists of drivers for the no2e1 E1 Framer IP core and the |
| 8 | no2usb USB Device IP core which are part of the gateware described in |
| 9 | <<gateware>>. |
| 10 | |
| 11 | === Firmware Upgrade (DFU) |
| 12 | |
| 13 | icE1usb contains support for the USB DFU (Device Firmware Upgrade) |
| 14 | standard. |
| 15 | |
| 16 | As such, you can use any USB DFU compliant utility to upgrade the |
| 17 | firmware of the icE1usb device. |
| 18 | |
| 19 | DFU mode can be entered in two ways: |
| 20 | |
| 21 | 1. by performing a DFU detach from the normal application firmware |
| 22 | (obviously that requires a [still] working firmware present on the |
| 23 | device). To do so, please use `dfu-util -e` |
| 24 | |
| 25 | 1. by pushing the push-button (see <<hw-pushbutton>>) during power-up. |
| 26 | Simply disconnect the USB cable, then push that button and keep it |
| 27 | pushed while re-attaching the USB cable. |
| 28 | |
| 29 | The icE1usb boot loader enumerates as VID:PID `1d50:6145`, while the |
| 30 | normal application firmware enumerates as `1d50:6144`, |
| 31 | |
| 32 | You can for example use `lsusb` to check the VID:PID: |
| 33 | |
| 34 | ---- |
| 35 | $ lsusb -d 1d50: |
| 36 | Bus 001 Device 042: ID 1d50:6145<1> OpenMoko, Inc. icE1usb |
| 37 | $ sudo dfu-util -d 1d50:6145 -e <2> |
| 38 | ... |
| 39 | $ lsusb -d 1d50: |
| 40 | Bus 001 Device 043: ID 1d50:6144<3> OpenMoko, Inc. icE1usb (DFU) |
| 41 | ---- |
| 42 | <1> initially the device is in normal runtime mode |
| 43 | <2> we use `dfu-util -e` to switch to DFU mode |
| 44 | <3> we can see, the device is now in DFU mode |
| 45 | |
| 46 | ==== Obtaining firmware upgrades |
| 47 | |
| 48 | The latest firmware can currently be found at the personal developer |
| 49 | directory of tnt at https://people.osmocom.org/tnt/e1/ |
| 50 | |
| 51 | A more official download location will be provided shortly. |
| 52 | |
| 53 | ==== Upgrading the FPGA gateware |
| 54 | |
| 55 | Gateware files are called `icE1usb-*.bin`. |
| 56 | |
| 57 | The gateware can be upgraded by accessing the DFU _altsetting 0_ using `dfu-util` *`-a 0`* |
| 58 | |
| 59 | Assuming you already are in DFU mode, you would typically use a command |
| 60 | like `dfu-util -d 1d50:6144 -a 0 -D icE1usb-202010-bd3999e96.bin -R` to perform the upgrade. |
| 61 | |
| 62 | NOTE: The `-R` will switch the device back to runtime mode after the |
| 63 | upgrade. If you want to upgrade the firmware in the same session, skip |
| 64 | the `-R` in the above command. |
| 65 | |
| 66 | ==== Upgrading the picoRISCV firmware |
| 67 | |
| 68 | Firmware files are called `fw_app*.bin`. |
| 69 | |
| 70 | The firmware can be upgraded by accessing the DFU _altsetting 1_ using `dfu-util` *`-a 1`* |
| 71 | |
| 72 | Assuming you already are in DFU mode, you would typically use a command |
| 73 | like `dfu-util -d 1d50:6144 -a 1 -D fw_app-202011-4d9a04e2.bin -R` to perform the upgrade. |
| 74 | |
| 75 | .Typical output during upgrade of the firmware |
| 76 | ---- |
| 77 | $ sudo dfu-util -d 1d50:6144 -a 1 -D ./fw_app.bin -R |
| 78 | dfu-util 0.9 |
| 79 | |
| 80 | Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. |
| 81 | Copyright 2010-2016 Tormod Volden and Stefan Schmidt |
| 82 | This program is Free Software and has ABSOLUTELY NO WARRANTY |
| 83 | Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ |
| 84 | |
| 85 | dfu-util: Invalid DFU suffix signature |
| 86 | dfu-util: A valid DFU suffix will be required in a future dfu-util release!!! |
| 87 | Opening DFU capable USB device... |
| 88 | ID 1d50:6144 |
| 89 | Run-time device DFU version 0101 |
| 90 | Claiming USB DFU Interface... |
| 91 | Setting Alternate Setting #1 ... |
| 92 | Determining device status: state = dfuIDLE, status = 0 |
| 93 | dfuIDLE, continuing |
| 94 | DFU mode device DFU version 0101 |
| 95 | Device returned transfer size 4096 |
| 96 | Copying data from PC to DFU device |
| 97 | Download [=========================] 100% 11256 bytes |
| 98 | Download done. |
| 99 | state(2) = dfuIDLE, status(0) = No error condition is present |
| 100 | Done! |
| 101 | Resetting USB to switch back to runtime mode |
| 102 | ---- |
| 103 | |
| 104 | As the `-R` option was used, the device will reset and re-enumerate in |
| 105 | the newly programmed firmware. |
| 106 | |
| 107 | You can verify this as follows: |
| 108 | |
| 109 | ---- |
| 110 | $ lsusb -d 1d50: |
| 111 | Bus 001 Device 042: ID 1d50:6145 OpenMoko, Inc. icE1usb |
| 112 | ---- |
| 113 | |
| 114 | or alternatively: |
| 115 | |
| 116 | ---- |
| 117 | $ dfu-util -l -d 1d50: |
| 118 | dfu-util 0.9 |
| 119 | |
| 120 | Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. |
| 121 | Copyright 2010-2016 Tormod Volden and Stefan Schmidt |
| 122 | This program is Free Software and has ABSOLUTELY NO WARRANTY |
| 123 | Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ |
| 124 | |
| 125 | Found Runtime: [1d50:6145] ver=0003, devnum=44, cfg=1, intf=1, path="1-2", alt=0, name="DFU runtime", serial="dc697407e7881531" |
| 126 | ---- |
| 127 | |
| 128 | |
| 129 | === Use of the E1 Interface LEDs |
| 130 | |
| 131 | Each E1 interface has two LEDs integrated into the RJ45 connector. |
| 132 | |
| 133 | FIXME: describe how they are used. |
| 134 | |
| 135 | === Use of the Multi-Color RGB LED |
| 136 | |
| 137 | FIXME: describe how it is used. |