So, now that we understand the issue, there are two possible solutions:
- We must use the required custom configured kernel for the product and build all our kernel modules against it.
- Alternatively, we could rebuild the kernel module to match the current kernel the device happens to be running.
Now, in typical embedded Linux projects, you will almost certainly have a custom configured kernel for the target device, one that you must work with. All kernel modules for the product will/must be built against it. Thus, we follow the first approach – we must boot the device with our custom configured and built (5.4!) kernel, and since our kernel module is built against it, it should certainly work now.
We (briefly) covered the kernel build for the Raspberry Pi in Chapter 3, Building the 5.x Linux Kernel from Source - Part 2. Refer back there for the details if required.
Okay, I will have to assume that you've followed...