Enable HIDRAW Support on TorizonCore

Hello Toradex team and Toradex community,

Hardware:

uname:

  • Linux verdin-imx8mp-14762752 5.15.77-6.2.0-devel+git.458ba358fc45 #1-TorizonCore SMP PREEMPT Mon Jan 30 16:26:25 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

Images tested:

  • torizon-core-docker-verdin-imx8mp-Tezi_6.2.0-devel-202302+build.5.tar

Guest OS:

  • macOS (M1 Pro ARM64)
  • Linux ubuntu (VM x86_64)

Issue:
I’m trying to get an application running that requires HIDRAW support in the Linux Kernel but TorizonCore doesn’t provide this functionality.

Is it possible to add it manually with a custom tcbuild.yml by adding a Kernel Module or is there an other solution to add this functionality ?

I hope you will be able to help me for this problem.

Kind regards,

M

Hi @unablesalt ,

I’m trying to get an application running that requires HIDRAW support in the Linux Kernel but TorizonCore doesn’t provide this functionality.

I’ve checked and indeed that seems to be the case:

$ cat /etc/os-release
ID=torizon
NAME="TorizonCore"
VERSION="6.2.0-devel-202302+build.5 (kirkstone)"
VERSION_ID=6.2.0-devel-202302-build.5
PRETTY_NAME="TorizonCore 6.2.0-devel-202302+build.5 (kirkstone)"
DISTRO_CODENAME="kirkstone"
BUILD_ID="5"
ANSI_COLOR="1;34"
VARIANT="Docker"
$ zcat /proc/config.gz | grep -i hidraw
# CONFIG_HIDRAW is not set

Is it possible to add it manually with a custom tcbuild.yml by adding a Kernel Module or is there an other solution to add this functionality ?

Yes, you can add the driver on a custom image through TorizonCore Builder/tcbuild.yml just like you said. We can also take customer requests to enable kernel configs by default on future TorizonCore builds for a more long-term solution.

If you decide to do the request keep in mind that it is subject to approval by our internal team, and once that is passed the configs will be first added on future nightly builds of TorizonCore 6.

Let me know if you are interested in doing the request, or if the TorizonCore Builder approach works for you.

Best regards,
Lucas Akira

Hello @lucas_a.tx,

Thank you for your answer! That’s a good news !

Do you have an idea where I can find this specific driver ? I have found this on this link but it’s for a custom yocto recipe…

As to add it for others, you can create the request but if I’m the only one that needs to have this functionality that wouldn’t be interesting for your team to work on.

So if you can help me to make it work through the TorizonCore Builder, no need to create the request.

Best regards,
M

Hi @unablesalt ,

Do you have an idea where I can find this specific driver ? I have found this on this link but it’s for a custom yocto recipe…

You can find the driver code in the Linux kernel source: hidraw.c « hid « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules . This link in particular has the NXP downstream version of the kernel that TorizonCore 6 uses for Verdin iMX8M Plus. With that you can try to compile it by following this article: Building External Kernel Modules With Torizon | Toradex Developer Center

Just to clarify: While you can try to compile and add the HIDRAW driver as an out-of-tree kernel module using TorizonCore Builder, we can’t guarantee that it will work flawlessly or even compile with this method, given that it was made to be an in-tree driver. Sorry if I wasn’t clear before.

As to add it for others, you can create the request but if I’m the only one that needs to have this functionality that wouldn’t be interesting for your team to work on.

Since the driver you’re asking for is part of the Linux kernel, meaning that in general we just need to enable the corresponding config options when building our images, we can do this on customer request without worrying about the number of customers with a similar request. This is our policy for the moment.

If the config options to be added don’t cause any problems to TorizonCore we usually accept them, so feel free to request here if you want. Make sure that you explicitly say the config options to be added when doing so e.g. CONFIG_HIDRAW, CONFIG_NTFS_FS, etc.

Best regards,
Lucas Akira

Hello @lucas_a.tx,

Thank you for your response.

That’s exactly what I thought, I don’t think it’s possible to add the HIDRAW feature that way…

So, is it possible to do the request to the team to add this feature for (next?) nightly build (6.X.Y) ? Explicitly: CONFIG_HIDRAW to work with USB device through HID.

I’ll mark this post as solved since you pointed out the solution, and I’ll update it with the build.

Kind regards.

Maxence

Hi @unablesalt ,

So, is it possible to do the request to the team to add this feature for (next?) nightly build (6.X.Y) ? Explicitly: CONFIG_HIDRAW to work with USB device through HID.

Sure, I’ve sent your request to the team and it will be analyzed in the next few days. It will probably not be included immediately in the next coming nightly build, but most likely in the nightly after the approval. I’ll update here when this happens.

Yes, the nightly builds are TorizonCore 6 builds.

Best regards,
Lucas Akira

1 Like

Hi @unablesalt ,

Just letting you know that USB HID raw support was included in our latest monthly release (TorizonCore 6.2.0-devel-202303-build.6):

$ sudo tdx-info 

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.77-6.2.0-devel+git.5ee7b429cf75 #1-TorizonCore SMP PREEMPT Fri Feb 17 12:53:14 UTC 2023
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/e6438c5c4cc0811f07a76665909c69d6faf318fc8d2015b5539c84fd926bdaf7/0
Distro name:              NAME="TorizonCore"
Distro version:           VERSION_ID=6.2.0-devel-202303-build.6
Hostname:                 verdin-imx8mp-14777535
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0058 V1.1A
Serial number:            14777535
Processor arch:           aarch64
------------------------------------------------------------
torizon@verdin-imx8mp-14777535:~$ zcat /proc/config.gz | grep -i hidraw
CONFIG_HIDRAW=y

Please confirm if you can use the HID raw driver now.
Best regards,
Lucas Akira

1 Like

Hello @lucas_a.tx,

I’ll test it tomorrow morning. Thank you for letting me know.

I’ll post my update tomorrow.

Best.

M

Hello @lucas_a.tx,

I took the time to test the new update (6.2.0-devel-202303-build.6) and I can confirm that my USB device is found and can be use using the HIDRAW driver.

Thank you and the team for the update and the reactivity.

It’s a real pleasure to work with Toradex.

Best,

M

Hi @unablesalt ,

Thanks for the update.

Glad that it got solved.

Best Regards
Kevin

1 Like