cancel
Showing results for 
Search instead for 
Did you mean: 

Problem of adding an external out-of-tree Linux kernel module↑

Younjun
Associate II

Hi,

I'm trying to add external out-of-tree module in developer package. (following wiki)

After following wiki, I got error message in board(STM32MP157F-DK2) like this. 

modprobe: ERROR: could not insert 'kernel_module_example': Exec format error

 

There was a difference with wiki while proceeding according to wiki's explanation.

  • In wiki, the "kernel_module_example.ko" is generated in [install_artifact/lib/modules/"<kernel version>"/extra/].
  • But, my .ko file is generated in [install_artifact/lib/modules/"<kernel version>"/updates/]

 

Is there anything else I need to do to add external out-of-tree module?

 

- Ubuntu version (PC) : ubuntu 20.04 lts

- Board : STM32MP157F-DK2

- source code version : 24.11.06 (stm32mp1-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06) 

 

 

Thanks.

Regards, 

Youngjun.

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan SZYMANSKI
ST Employee

Hello @Younjun ,
The update folder is the one by default now instead of extraThe location of your module installation folder is good so.

Did you well sourced your SDK before compilation ? If you make "file <your_module>" do you well see this is ARM32 format ? 

Last thing to check, did you well reinstall your Linux kernel Image as the magic number version changed by recompiling the kernel, so you need to redeploy the Boot Image kernel part as well as all the other modules.

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
Erwan SZYMANSKI
ST Employee

Hello @Younjun ,
The update folder is the one by default now instead of extraThe location of your module installation folder is good so.

Did you well sourced your SDK before compilation ? If you make "file <your_module>" do you well see this is ARM32 format ? 

Last thing to check, did you well reinstall your Linux kernel Image as the magic number version changed by recompiling the kernel, so you need to redeploy the Boot Image kernel part as well as all the other modules.

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hello Erwan.

Thank you for replying.

I sourced SDK before complication.

I am not familiar with the embedded Linux environment, so I ask the following basic questions

  1. How can i check my module file is ARM32 format?
  2. I just following this wiki(Adding an external out-of-tree Linux kernel module).
    In wiki, there is only a description that runs depmod and sync after transferring the external out-of-tree module to the board.
    If so, should I proceed as below for the distribution of external out-of-tree modules?
    1. generate module file (kernel_module_example.ko)
    2. recompiling the kernel
    3. redeploy kernel
    4. run depmod and sync

Is there any documents about external out-of-tree module with recompiling the kernel?

Thansk.

Kind regards,

Youngjun.

Younjun
Associate II

I resolved the problem.

The problem was path setting.

I set the KERNEL_SRC_PATH to another folder.

Younjun_0-1743488521727.png

And, below process in wiki is working.

Thanks.