Dear list,
I built an icE1USB device so I can provide stable clock to my legacy Nokia BTS.
I have not found any information about how to bring up a completely empty device, so I just took the icE1usb-202210-5890f3e4.bin file and flashed it to the SPI flash, yet the device is not booting. Maybe something else is missing (like a boot block), or the binary has to be flashed with an offset? The device takes 80mA in this state, USB device is not recognized on the host.
Thanks!
And when I try to build the gateware, this is the error it produces:
Info: Device utilisation: Info: ICESTORM_LC: 5312/ 5280 100% Info: ICESTORM_RAM: 20/ 30 66% Info: SB_IO: 32/ 96 33% Info: SB_GB: 4/ 8 50% Info: ICESTORM_PLL: 1/ 1 100% Info: SB_WARMBOOT: 1/ 1 100% Info: ICESTORM_DSP: 6/ 8 75% Info: ICESTORM_HFOSC: 0/ 1 0% Info: ICESTORM_LFOSC: 0/ 1 0% Info: SB_I2C: 0/ 2 0% Info: SB_SPI: 1/ 2 50% Info: IO_I3C: 0/ 2 0% Info: SB_LEDDA_IP: 1/ 1 100% Info: SB_RGBA_DRV: 1/ 1 100% Info: ICESTORM_SPRAM: 4/ 4 100%
Info: Placed 39 cells based on constraints. Info: Creating initial analytic placement for 4564 cells, random placement wirelen = 134913. Info: at initial placer iter 0, wirelen = 3280 Info: at initial placer iter 1, wirelen = 3091 Info: at initial placer iter 2, wirelen = 3055 Info: at initial placer iter 3, wirelen = 3147 Info: Running main analytical placer, max placement attempts per cell = 3622086. ERROR: Failed to expand region (0, 0) |_> (25, 31) of 5311 ICESTORM_LCs 4 warnings, 1 error make: *** [../build/project-rules.mk:93: /root/Osmo-E1/osmo-e1-hardware/gateware/icE1usb/build-tmp/icE1usb.asc] Error 255
Sipos Csaba dchardware@gmail.com ezt írta (időpont: 2023. szept. 14., Cs, 11:37):
Dear list,
I built an icE1USB device so I can provide stable clock to my legacy Nokia BTS.
I have not found any information about how to bring up a completely empty device, so I just took the icE1usb-202210-5890f3e4.bin file and flashed it to the SPI flash, yet the device is not booting. Maybe something else is missing (like a boot block), or the binary has to be flashed with an offset? The device takes 80mA in this state, USB device is not recognized on the host.
Thanks!
Hi,
Wow, I think you might be the first one to build your own ice1usb, nice !
So yeah, the gateware/firmware update files we distribute * gateware: https://people.osmocom.org/~tnt/ice1usb/icE1usb-202210-5890f3e4.bin * firmware: https://downloads.osmocom.org/binaries/icE1usb/firmware/latest/icE1usb-fw.bi...
are meant for DFU updates and are only part of a complete ice1usb. Also worth to note that you need _both_ for the device to do anything.
Technically, you can make it work with just those two files, flashing the first at offset 0 and the second at offset 0x0a0000 in the flash, however it then wouldn't have a bootloader so you wouldn't be able to do DFU updates and you'd always have to resort to SPI flashing.
In the device you buy, there is a bootloader flashed first ( https://github.com/no2fpga/no2bootloader/tree/master ).
Although you can build the bootloader yourself too, the easiest to get a working device is so just use our "factory" image which you can find at : https://people.osmocom.org/~tnt/ice1usb/factory-202210/ So the file to flash from there is factory-image-20221025.bin . And that should get the device working albeit the firmware will be some factory test firmware. Feel free to follow the TEST-PROCEDURE.txt if you want to check the hardware, or else you can just follow the normal DFU update procedure to flash your device with the latest firmware (no need to update gateware, that one is already good)
As for building the gateware yourself : Which toolchain are you using ? I know the FPGA is very full, but it should fit. I just tried a test build here of master and it worked fine (it didn't meet timing out of the box, you often need to try a feed seeds, but that doesn't influence the resource usage which is what fails in your case).
Cheers,
Sylvain
Hi Sylvain,
Much appreciate your help!
These info would be very nice to have in the wiki page.
Let me quickly try the procedures out and will share the result.
On the toolchain I tried: Ubuntu 20.04 LTS xpack-riscv-none-elf-gcc-12.3.0-1 https://github.com/YosysHQ/nextpnr.git (latest master, but also tried 0.6 and 0.4, no luck) https://github.com/YosysHQ/icestorm.git (master)
The build process is error free until that point I copied into my previous mail.
Thanks again!
Csaba
Sylvain Munaut 246tnt@gmail.com ezt írta (időpont: 2023. szept. 15., P, 9:09):
Hi,
Wow, I think you might be the first one to build your own ice1usb, nice !
So yeah, the gateware/firmware update files we distribute
- gateware: https://people.osmocom.org/~tnt/ice1usb/icE1usb-202210-5890f3e4.bin
 - firmware: https://downloads.osmocom.org/binaries/icE1usb/firmware/latest/icE1usb-fw.bi...
 are meant for DFU updates and are only part of a complete ice1usb. Also worth to note that you need _both_ for the device to do anything.
Technically, you can make it work with just those two files, flashing the first at offset 0 and the second at offset 0x0a0000 in the flash, however it then wouldn't have a bootloader so you wouldn't be able to do DFU updates and you'd always have to resort to SPI flashing.
In the device you buy, there is a bootloader flashed first ( https://github.com/no2fpga/no2bootloader/tree/master ).
Although you can build the bootloader yourself too, the easiest to get a working device is so just use our "factory" image which you can find at : https://people.osmocom.org/~tnt/ice1usb/factory-202210/ So the file to flash from there is factory-image-20221025.bin . And that should get the device working albeit the firmware will be some factory test firmware. Feel free to follow the TEST-PROCEDURE.txt if you want to check the hardware, or else you can just follow the normal DFU update procedure to flash your device with the latest firmware (no need to update gateware, that one is already good)
As for building the gateware yourself : Which toolchain are you using ? I know the FPGA is very full, but it should fit. I just tried a test build here of master and it worked fine (it didn't meet timing out of the box, you often need to try a feed seeds, but that doesn't influence the resource usage which is what fails in your case).
Cheers,
Sylvain
Dear Sylvain,
After flashing the factory image, I have some serial output:
Booting Test image.. Flash Manufacturer : ef 40 14 Flash Unique ID : dc 69 58 90 87 a1 95 23 [+] GPS ok at 9600 baud
But no USB enumeration. I have no LEDs installed yet, so I cant check those.
Maybe I made a soldering error somewhere non obvious.
Regards, Csaba
Sipos Csaba dchardware@gmail.com ezt írta (időpont: 2023. szept. 15., P, 10:16):
Hi Sylvain,
Much appreciate your help!
These info would be very nice to have in the wiki page.
Let me quickly try the procedures out and will share the result.
On the toolchain I tried: Ubuntu 20.04 LTS xpack-riscv-none-elf-gcc-12.3.0-1 https://github.com/YosysHQ/nextpnr.git (latest master, but also tried 0.6 and 0.4, no luck) https://github.com/YosysHQ/icestorm.git (master)
The build process is error free until that point I copied into my previous mail.
Thanks again!
Csaba
Sylvain Munaut 246tnt@gmail.com ezt írta (időpont: 2023. szept. 15., P, 9:09):
Hi,
Wow, I think you might be the first one to build your own ice1usb, nice !
So yeah, the gateware/firmware update files we distribute
- gateware: https://people.osmocom.org/~tnt/ice1usb/icE1usb-202210-5890f3e4.bin
 - firmware: https://downloads.osmocom.org/binaries/icE1usb/firmware/latest/icE1usb-fw.bi...
 are meant for DFU updates and are only part of a complete ice1usb. Also worth to note that you need _both_ for the device to do anything.
Technically, you can make it work with just those two files, flashing the first at offset 0 and the second at offset 0x0a0000 in the flash, however it then wouldn't have a bootloader so you wouldn't be able to do DFU updates and you'd always have to resort to SPI flashing.
In the device you buy, there is a bootloader flashed first ( https://github.com/no2fpga/no2bootloader/tree/master ).
Although you can build the bootloader yourself too, the easiest to get a working device is so just use our "factory" image which you can find at : https://people.osmocom.org/~tnt/ice1usb/factory-202210/ So the file to flash from there is factory-image-20221025.bin . And that should get the device working albeit the firmware will be some factory test firmware. Feel free to follow the TEST-PROCEDURE.txt if you want to check the hardware, or else you can just follow the normal DFU update procedure to flash your device with the latest firmware (no need to update gateware, that one is already good)
As for building the gateware yourself : Which toolchain are you using ? I know the FPGA is very full, but it should fit. I just tried a test build here of master and it worked fine (it didn't meet timing out of the box, you often need to try a feed seeds, but that doesn't influence the resource usage which is what fails in your case).
Cheers,
Sylvain
Hi Csaba,
The build process is error free until that point I copied into my previous mail.
Mmm, make sure that your nextpnr is built with the python bindings enabled. Also which yosys version are you using ?
I tried this morning with the daily build / binary package from oss-cad-suite and it built fine. You can also send me your `.json` file out of yosys so I can narrow down the issue to the yosys or nextpnr side.
But no USB enumeration. I have no LEDs installed yet, so I cant check those.
Maybe I made a soldering error somewhere non obvious.
Yeah, sounds like the hardware has an issue.
Do you see the "new full-speed usb device" detected and then it fails to enumerate, or do you see nothing at all ?
Cheers,
Sylvain
Hi Sylvain,
Also which yosys version are you using ?
Yosys 0.9 (git sha1 1979e0b)
make sure that your nextpnr is built with the python bindings enabled
How to do that? I usually do:
~/nextpnr# cmake . -DARCH=ice40 -- Building with IPO -- Found Python3: /usr/lib/x86_64-linux-gnu/libpython3.8.so (found suitable version "3.8", minimum required is "3.5") found components: Development -- Found Boost: /usr/include (found version "1.71.0") found components: filesystem program_options iostreams system thread regex chrono date_time atomic -- Found Boost: /usr/include (found version "1.71.0") found components: program_options filesystem system -- Configuring architecture: ice40 -- Enabled iCE40 devices: 384;1k;5k;u4k;8k -- Found Python3: /usr/bin/python3.8 (found suitable version "3.8.10", minimum required is "3.5") found components: Interpreter -- IceStorm install prefix: /usr/local -- icebox data directory: /usr/local/share/icebox -- Using iCE40 chipdb: /root/nextpnr/ice40/chipdb -- Configuring done -- Generating done -- Build files have been written to: /root/nextpnr
then "make".
Do you see the "new full-speed usb device" detected and then it fails to enumerate, or do you see nothing at all ?
Nothing at all, "dmesg" is completely empty after several rounds of plug in and/or reset.
Regards, Csaba
Hi,
Yosys 0.9 (git sha1 1979e0b)
That is from 2019 ... you might need something more current :D
make sure that your nextpnr is built with the python bindings enabled
How to do that? I usually do:
Mmm, since it found Python, I'm guessing it was built with them.
Do you see the "new full-speed usb device" detected and then it fails to enumerate, or do you see nothing at all ?
Nothing at all, "dmesg" is completely empty after several rounds of plug in and/or reset.
Ok, then I'd check the connections from the fpga to the USB connector including the connector itself, and also the 1.5k resistor, the two inline resistors and the ESD protection IC. If you post a picture of that area, I can also check if I see something "off".
BTW, if you use IRC, the #osmocom on libra might be easier for that kind of debug.
Cheers,
Sylvain
Hi Sylvain,
Just to get to some conclusion on the build error:
When YoSYS, Nextpnr and Icestorm are all compiled from latest master, the gateware compilation succeeds.
Once I applied your patch:
diff --git a/firmware/ice40-riscv/icE1usb/gps.c b/firmware/ice40-riscv/icE1usb/gps.c index c1ad3a8..4084b08 100644 --- a/firmware/ice40-riscv/icE1usb/gps.c +++ b/firmware/ice40-riscv/icE1usb/gps.c @@ -271,6 +271,7 @@ gps_init(void) return; }
+#if 0 /* If success was at 9600 baud, need to speed up */ if (i == 0) { /* Configure GPS to use serial at 115200 baud */ @@ -287,4 +288,5 @@ gps_init(void)
/* Configure GPS to be GPS-only (no GLONASS/BEIDOU) */ _gps_send("PCAS04,1"); +#endif }
The module is not stuck anymore at "[+] GPS ok at 9600 baud", and now I have "Command>" on uart, and the USB enumeration works (CDC interface is up and running).
let me try it out with a BTS and will report back.
Thanks for the help so far!
Regards, Csaba
Hi Sylvain,
It seems the driver is recognizes the module, but something is off as dahdi_scan always say it is unconfigured, even when it is configured.
This is the dahdi config (cat /etc/dahdi/system.conf):
# Span 1: WCT1/0 "Digium Wildcard TE110P T1/E1 Card 0" (MASTER) CCS/HDB3/CRC4 span=1,1,0,ccs,hdb3,crc4 nethdlc=1-31
# Span 2: icE1usb/1/0 "Osmocom icE1USB Card 1 Span 0" span=2,1,0,ccs,hdb3,crc4 nethdlc = 1-31
This is the dahdi_scan output:
[1] active=yes alarms=RED description=Digium Wildcard TE110P T1/E1 Card 0 name=WCT1/0 manufacturer=Digium devicetype=Digium Wildcard TE110P T1/E1 location=PCI Bus 03 Slot 01 basechan=1 totchans=31 irq=0 type=digital-E1 syncsrc=0 lbo=0 db (CSU)/0-133 feet (DSX-1) coding_opts=HDB3 framing_opts=CCS,CRC4 coding=HDB3 framing=CCS/CRC4 [2] active=yes alarms=UNCONFIGURED description=Osmocom icE1USB Card 1 Span 0 name=icE1usb/1/0 manufacturer=osmocom devicetype=icE1usb location= basechan=32 totchans=31 irq=0 type=digital-E1 syncsrc=0 lbo=0 db (CSU)/0-133 feet (DSX-1) coding_opts=HDB3 framing_opts=CCS,CRC4 coding= framing=CAS [3] active=yes alarms=UNCONFIGURED description=Osmocom icE1USB Card 1 Span 1 name=icE1usb/1/1 manufacturer=osmocom devicetype=icE1usb location= basechan=63 totchans=31 irq=0 type=digital-E1 syncsrc=0 lbo=0 db (CSU)/0-133 feet (DSX-1) coding_opts=HDB3 framing_opts=CCS,CRC4 coding= framing=CAS
And this is the kernel log for "systemctl restart dahdi.service":
[15:02:21] usbcore: deregistering interface driver icE1usb-GPSDO [15:02:21] icE1usb-GPSDO 2-1:1.4: entering ice1usb_gpsdo_disconnect [15:02:21] usbcore: deregistering interface driver icE1usb [15:02:21] icE1usb 2-1:1.1: entering ice1usb_disconnect [15:02:21] dahdi: disable_span: span 3 [15:02:21] icE1usb 2-1:1.1: entering e1u_d_shutdown [15:02:21] icE1usb 2-1:1.0: entering ice1usb_disconnect [15:02:21] dahdi: disable_span: span 2 [15:02:21] icE1usb 2-1:1.0: entering e1u_d_shutdown [15:02:21] icE1usb-GPSDO 2-1:1.0: entering ice1usb_gpsdo_probe [15:02:21] icE1usb-GPSDO 2-1:1.1: entering ice1usb_gpsdo_probe [15:02:21] icE1usb-GPSDO 2-1:1.4: entering ice1usb_gpsdo_probe [15:02:21] icE1usb-GPSDO 2-1:1.4: icE1usb firmware build: 'icE1usb-fw-0.2-71-gf1e228d-dirty built Sat 16 Sep 2023 12:33:36 PM CEST on ubuntu' [15:02:21] icE1usb-GPSDO 2-1:1.5: entering ice1usb_gpsdo_probe [15:02:21] icE1usb-GPSDO 2-1:1.5: Unsupported Interface Class/SubClass fe/01 [15:02:21] usbcore: registered new interface driver icE1usb-GPSDO [15:02:21] icE1usb 2-1:1.0: entering ice1usb_probe [15:02:21] icE1usb 2-1:1.0: altsetting off=0, on=1 [15:02:21] icE1usb 2-1:1.0: Maximum FTS: 9 [15:02:21] icE1usb 2-1:1.1: entering ice1usb_probe [15:02:21] icE1usb 2-1:1.1: altsetting off=0, on=1 [15:02:21] icE1usb 2-1:1.1: Maximum FTS: 9 [15:02:21] icE1usb 2-1:1.5: entering ice1usb_probe [15:02:21] icE1usb 2-1:1.5: Unsupported Interface Class/SubClass fe/01 [15:02:21] usbcore: registered new interface driver icE1usb
dahdi-linux and dahdi-tools are latest master from the Osmocom git.
What am I missing?
Regards, Csaba