Hi,
Is there a howto guide or similar documentation about how to go about applying a custom patch to toradex kernel built using yocto?
Specifically I would like to update the 1-wire drivers because I have seen that certain 1-wire devices (e.g. DS28E04-100) do not work on older kernels, but do on more recent kernels.
Before I start trying to patch the 1-wire drivers using a recent upstream kernel, please advise whether there is a guide and recommended procedure for doing this? Are there specific upstream toradex-preferred version of the kernel I should stick to?
Hardware/OS details:
- Toradex Colibri iMX6ULL 512MB V1.1A
- Custom carrier board (similar to Iris)
- BSP 3
- Kernel version: 4.14.170-3.0.4+gbaa6c24240a4 #1 SMP Fri May 26 01:16:37 UTC 2023
Thank you!
G
1 Like
Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!
Did you like my answer?

Hello,
To apply a custom patch to the Toradex kernel using Yocto for updating the 1-wire drivers, you would typically follow these steps:
-
Create the Patch: First, you need to create a patch file that contains the differences between the current 1-wire driver in your kernel and the updated version you wish to use. This can be done by comparing the source code of the two versions and generating a diff file. Ensure your patch is compatible with the kernel version you are using.
-
Add the Patch to Your Yocto Layer: Once you have your patch file, you should add it to your custom Yocto layer. Create a directory within your layer to store your patches if it doesn’t already exist, typically under recipes-kernel/linux/linux-toradex-<version>/
.
-
Modify the Recipe to Include the Patch: In your custom Yocto layer, you’ll need to create or edit a .bbappend
file for the linux-toradex
recipe. The name of this file should match the recipe version you are targeting, for example, linux-toradex_4.14%.bbappend
for kernel version 4.14. In this file, you’ll instruct Yocto to apply your patch by adding a line to the SRC_URI
variable, like so:
SRC_URI += "file://your-patch-name.patch"
Ensure your patch file’s path is relative to the SRC_URI
entry.
-
Apply the Patch During the Build: Yocto will automatically apply the patch during the build process. Ensure that your patch applies cleanly without errors. If there are errors, you may need to adjust your patch or resolve conflicts manually.
-
Rebuild Your Image: With the patch added to your recipe, you can now rebuild your Yocto image. The build process should incorporate the patched 1-wire driver into the kernel.
Regarding the kernel version and compatibility, since you are working with BSP 3 and kernel version 4.14.170, it’s essential to ensure that the patch you create or obtain is compatible with this kernel version. While updating drivers from a more recent kernel version, compatibility issues may arise due to changes in the kernel’s internal APIs or structures. Therefore, it might be necessary to backport the driver, adjusting the code to fit the older kernel’s context.
For the Colibri iMX6ULL modules, sticking to
Please, also check if these links can help you solve your problem:
Custom meta layers, recipes and images in Yocto Project (hello-world examples) | Toradex Developer Center.