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.

SK-AM62A-LP: Exec Format Error When Loading g_hid Module for USB HID Setup

Part Number: SK-AM62A-LP

Tool/software:

Hello,

I’m currently working on configuring the Texas Instruments AM62Axx EVM to act as a USB HID device (specifically, a mouse). I have been following the necessary steps, including kernel configuration and module setup, but have encountered an issue when trying to load the `g_hid` module. Below is a summary of the steps I have taken and the issue I am facing:

Steps I Have Taken:

1. Kernel Build and Setup:
- I built the Linux kernel from the TI Processor SDK Linux for AM62Axx (version ti-processor-sdk-linux-edgeai-am62axx-evm-09_02_00_05).
- Kernel version: 6.1.80-ti-g2e423244f8c0
- I followed the build steps for kernel and modules as per the SDK documentation.

2. Module Copy:
- Using SSH, I copied the compiled kernel modules from my development environment (/home/lia/ti-processor-sdk-linux-edgeai-am62axx-evm-09_02_00_05/targetNFS/lib/modules/6.1.80-ti-g2e423244f8c0/kernel/drivers) to the target EVM (/lib/modules/6.1.80-ti-g2e423244f8c0/kernel/drivers).
- After copying, I ran depmod -a on the target EVM to ensure the modules were properly indexed.

3. Error Encountered:
- When I tried to load the g_hid module using modprobe g_hid, I received the following error:

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

- I also ran dmesg | tail -n 20 to check the logs and found the following entry:

Invalid ELF header type: 256 != 1

System Details:
- Kernel Version: 6.1.80-ti-g2e423244f8c0
- SDK: ti-processor-sdk-linux-edgeai-am62axx-evm-09_02_00_05
- Module in Question: g_hid

My Question:
From what I understand, the "Exec format error" and the ELF header mismatch may indicate an issue related to an architecture mismatch or possibly an error during module compilation or transfer. Could this be caused by:
- A misconfiguration in the kernel setup or module build process?
- A potential architecture mismatch (e.g., ARM vs. x86) during the transfer or build?

I would appreciate any advice on how to address this or whether I might need to rebuild the kernel/module with specific flags. If there are any additional steps I should check or configuration options I may have missed, please let me know.

Thank you for your time and support! Kind regards,
Lia