Welcome to the Linux Foundation Forum!

How to cross compile module for Yocto distro

ricbru Posts: 1
edited September 2022 in Kernel Development

Hi, I need help for building a kernel module (for the PL2303 USB-serial converter device) for a custom Yocto distribution.
What I've tried to do has been to compile the pl2303.ko binary file using bitbake and it seems to work, but when I try to load it inside the running OS (issuing the insmod pl2303.ko command) it gives the following error: insmod: ERROR: could not insert module ko/pl2303.ko: Invalid parameters; then I issue the dmesg command and this is the output:
[17585.849506] pl2303: disagrees about version of symbol dev_err
[17585.853980] pl2303: Unknown symbol dev_err (err -22)

The kernel is (uname -a output):
Linux seco-sbc-a62 4.14.78+g15a48d6 #1 SMP PREEMPT Thu Nov 21 08:44:23 UTC 2019 armv7l armv7l armv7l GNU/Linux

I've also tried to compile the sources (pl2303.c/h) directly on the board but it gives this error:
make -C /lib/modules/4.14.78+g15a48d6/build M=/home/root/pl2303 module modules
make[1]: Entering directory '/usr/src/linux-4.14.78'
make[1]: *** No rule to make target 'module'. Stop.
make[1]: Leaving directory '/usr/src/linux-4.14.78'
make: *** [Makefile:10: all] Error 2

I've downloaded and unzipped this file: linux-4.14.78.tar.gz in /usr/src/linux-4.14.78


  • arochester

    Did you see:

    "For technical questions, visit the Community pages to learn how to contact the Yocto Project® community through the mailing lists or IRC channels. You can often get answers from social sites such as Stack Overflow. You might also check the documentation and the Yocto Project wiki."

    Source - https://www.yoctoproject.org/about/contact/


Upcoming Training