This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: cmemk: invalid module format

Part Number: AM5728

Tool/software: Linux

I'm using the AM5728 SoC with Processor SDK 03.03; I'm getting the following error when I try to load the CMEM kernel module:

cmemk: disagrees about version of symbol module_layout
cmemk: disagrees about version of symbol module_layout
insmod: can't insert '/lib/modules/4.4.41-gf9f6f0db2d/kernel/extra/cmemk.ko': invalid module format

I'm using the Linux 4.4.41 kernel out of the Processor SDK and using the pre-built cmemk.ko module from the very same Processor SDK. Given that both the kernel and pre-built module came out of the Processor SDK I would have expected everything to be in sync.

Is there a compiler option or kernel configuration option I need to ensure is enabled when I build the kernel?

Thanks

  • A little extra information:
    -bash-4.3# modinfo -F vermagic /lib/modules/4.4.41-gf9f6f0db2d/kernel/extra/cmemk.ko
    4.4.41-gf9f6f0db2d SMP preempt mod_unload modversions ARMv7 p2v8

    -bash-4.3# uname -a
    Linux board-0001 4.4.41-gf9f6f0db2d #1 SMP PREEMPT Mon Apr 17 12:16:26 EDT 2017 armv7l GNU/Linux
  • Hello Gerard,

    I've just installed SDK 03.03, and the cmemk module is in sync and it gets loaded successfully. The issue you are seeing about version of symbol module_layout is because of that the module is built against different kernel version different kernel config or your module is not properly compiled. Also there is no such /lib/modules/4.4.41-gf9f6f0db2d/kernel/extra/ directory in the Processor SDK, the path should be /lib/modules/4.4.41-gf9f6f0db2d/extra/. Also if you are rebuilding it don't forget to run the depmod -a command in order to generate the new modules.dep and map files. Also the cmemk module is apart from the kernel modules, you you should issue a make cmem-mod from the Processor SDK's top directory to recompile the cmemk module and install it by make cmem-mod_install command.

    Best regards,
    Kemal

  • Kemal R. Shakir said:

    The issue you are seeing about version of symbol module_layout is because of that the module is built against different kernel version different kernel config or your module is not properly compiled. 

    I was assuming it was the kernel configuration that was the issue but wasn't sure what it could be since the PREEMPT matches.

    Kemal R. Shakir said:

    Also there is no such /lib/modules/4.4.41-gf9f6f0db2d/kernel/extra/ directory in the Processor SDK, the path should be /lib/modules/4.4.41-gf9f6f0db2d/extra/

    That path came from the Processor SDK itself: ti-processor-sdk-linux-am57xx-evm-03.03.00.04//linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/lib/modules/4.4.41-gf9f6f0db2d/extra/cmemk.ko

    Kemal R. Shakir said:

     you should issue a make cmem-mod from the Processor SDK's top directory to recompile the cmemk module and install it by make cmem-mod_install command.

    Ok, I'll rebuild the module and report back. I was hoping I could tweak something in the kernel configuration itself to make Processor SDK upgrades a little easier. The goal was to rebuild the kernel and be able to just pull in the latest Processor SDK's prebuilt CMEM kernel module.

    Thanks

  • You can also backup the default config and replace it with your custom one, as explained at this post.