Imx-loader imx_usb how to build statically linked

Hi
I tried to bulid a production package for our factory an like to include the imx_usb tool.
Therefore I tried to build it with the recipe imx-loader_git.bb « imx-loader « recipes-devtools - meta-toradex-nxp.git - Toradex BSP layer, recipes for NXP based modules
I struggle to deliver the tool because of the depending shared libs and is pathes to my yocto workspace.
I saw that in the Toradex Easy Installer Download (1.8) you deliver the imx_tool statically linked.
It the recipe to do so available?
Best regards
Stefan

Hi Stefan. You can access our Easy Installer meta layer in GitHub - toradex/meta-toradex-tezi: Meta layer to build Toradex Easy Installer images . We use the recipe tezi-run-metada to install imx_usb. Your best approach however would be to build imx_ubs yourself from source and add the binary through a simple recipe.

Hi,
I came across to this ;
the yocto recipe for imx_usb still point to commit ‘138c0b25a4df6bc25567882ba80337543c22fd93’
which is quite old (from 2017). As far as I understand, this is also the
version that is used to build the imx_usb shipped with tezi recovery scripts.

It is worth to notice that this named version correctly works with a recent uboot (2022.04) from mainline.

However, when taking imx_usb master (latest commit being 30b43d69770cd69e84c045dc9dcabb1f3e9d975a), this does not work.

With an imxull board, when going to the second vid/pid configuration, imx_usb
fails with “status failed”.

Thus bumping the version in the recipe is not a good idea, without some extra work to find out
what’s going wrong.

Best regards

Hi @tbultel ,

Thanks for the input on the imx_usb version. We’ll report it to the BSP team for them to have a look.

Best regards,
Guilherme

Your welcome.
However, from what I have read, imx_usb is no longer maintained, and has been replaced by ‘uuu’ from the mfgtools.
I just managed to use it, it is much more flexible and user friendly. A uboot with auto start of fastboot
(when booting from USB/OTG is detected) is required, though.

here is how I patched it to do so:

index ba4e0df2c2..9ddf7da7dc 100644
@@ -195,6 +195,14 @@ int board_late_init(void)
 	}
 #endif /* CONFIG_CMD_USB_SDP */
 
+#ifdef CONFIG_CMD_FASTBOOT
+	if (is_boot_from_usb()) {
+		printf("Fastboot mode\n");
+		env_set("bootdelay", "0");
+		env_set("bootcmd", "fastboot -l ${loadaddr} usb 0");
+	}
+#endif /* CONFIG_CMD_FASTBOOT */
+
 #if defined(CONFIG_DM_VIDEO)
 	setup_lcd();
 #endif

Best regards
Thierry

1 Like