2025-04-23 7:26 AM - edited 2025-04-23 7:29 AM
I've been trying to build compatible Android modules (.ko) for my STM32MP25F7-EV1 running OpenSTDroid Distribution. I've successfully built these modules, but I cannot enable them with the `insmod` command because they're incompatible.
insmod: ERROR: could not insert module btusb.ko: Exec format error
I ran `strings btusb.ko | grep vermagic` and it looks like the `btusb.ko` is using a slightly different kernel version than the target's kernel version (6.1.78-00024-ge4076639eb90 for module v.s. 6.1.78-00024-gf31b8a21afa8 for kernel).
vermagic=6.1.78-00024-ge4076639eb90 SMP preempt mod_unload aarch64
__UNIQUE_ID_vermagic330
__UNIQUE_ID_vermagic330
I don't understand where I'm going wrongly. Here's my module build process so far
export BUILD_TOP=$(pwd) /* AOSP root/top directory */
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
export KERNEL_src=${BUILD_TOP}/device/stm/stm32mp2-kernel/linux-stm32mp2
Am I in the wrong kernel folder? Am I building the module incorrectly? Any insight would be helpful.
Target Hardware Platform: STM32MP25F7-EV1
Target Operating System: OpenSTDroid Distribution (st-android-13.0.0-2024-07-31) [Wiki link]
Target Kernel Version: 6.1.78-00024-gf31b8a21afa8