How to set kernel commandline with u-boot-toradex_mainline

Recent changes to u-boot-toradex_mainline seem to make it impossible to change the kernel cmdline. Previously, eg. the vidargs variable could be used but this seems to have gone missing.

On a related note: How to override the preferred version for u-boot without modifying the machine conf? The machine conf that comes with meta-toradex-nxp does not allow overriding of almost any variable which feels like a bug.

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?

:+1: :-1:


Hello,

To set the kernel command line with U-Boot on Toradex hardware using the mainline version, you generally need to modify the bootargs environment variable. This variable is what gets passed to the kernel at boot time. If the vidargs variable or similar has been removed or is not working as expected, you can directly append your desired parameters to the bootargs variable. For example, to set the display resolution, you might do something like this in the U-Boot command line:

setenv bootargs ${bootargs} video=HDMI-A-1:1024x768@60
saveenv

This command appends the video mode setting to the existing bootargs and then saves the environment variables to persistent storage, ensuring the setting is retained across reboots.

Regarding overriding the preferred version for U-Boot without modifying the machine configuration file (machine.conf), one approach is to use local overrides in your own layer. You can create a .bbappend file for the U-Boot recipe in your custom layer. For example, if you want to use a different version of U-Boot, you might create a file named u-boot-toradex_%.bbappend with the following content:

PREFERRED_VERSION_u-boot-toradex = "your_preferred_version"

This tells BitBake to prefer this version of U-Boot when building for any configuration. Note that this approach requires that your layer is included in the build and that it has a higher priority than the layer providing the original U-Boot recipe, which can be adjusted in the layer.conf file of your layer.

Remember, these approaches are based on general practices within the Yocto Project and U-Boot customization. Specific implementations can vary based on the exact versions of the tools and software you are using. If you encounter issues directly related to Toradex hardware or the Torizon platform, ensuring your development environment is correctly set up and that you’re using compatible versions of the software components is crucial.

Best regards, Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Remote Access | Toradex Developer Center.

Hello @TIS_Arne,

Welcome to the Toradex Community!

Let me preface my answer by highlighting that the Scarthgap-based BSP 7.0.0, has not been released yet.
Therefore, breaking changes are likely to happen before the official release.

That being said, you should still be able to pass Kernel arguments by setting them in the tdxargs u-boot variable.

Best Regards,
Bruno