Lattice iCEcube2 installation on Debian
Last updated: Dec 8, 2023
Lattice iCEcube2 FPGA IDE installation on Debian
Summary
I had a dependancy issue when trying to install the Lattice semiconductor iCEcube2 FPGA IDE The solution is to install a 32-bit version of the libpng package and create a soft link to it in /usr/lib.
The next problem was that the license would not recognise the MAC address I gave for my network interface card when obtaining the license file from Lattice. The solution was to change the name of my network interface card to ’eth0'.
The libpng problem
I repeatedly got this error message when trying to install the Linux version of iCEcube2 from the downloaded file iCEcube2setup_Dec_10_2020_2012.
error while loading shared libraries: libpng12.so.0
I tried installing libpng from the Ubuntu repository. I tried building the libpng12.so.0 library from the sourceforge repository.
Then I started getting a:
wrong ELFCLASS64
message. Why is there an Elf in my machine? ELF stands for executable linked file. 64 means it is 64-bit. Here’s a clue. The iCEcube2 installation wants a 32-bit libpng file.
With this info, I got some help from Stackoverflow here
A solution
Download whatever version of the 32-bit the libpng library that is available. Then create a soft link to the filename that the installation is looking for. We are creating a ‘fake’ libpng12.so.0.
To find a 32-bit libpng that we can install type this:
aptitude search libpng
I’m using aptitude as my package manager. Look for a libpng package ending in i386. In my case, the file is called ’libpng16-16:i386’.
I also tried to find the package using apt:
apt search libpng
This doesn’t explicitly return the i386 version as using aptitude does. I’ve read that you can just add ‘:i386’ to the end of a 64-bit package name to get the 32-bit version. Or, you could install aptitude and find the package explicitly.
Install the 32-bit libpng package and create a link to libpng12.so.0 in the same directory as the package you just installed. There is a separate directory for 32-bit installations on my Debian installation, so there’s no danger of overwriting a 64-bit library with a 32-bit library.
On my distribution, the 32-bit libpng library went to:
/usr/lib/i386-linux-gnu
The commands I used to install and link the new 32-bit file to a bogus libpng12.so.0 are:
sudo aptitude install libpng16-16:i386
sudo ln -s /usr/lib/i386-linux-gnu/libpng16.so.16.37.0 libpng12.so.0
The next trick is to get the licence to work…
The license problem
I repeatedly got a message that the MAC address supplied for my license was incorrect.
To find the MAC address of the network interface card (NIC) required to get my single machine license from Lattice, I used the command:
ip a
Then entered the MAC address for my NIC. Got the license. Started the software. Told I didn’t have the correct MAC address for the machine with that exact MAC address.
Wasted a few hours on this one.
Credit where it’s due. This site gave me the tip I needed to fix the licensing problem:
Lattice iCEbreaker2 looks for an NIC with the name eth0. Only eth0. Nothing else is accepted. The error message doesn’t tell you this.
The fix? Change the name of your NIC to eth0.
To do this, create a udev rule that renames the MAC address of your NIC to eth0. Use your favourite editor. I use vim. I’ve used vim for years. Mainly, because I can’t figure out how to exit from it. That’s a vim joke.:
sudo vim /etc/udev/rules.d/10-net-naming.rules
Put this text into your new file, changing the address to be the NIC address that is registrered to your license:
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="aa:bb:cc:dd:ee:ff",
NAME="eth0"
To get the new udev rule to take effect, I couldn’t find any other way than to reboot. I tried various suggestions from Stackoverflow on how to make a udev rule take effect without a reboot, but none of them worked.
After reboot, running ‘ip a’ showed that my NIC was now called eth0.
iCEbreaker2 runs!
That was an unreasonable struggle.
I got an open source toolchain to run with my little iceFUN board board without major drama. I’m just getting started with FPGAs. I’d like to have a play with iCEbreaker2 to see what it has that the open source tools don’t. So far, all it’s offered is A World of Installation Pain.