How do I use the MGFTool in Ubuntu?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I use the MGFTool in Ubuntu?

2,625 Views
m4l490n
Contributor V

Hello everybody

I downloaded the MFGTool and there is no reference in the documentation about how to use the tool on linux. I'm running ubuntu natively and don't have access to a windows machine so I'd like to know how to use the tool in ubuntu.

Thanks!!

Labels (3)
0 Kudos
8 Replies

1,350 Views
gary_bisson
Senior Contributor III

Hi,

As a FYI, there are some solutions to do the same as the MFG Tools under Linux.

First, for booting the board from USB Recovery Mode, loading the bootloader, kernel and MFG ramdisk, there is the imx_usb_loader:

GitHub - boundarydevices/imx_usb_loader: Usb loader for imx51/53/6x

This tool is actually even integrated in Yocto so you can build it for you host:

meta-fsl-arm/recipes-devtools/imx-usb-loader at master · Freescale/meta-fsl-arm · GitHub

Then the utp_com tool allows to send the same command as in the MFGTools. You can execute scripts, flash partition using pipes etc...

GitHub - ixonos/utp_com: utp_com tool is used to send commands to hardware via Freescale's UTP proto...

Hope this helps.

Regards,

Gary

0 Kudos

1,350 Views
m4l490n
Contributor V

GaryBisson​ thanks for helping!

I cloned the utp_com but when running make I get the following error:

gcc -c -o utp_com.o utp_com.c -I. -Wall -O2

utp_com.c:24:25: fatal error: scsi/sg_lib.h: No such file or directory

#include <scsi/sg_lib.h>

                         ^

compilation terminated.

make: *** [utp_com.o] Error 1

Do you know what else do I need to compile it?

Thanks!!

0 Kudos

1,350 Views
gary_bisson
Senior Contributor III

Hi,

Yes you need to install the libsgutils2-dev package in order to build this tool.

Regards,

Gary

0 Kudos

1,350 Views
m4l490n
Contributor V

Thanks for helping GaryBisson

Could you please explain how to load the MFG bootloader, MFG kernel and MFG ramdisk with the imx_usb_loader? because in the link that you posted nothing is explained about this. I'm able to load the u-boot using ./imx_usb u-boot.imx but I don't know how to load the kernel, initramfs and dtb.

Thanks again for your help!

0 Kudos

1,350 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Manuel,

The MFGTool only runs on Windows systems. So, in order to download the compiled operating systems to the target using a Linux host, the options are downloading the entire .sdcard image file to a SD card, or manually creating the partitions and storing the proper data on each partition as mentioned on the documentation (i.MX Linux User's Guide and Freescale Yocto Project User's Guide).

Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,350 Views
m4l490n
Contributor V

Hi Carlos

Thanks for helping! Just one question. What if I don't have sdcard slot? Because this is a custom board and it doesn't have one. I just have the flash memory soldered in the board. So, how can I store the image in there? Because I've noticed in all documentation that it is assumed that the board has a sd card slot and there is no information about how to use the serial downloader with MFGTool.

Thanks!!

0 Kudos

1,350 Views
fabio_estevam
NXP Employee
NXP Employee

Manuel,

You can flash the eMMC card via UMS or DFU utilities in U-boot.

We use UMS to program U-boot into the eMMC of imx6sl warp board:

git.denx.de Git - u-boot.git/blob - board/warp/README

0 Kudos

1,350 Views
m4l490n
Contributor V

FabioEstevam​ thanks for helping!

I figured out that DFU support is not enabled in the u-boot we are using. The thing is that going through the documentation, and looking at / include / configs / warp.h​ I can see that DFU have to be enabled. I added the following to my .h file

#define CONFIG_USB_FUNCTION_DFU

#define CONFIG_CMD_DFU

#define CONFIG_DFU_MMC

#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M

#define DFU_DEFAULT_POLL_TIMEOUT 300

But I'm getting the following errors:

common/built-in.o: In function `do_dfu':

/home/m4l490n/uboot-imx/common/cmd_dfu.c:29: undefined reference to `dfu_init_env_entities'

/home/m4l490n/uboot-imx/common/cmd_dfu.c:35: undefined reference to `dfu_show_entities'

/home/m4l490n/uboot-imx/common/cmd_dfu.c:41: undefined reference to `g_dnl_clear_detach'

/home/m4l490n/uboot-imx/common/cmd_dfu.c:42: undefined reference to `g_dnl_register'

/home/m4l490n/uboot-imx/common/cmd_dfu.c:44: undefined reference to `g_dnl_detach'

/home/m4l490n/uboot-imx/common/cmd_dfu.c:50: undefined reference to `dfu_usb_get_reset'

/home/m4l490n/uboot-imx/common/cmd_dfu.c:67: undefined reference to `usb_gadget_handle_interrupts'

/home/m4l490n/uboot-imx/common/cmd_dfu.c:70: undefined reference to `g_dnl_unregister'

/home/m4l490n/uboot-imx/common/cmd_dfu.c:72: undefined reference to `dfu_free_entities'

/home/m4l490n/uboot-imx/common/cmd_dfu.c:77: undefined reference to `g_dnl_clear_detach'

arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696

arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696

arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696

arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696

arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696

arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696

arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696

arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696

arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696

arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not found in the linker script

arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation

make: *** [u-boot] Error 1

If I remove "CONFIG_CMD_DFU" from the .h file (leaving my .h as the wrap.h file ) it compiles fine but I still can't run the "=> dfu 0 mmc 0" command. If I enter "=> dfu" in the u-boot shell it says:

Unknown command 'dfu' - try 'help'

Do you know what else do I need to add to enable DFU in the u-boot I'm using?

By the way I'm using freescale u-boot (git://git.freescale.com/imx/uboot-imx.git) and I checked out the tag "rel_imx_4.1.15_1.1.0_ga" wich is the one I'm required to work on.

Thanks!

0 Kudos