Ubuntu 22.04 (Kernel 6.5) PCAN-Driver 8.17.0 (CharDev) -> ERROR: could not insert 'pcan': Exec format error

This forum covers PCAN-Linux and Linux development issues concerning our products
Locked
aserbremen
Posts: 3
Joined: Thu 7. Mar 2024, 18:45

Ubuntu 22.04 (Kernel 6.5) PCAN-Driver 8.17.0 (CharDev) -> ERROR: could not insert 'pcan': Exec format error

Post by aserbremen » Fri 8. Mar 2024, 09:38

Dear Peak Support,

I am trying to install chardev peak 8.17.0 driver in order to use PCAN-USB on a fresh Ubuntu 22.04 install. With the preinstalled gcc-11, the make fails with error:

Code: Select all

gcc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
According to the topic found in this forum viewtopic.php?f=59&t=7337, I installed gcc-12. The building of the library seems to work now.

For console output of `make NET=NO_NETDEV_SUPPRT` see attached txt file.
For completeness I attached the output of `sudo make install` as well.

Afterwards I cannot run `sudo modprobe pcan`. I get the following error:

Code: Select all

modprobe: ERROR: could not insert 'pcan': Exec format error
modprobe: ERROR: ../libkmod/libkmod-module.c:990 command_do() Error running install command 'modprobe --ignore-install pcan' for module pcan: retcode 1
modprobe: ERROR: could not insert 'pcan': Invalid argument
Attachments
peak8.17.0_sudo_make_install.txt
(4.37 KiB) Downloaded 440 times
peak8.17.0_make_NO_NETDEV_SUPPORT.txt
(17.27 KiB) Downloaded 421 times

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: Ubuntu 22.04 (Kernel 6.5) PCAN-Driver 8.17.0 (CharDev) -> ERROR: could not insert 'pcan': Exec format error

Post by M.Maidhof » Fri 8. Mar 2024, 10:09

Hi,

please do the following steps:

- sudo apt update
- sudo apt upgrade
- sudo reboot

now build the driver again.

regards

Michael

aserbremen
Posts: 3
Joined: Thu 7. Mar 2024, 18:45

Re: Ubuntu 22.04 (Kernel 6.5) PCAN-Driver 8.17.0 (CharDev) -> ERROR: could not insert 'pcan': Exec format error

Post by aserbremen » Fri 8. Mar 2024, 10:28

Thanks for the quick response! The `sudo modprobe pcan` command works and the PCAN-USB seems to be registered correctly under /dev/pcanusb32.

I am not sure where exactly my mistake lies. Because I checked in my bash_history and I performed

- sudo apt update
- sudo apt upgrade

and rebooted in the meantime as well after installing the gcc-12.

Best regards
Andreas

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: Ubuntu 22.04 (Kernel 6.5) PCAN-Driver 8.17.0 (CharDev) -> ERROR: could not insert 'pcan': Exec format error

Post by M.Maidhof » Fri 8. Mar 2024, 10:34

Hi,

this is a typical error when the loaded kernel doesn't fit to the kernel headers. This happens when you don't reboot after a kernel update.

regards

Michael

aserbremen
Posts: 3
Joined: Thu 7. Mar 2024, 18:45

Re: Ubuntu 22.04 (Kernel 6.5) PCAN-Driver 8.17.0 (CharDev) -> ERROR: could not insert 'pcan': Exec format error

Post by aserbremen » Fri 8. Mar 2024, 10:37

Hi Michael,

so to avoid this, I would have to reboot after installing gcc-12 directly? And then sudo apt update & upgrade. Or is there another order which would prevent this behavior?

Thanks for the quick response again
Andreas

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: Ubuntu 22.04 (Kernel 6.5) PCAN-Driver 8.17.0 (CharDev) -> ERROR: could not insert 'pcan': Exec format error

Post by M.Maidhof » Fri 8. Mar 2024, 10:58

Hi,

simply reboot when there was a kernel update.

regards

Michael

Locked