Apalis-imx8 custom linux kernel module build failed error

Hello,
I’m trying to integrate custom linux kernel module for a frame grabber card from sensoray(module-1012) but I’m keep getting build failure for do_package task.
For that I created custom layer in yocto and in that I’ve my module source code.

In my custom Linux kernel module recipe I also have a FILES_{PN} variable but I think it cannot find its path.
I’m also attaching screenshot of the error.

The hardware boards I’m using are-

  1. Apalis evaluation board v1.1c
  2. Apalis iMX8QM 4GB WB IT v1.1c

Software info -
Reference image from Yocto (kirkstone branch)
Kernel version - 5.15.77-6.2.0-devel+git.458ba358fc45

Please help me, what changes I have to make in my recipe so that it generates .ko file.

I’ll be thankful for any suggestion.

Thanks
Gaurav C.

Hi @gaurav,

Have you already verified if sensoray driver is working ? If not it is best if you work directly with kernel source code and check driver working and there after replicate changes in yocto to generate final image.

We don’t have step by step documentation but please check below link for a reference document which is bit outdated and is for Apalis iMX6. Same you need to adapt for Apalis iMX8.
https://www.sensoray.com/wiki/index.php/1012_TORADEX

To compile kernel outside yocto please follow below link

Best Regards
Ritesh Kumar

Thanks @ritesh.tx for the reply I followed the process suggested by you and it was helpful.
I cloned the linux-toradex repo and checkout the branch for same kernel version.
Sensoray gives two drivers when I downloaded the tar file .
Module 1 by name vbuf1 failed to build and was throwing some errors but vbuf2 build is successful but running insmod throwing some errors.
Please go through the attachments I think it will help you.
If you have any suggestion please share it i’ll try to implement it.
attachments.zip (1.4 MB)

Thanks
Gaurav

Hi @gaurav,

Are you still compiling driver outside kernel tree? Please note frame grabber driver is already present in kernel source
https://git.toradex.com/cgit/linux-toradex.git/tree/drivers/media/pci/tw686x?h=toradex_5.4-2.3.x-imx

Additionally please take reference from below post

Best Regards
Ritesh Kumar

Thanks @ritesh.tx now my driver is working and I can actually see my camera output by running gstreamer pipeline.

I was able to solve it using u-boot env variables set during boot solved in below thread

If you can help me answer why do we need to set these args that’d be really helpful.

Thanks
Gaurav C.

Hi @gaurav,

pci-nomsi simply disable use of Message Signaled Interrupts. It depends on kind of device which is being attached to PCIe bus. We did not dig deep but we found with this parameter tw6869 chip work stable.

Other parameter increase the coherent memory ppol which will be used during dma transfer. Since Sensoray 1012 support 8 channel of video input it is required to increase the memory size for proper data flow.

Best Regards
Ritesh Kumar