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 | |
Harald Welte | 6101b1b | 2021-03-30 15:22:24 +0200 | [diff] [blame] | 29 | The icE1usb boot loader enumerates as VID:PID `1d50:6144`, while the |
| 30 | normal application firmware enumerates as `1d50:6145`, |
Harald Welte | d645d44 | 2020-12-14 19:20:38 +0100 | [diff] [blame] | 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 | |
Harald Welte | 6c8858b | 2021-03-30 15:27:47 +0200 | [diff] [blame] | 48 | The latest firmware can be found at |
| 49 | https://ftp.osmocom.org/binaries/icE1usb/firmware/latest/ |
Harald Welte | d645d44 | 2020-12-14 19:20:38 +0100 | [diff] [blame] | 50 | |
Harald Welte | 6c8858b | 2021-03-30 15:27:47 +0200 | [diff] [blame] | 51 | The latest gateware can currently only be found at the personal developer |
| 52 | directory of tnt at https://people.osmocom.org/tnt/e1/icE1usb-202010-bd399e96.bin |
| 53 | A more official download location for the gateware will be provided shortly. |
Harald Welte | d645d44 | 2020-12-14 19:20:38 +0100 | [diff] [blame] | 54 | |
| 55 | ==== Upgrading the FPGA gateware |
| 56 | |
Harald Welte | 0b7f834 | 2021-03-30 15:27:59 +0200 | [diff] [blame] | 57 | Gateware files are called `icE1usb-*.bin`. (without 'fw' in the name) |
Harald Welte | d645d44 | 2020-12-14 19:20:38 +0100 | [diff] [blame] | 58 | |
| 59 | The gateware can be upgraded by accessing the DFU _altsetting 0_ using `dfu-util` *`-a 0`* |
| 60 | |
| 61 | Assuming you already are in DFU mode, you would typically use a command |
| 62 | like `dfu-util -d 1d50:6144 -a 0 -D icE1usb-202010-bd3999e96.bin -R` to perform the upgrade. |
| 63 | |
| 64 | NOTE: The `-R` will switch the device back to runtime mode after the |
| 65 | upgrade. If you want to upgrade the firmware in the same session, skip |
| 66 | the `-R` in the above command. |
| 67 | |
| 68 | ==== Upgrading the picoRISCV firmware |
| 69 | |
Harald Welte | 0b7f834 | 2021-03-30 15:27:59 +0200 | [diff] [blame] | 70 | Firmware files are called `icE1usb-fw*.bin`. |
Harald Welte | d645d44 | 2020-12-14 19:20:38 +0100 | [diff] [blame] | 71 | |
| 72 | The firmware can be upgraded by accessing the DFU _altsetting 1_ using `dfu-util` *`-a 1`* |
| 73 | |
| 74 | Assuming you already are in DFU mode, you would typically use a command |
| 75 | like `dfu-util -d 1d50:6144 -a 1 -D fw_app-202011-4d9a04e2.bin -R` to perform the upgrade. |
| 76 | |
| 77 | .Typical output during upgrade of the firmware |
| 78 | ---- |
| 79 | $ sudo dfu-util -d 1d50:6144 -a 1 -D ./fw_app.bin -R |
| 80 | dfu-util 0.9 |
| 81 | |
| 82 | Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. |
| 83 | Copyright 2010-2016 Tormod Volden and Stefan Schmidt |
| 84 | This program is Free Software and has ABSOLUTELY NO WARRANTY |
| 85 | Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ |
| 86 | |
| 87 | dfu-util: Invalid DFU suffix signature |
| 88 | dfu-util: A valid DFU suffix will be required in a future dfu-util release!!! |
| 89 | Opening DFU capable USB device... |
| 90 | ID 1d50:6144 |
| 91 | Run-time device DFU version 0101 |
| 92 | Claiming USB DFU Interface... |
| 93 | Setting Alternate Setting #1 ... |
| 94 | Determining device status: state = dfuIDLE, status = 0 |
| 95 | dfuIDLE, continuing |
| 96 | DFU mode device DFU version 0101 |
| 97 | Device returned transfer size 4096 |
| 98 | Copying data from PC to DFU device |
| 99 | Download [=========================] 100% 11256 bytes |
| 100 | Download done. |
| 101 | state(2) = dfuIDLE, status(0) = No error condition is present |
| 102 | Done! |
| 103 | Resetting USB to switch back to runtime mode |
| 104 | ---- |
| 105 | |
| 106 | As the `-R` option was used, the device will reset and re-enumerate in |
| 107 | the newly programmed firmware. |
| 108 | |
| 109 | You can verify this as follows: |
| 110 | |
| 111 | ---- |
| 112 | $ lsusb -d 1d50: |
| 113 | Bus 001 Device 042: ID 1d50:6145 OpenMoko, Inc. icE1usb |
| 114 | ---- |
| 115 | |
| 116 | or alternatively: |
| 117 | |
| 118 | ---- |
| 119 | $ dfu-util -l -d 1d50: |
| 120 | dfu-util 0.9 |
| 121 | |
| 122 | Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. |
| 123 | Copyright 2010-2016 Tormod Volden and Stefan Schmidt |
| 124 | This program is Free Software and has ABSOLUTELY NO WARRANTY |
| 125 | Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ |
| 126 | |
| 127 | Found Runtime: [1d50:6145] ver=0003, devnum=44, cfg=1, intf=1, path="1-2", alt=0, name="DFU runtime", serial="dc697407e7881531" |
| 128 | ---- |
| 129 | |
| 130 | |
| 131 | === Use of the E1 Interface LEDs |
| 132 | |
Harald Welte | 5276567 | 2020-12-15 18:35:42 +0100 | [diff] [blame] | 133 | Each E1 interface has two LEDs integrated into the RJ45 connector. They |
| 134 | are (starting to get) used by the firmware to indicate status |
| 135 | information to the user. |
Harald Welte | d645d44 | 2020-12-14 19:20:38 +0100 | [diff] [blame] | 136 | |
Harald Welte | 5276567 | 2020-12-15 18:35:42 +0100 | [diff] [blame] | 137 | [options="header"] |
| 138 | |=== |
| 139 | |Color | Pattern | Meaning |
| 140 | |Green | Blinking (slow) | E1 Receiver attempting to align |
| 141 | |Green | On | E1 Receiver fully aligned |
| 142 | |=== |
| 143 | |
Harald Welte | d645d44 | 2020-12-14 19:20:38 +0100 | [diff] [blame] | 144 | |
| 145 | === Use of the Multi-Color RGB LED |
| 146 | |
| 147 | FIXME: describe how it is used. |