could not insert 'pcan': Exec format error

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
andersonm
Posts: 4
Joined: Mon 15. Nov 2021, 20:30

could not insert 'pcan': Exec format error

Post by andersonm » Thu 17. Feb 2022, 17:09

I have the same problem as here:

viewtopic.php?t=6585&sid=46c6c9cae0daf8 ... 0e878443ff

However, it seems there are two things usually causing this problem:
1. Secure boot being enabled (which I have it disabled)
2. Mismatch between installed kernel headers and actual kernel version (which mine says both are 5.13.0-28-generic)

I have tried 8.13.0 and 8.14.0, and have gotten it to work on other machines before. Is there anything else that can cause this or something I am missing?

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

Re: could not insert 'pcan': Exec format error

Post by M.Maidhof » Fri 18. Feb 2022, 07:50

Hi,

can you please share some more details like output of the make process, uname -a, used pcan hardware type and which kind of PC you are using?

regards

Michael

andersonm
Posts: 4
Joined: Mon 15. Nov 2021, 20:30

Re: could not insert 'pcan': Exec format error

Post by andersonm » Tue 8. Mar 2022, 20:30

Sorry, lost track of this post.

This was happening on a very specific kernel version for Ubuntu 20.04 that I think there was some mismatch in the headers for when I updated to it. It was a very repeatable error, but then 2 days later another kernel upgrade happened and then everything built and installed and worked as normal.

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

Re: could not insert 'pcan': Exec format error

Post by M.Maidhof » Wed 9. Mar 2022, 09:26

Hi,

ok, most likely it was a kernel header mismatch.

regards

Michael

buttewillard
Posts: 3
Joined: Tue 5. Oct 2021, 17:10

Re: could not insert 'pcan': Exec format error

Post by buttewillard » Tue 24. May 2022, 22:16

I need to use secure boot for my application.

osboxes@ThinkPad-P51-Ubuntu-Lab:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
osboxes@ThinkPad-P51-Ubuntu-Lab:~$

I have the same problem. 'sudo modprobe pcan' results in this:
osboxes@ThinkPad-P51-Ubuntu-Lab:~$ sudo modprobe pcan
[sudo] password for osboxes:
modprobe: ERROR: could not insert 'pcan': Operation not permitted
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

I spent the last 8 months working on this application. It was working fine, but now it is broken.

How do I fix this, specifically?

Bob Willard

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

Re: could not insert 'pcan': Exec format error

Post by M.Maidhof » Wed 25. May 2022, 09:25

Hi,

in that case you have to sign the pcan kernel module for your Ubuntu 20.04 system. Please use google for more details on how to sign a kernel module.

regards

Michael

buttewillard
Posts: 3
Joined: Tue 5. Oct 2021, 17:10

Re: could not insert 'pcan': Exec format error

Post by buttewillard » Wed 25. May 2022, 15:46

It works now. Thanks for the prompt response Michael.

buttewillard
Posts: 3
Joined: Tue 5. Oct 2021, 17:10

Re: could not insert 'pcan': Exec format error

Post by buttewillard » Wed 25. May 2022, 17:44

I can now 'modprobe pcan' and the module gets loaded, but the device files are not created:
Attachments
missing_devices_files.png
missing_devices_files.png (116.05 KiB) Viewed 401 times

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

Re: could not insert 'pcan': Exec format error

Post by M.Maidhof » Mon 20. Jun 2022, 09:46

Hi,

which PCAN interfaces are connected to that system?

Post Reply