Installing MCUXpresso as a .rpm package in Fedora 34

Discussions related to the firmware code development
Post Reply
oh1fss
Posts: 65
Joined: Mon May 04, 2020 11:53 am

Installing MCUXpresso as a .rpm package in Fedora 34

Post by oh1fss » Tue Aug 31, 2021 10:34 am

The MCUXpresso is officially supported only as a Debian .deb package. I use mainly Fedora 34, which is a .rpm based system. Below I describe how the .deb package can be extracted from the official installation file, how it is converted to a .rpm package and how it can be installed and how to load the SDK. I don't use the IDE after the SDK is installed, command line is enough for me.

There are instructions (Google MCUXpresso Fedora) on how to extract contents of the .deb package to a Fedora system. However, those method do not register those files into the RPM database. I don't like having orphan files on my system, that's why I use a .rpm package.

There are some errors during the process. However, I can install the SDK and build OpenGD77 firmware with the make command.

Code: Select all

$ mkdir tmp
$ cd tmp/
$ chmod +x ~/Big/Downloads/MCUXpresso/mcuxpressoide-11.4.0_6224.x86_64.deb.bin
$ ~/Big/Downloads/MCUXpresso/mcuxpressoide-11.4.0_6224.x86_64.deb.bin --tar xvf ./mcuxpressoide-11.4.0_6224.x86_64.deb
$ sudo dnf install alien
$ sudo alien -r --scripts mcuxpressoide-11.4.0_6224.x86_64.deb
mcuxpressoide-11.4.0-2.x86_64.rpm generated
If I try install the .rpm now, it will give errors on failed dependencies and conflicting directories:

Code: Select all

        libjli.so()(64bit) is needed by mcuxpressoide-11.4.0-2.x86_64
        libncurses.so.5()(64bit) is needed by mcuxpressoide-11.4.0-2.x86_64
        libpython2.7.so.1.0()(64bit) is needed by mcuxpressoide-11.4.0-2.x86_64
        libtinfo.so.5()(64bit) is needed by mcuxpressoide-11.4.0-2.x86_64
...
        file /lib from install of mcuxpressoide-11.4.0-2.x86_64 conflicts with file from package filesystem-3.14-5.fc34.x86_64
        file /usr/lib from install of mcuxpressoide-11.4.0-2.x86_64 conflicts with file from package filesystem-3.14-5.fc34.x86_64
The failed dependencies can be ignored with the --nodeps flag. The conflicting directories require using rpmrebuild:

Code: Select all

$ sudo dnf install rpmrebuild
$ sudo rpmrebuild -ep mcuxpressoide-11.4.0-2.x86_64.rpm
This opens your editor (see environment variable EDITOR) on the spec file of the .rpm package. At minimum, the following two lines (/lib and /usr/lib) must be deleted:

Code: Select all

$ sudo diff /root/.tmp/rpmrebuild.52722/work/spec.*
138d137
< %dir %attr(0755, root, root) "/lib"
144d142
< %dir %attr(0755, root, root) "/usr/lib"
However, there are other problematic directories as well. For example, if you do not remove the line for /lib/udev, it will be owned by two packages:

Code: Select all

$ rpm -qf /lib/udev/
systemd-udev-248.7-1.fc34.x86_64
mcuxpressoide-11.4.0-2.x86_64
For details, see: https://forums.fedoraforum.org/showthre ... b-conflict

After deleting the lines, save the spec file and exit. The .rpm will be rebuilt. Then you can install the .rpm file:

Code: Select all

$ sudo rpm -ivh --nodeps /root/rpmbuild/RPMS/x86_64/mcuxpressoide-11.4.0-2.x86_64.rpm
Now the IDE starts, but gives various errors when trying to install a SDK. The IDE has a peculiar feature of changing the ownership of its own files to the non-root user running the IDE. This works in lubuntu, but not in Fedora. So you have to change the ownership manually, then you can start the IDE (replace jj by your own username):

Code: Select all

$ sudo chown -R jj /usr/local/mcuxpressoide-11.4.0_6224/ide/
$ cd /usr/local/mcuxpressoide-11.4.0_6224/ide
$ env SWT_GTK3=0 /usr/local/mcuxpressoide-11.4.0_6224/ide/mcuxpressoide
***WARNING: Detected: GTK_IM_MODULE=xim. This input method is unsupported and can cause graphical issues.
***WARNING: Unset GTK_IM_MODULE or set GTK_IM_MODULE=ibus if flicking is experienced. 
...
Now you can install the MK22FN512 SDK in the IDE. I don't need the IDE after that. The OpenGD77 file can be built with the make command. See my earlier post:

https://www.opengd77.com/viewtopic.php?f=16&t=1800

Post Reply