How to use mfgtool 2 (L3.14.52_1.1.0) to flash eMMC on an imx7sabre sdb

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

How to use mfgtool 2 (L3.14.52_1.1.0) to flash eMMC on an imx7sabre sdb

10,127 Views
daweichen
Contributor III

Hi NXP,

I have an i.MX7 SABRE SDB with an eMMC memory chip installed (SD3 port).  I would like to use the Yocto Build system to create a Linux /BSP boot image for i.MX7SBARD SDB and flash the boot image to the eMMC chip.

Here is what I have done.

1. Downloaded and installed L3.14.52_1.1.0_ga-mfg-tools from NXP.

3. Set SW3 on the SDB to enable the serial download for mfgtool.

4. Leave UICfg.ini in default setting.

5. Modified the default cfg.ini - changed [LIST] "name" and [variable] "mmc"

6. Executed MftTool2.exe and got an error code 4.  (I was hoping to program the pre-built image that came with the mfgtool)

Questions:

1. What bitbake commands  I need to run to create the binary files for the eMMC chip?

       a. So far I have only run "bitbake fsl-image-machine-test" to generate a SDCARD image.

2. What additional files I need to get the L3.14.52_1.1.0_ga-mfg-tools to program the binary files to eMMC?

3. Could NXP help with the cfg.ini file?

4. Is there a good document that explains how to modify cfg.ini file?  Documents from the mfgtool package appear to be too simplified.  Example: there is no discussion on the [variable] section.

Thank you very much,

===========

cfg.ini file

============

[profiles]
chip = Linux

[platform]
board = SabreSD

[LIST]
name = eMMC

[variable]
board = sabresd
mmc = 2
sxuboot=17x17arm2
sxdtb=17x17-arm2
7duboot=sabresd
7ddtb=sdb
6uluboot=14x14ddr3arm2
6uldtb=14x14-ddr3-arm2
ldo=
plus=
initramfs=fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot
seek = 1
sxnor=qspi2
7dnor=qspi1
6ulnor=qspi1
nor_part=0

Labels (2)
12 Replies

4,086 Views
waynelou
Contributor I

Hi Dawei,

Could you kindly share the steps for flashing image to emmc by mfgtool?

BR,

Wayne

0 Kudos
Reply

4,086 Views
daweichen
Contributor III

Hi Wayne,

I assume you have a NXP i.MX7D SABRE SDB board and an eMMC chip installed at the SD3 port.

Here are the steps I went thru.

1. Download the L3.14.52_1.1.0_ga-mfg-tools package to a Windows PC (I have Winodws 7 PC)

2. Extract the package. (I used mfgtools-with-rootfs.tar.gz)

3. Copy four files from the

Yocto BSP output directory ../tmp/deploy/images/imx7dsbresd (1)

to

../mfgtools/Profiles/Linux/OS Firmware/files (2)

(1) u-boot-imx7dsabresd.imx --> (2) u-boot-imx7dsabresd_sd.imx

(1) zImage --> (2) zImage

(1) zImage-imx7d-sdb.dtb --> (2) zImage-imx7d-sdb.dtb

(1) core-image-base-imx7dsabresd.tar.bz2  --> (2) rootfs_nogpu.tar.bz2

A side note 1: Depending which image recipe file you use, the rootfs file name may vary.

In short, the mfgtool needs a u-boot image, a Linux image, a Linux Device Tree binary, and a root file system.

A side note 2: see ucl2.xml for the names of the files expected by the mfg-tools.

4. Verify the target NXP i.MX7D SABRE SDB (USB OTG port) is connected to the host PC and the Windows device manager recognizes the existence of the target device.

5. Verify the DIP switches are in the correct positions.  The smaller one should select MFG (01) and the larger one should select eMMC (01010000).

 

6. Execute the vbs script file - mfgtool2-yocto-mx-sabresd-emmc2(mx7d).vbs.  Click on the file to execute.

7. After the programming is completed, exit the mfgtool and power down the unit.

8.  Change the smaller dip switch to exit MFG mode (10)

9.  Apply power to the target device.

0 Kudos
Reply

4,086 Views
waynelou
Contributor I

Hi Dawei,

Thanks very much for your support! I will try with you flow.

Thanks.

BR,

Wayne

0 Kudos
Reply

4,086 Views
igorpadykov
NXP Employee
NXP Employee

Hi Dawei

no special eMMC build files are needed, image is the same. For

programming please use *.vbs script like mfgtool2-yocto-mx-sabresd-emmc2(mx7d).vbs

Also recommended to use latest 4.1.15 release

http://www.nxp.com/webapp/Download?colCode=IMX6_L4.1.15_1.2.0_MFG_TOOL&appType=license&location=null... 

As additional help please check Linux Guide from Documentation Bundle

http://www.nxp.com/webapp/Download?colCode=L4.1.15_1.2.0_LINUX_DOCS&Parent_nodeId=133769948107170617... 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

4,086 Views
daweichen
Contributor III

Hi igor,

Thank you very much for your prompt response.  I am new to the mfgtool.  Please forgive me if I am not asking intelligent questions.

(1)

For programming please use *.vbs script like mfgtool2-yocto-mx-sabresd-emmc2(mx7d).vbs -- How do I use the .vbs?  What application will execute and how to execute the .vbs file?

(2) "Also recommended to use latest 4.1.15 release" -- I have downloaded mfgtool for L4.1.15 from the NXP I assume this release will also support L3.14.52 BSP image download to the eMMC chip.  (Please correct me if this assumption is incorrect.) 

(3) "As additional help please check Linux Guide from Documentation Bundle".  I have the following questions after going through Section 4.2 of the document.

a.  Do I need "Mfgtools-Rel-[version]_UPDATER.tar.gz." and where to get it?

(4) mfgtool files

a. Do I need to modify the default ucl2.xml and cfg.ini for i.MX7 SABRE SDB?

b. Do I need to create ram kernel and the corresponding U-Boot and normal kernel and the corresponding U-Boot?

(5) I was able to use the mfgtool to download the the default i.MX7 SABRE SDB image to the eMMC chip.

My board successfully booted from the eMMC (SD3 port).  Note: I used the attached configuration files.  I modified them from the default files that came with the package.

(6) "no special eMMC build files are needed, image is the same" -- Does this mean my xxxx.sdcard image can be used as-is to boot from eMMC? 

The next step is to create my own i.MX7 SABRE SDB image file(s) and load them to the eMMC chip.

Will I get all the files I need in ../tmp/deploy/images/{MAHCINE}/ directory for the eMMC programming by after executing "bitbake fsl-image-machine-test"

Do I need to run any of the additional commands below?

$ bitbake fsl-image-mfgtool-initramfs

and/or

$ echo "UBOOT_CONFIG = \"emmc\"" >> conf/local.conf

$ MACHINE=imx6sxsabresd bitbake -c deploy u-boot-imx

Thank you very much!

0 Kudos
Reply

4,086 Views
igorpadykov
NXP Employee
NXP Employee

Hi Dawei

please look at attached Linux Guide, seems most questions will be

clarified with it.

>(6) "no special eMMC build files are needed, image is the same" -- Does this mean

>my xxxx.sdcard image can be used as-is to boot from eMMC? 

right

>Do I need to modify the default ucl2.xml and cfg.ini for i.MX7 SABRE SDB?

clicking on appropriate *.vbs script will run mfg tools automatically and

necessary parameters will be passed to it from that script.

>I have downloaded mfgtool for L4.1.15 from the NXP I assume this release will also

>support L3.14.52 BSP image download to the eMMC chip. 

strictly speaking each Linux BSP release has own MFG Tools release which should be used.

Best regards
igor

0 Kudos
Reply

4,086 Views
daweichen
Contributor III

Hi Igore,

Thank very much for your help.  I think I almost accomplish what I need to do.  I have a few more questions.

I was able to use the mfgtool2-yocto-mx-sabresd-emmc2(mx7d).vbs (Version L3.14.52) script to program a default a bootable Linux OS to the eMMC chip. 

My next step is to program my own BSP image to the eMMC chip. 

How do I feed the xxx.sdcard image to mfgtoolV2, so that it knows how to program the eMMC chip?  

I have read the following documents.

1. Linux User's Guide, Rev. L3.14.52_1.1.0p-ga, 12/2015

2. Freescale Yocto Project User's Guide, Rev. 0, 12/2015

3. MfgToolV2 Factory Operation Manual

4. MfgToolV2 WorkFlow

5. MfgToolV2 Linux or Android Firmware Development Guide

6. MfgToolV2 Update Command List User Guide

The ulc2.xml file from mfgtoolv2 requires the following 5 files for programming the eMMC device on an i.MX7SABRE SDB.

../firmware/u-boot-imx7d%7duboot%_sd.imx

../firmware/zImage

../firmware/%initramfs%

../firmware/zImage_imx7d-%7ddtb%

..files/rootfs_nogpu.tar.bz2

(assume using the existing ucl2.xml)

I think I should replace these 5 files in the mfgtoolv2 sub-directories with what I have build from the Yocto system.

After the completion of a $bitbaek fsl-image-machine-test command, I saw the following files in directory

{BSP directory}/{build directionary/tmp/deploy/images/imx7sabresd/

u-boot-imx7dsabresd.imx

zImage

zImage-imx7d-sdb.dtb

fsl-image-machine-test-imx7dsabresd.tar.bz2 (rootfs)

(missing initramfs file) 

The directory does not have a initramfs file.  Did I miss some steps?

The Freescale Yocto Project User's Guide, Rev. 0, 12/2015 document briefly mentioned the following:

"One way to place an image on a device is to use the MFGTool. The recipes used to build a manufacturing tool image are
linux-imx-mfgtool and u-boot-mfgtool .
To build a manufacturing image do the following -
$ bitbake fsl-image-mfgtool-initramfs"

Do I need to use any of the mfgtool recipe files or execute the bitbake command above?

I probably failed to connect some dots after reading the recommended documents related to the mfgtoolv2.

On the one hand, I was made aware that the *.sdcard image could be used directly to program the eMMC chip, on the other hand the mfgtoolV2 related docs and the ucl2.xml file suggest multiple files are required.

The Linux User's Guide, 4.1 explains 4 files are required to boot and run an execute an Liunux OS Image - U-Boot , zImage, DTB, and rootfs. Section 4.2 of the guide briefly explains the usage of mfgtool.  Section 4.5.11 of the guide explains how to enable serial download mode for the mfgtool. Section 4.5.5 of the guide explains the dip switch settings for booting from the eMMC chip.

The Freescale Yocto Project User's Guide, Section 5.5 very briefly mentioned U-Boot configuration for U-Boot eMMC.  Section 6.2 briefly discusses 2 or 3 mfgtool recipes.  Both sections do not seem to provide much discussion on the mfgtool.  One statement in the guide points the reader to the "Serial download mode for the Manufacturing Tool" section in the Linux User Guide doc.

Could you please kindly help me identify the steps I have missed and/or specific sections of a doc I should have paid attention? 

Thank you very much,

Dawei

0 Kudos
Reply

4,086 Views
igorpadykov
NXP Employee
NXP Employee

Hi Dawei

xxx.sdcard image is not used by Mfg Tool, it can be flashed
using sect.4.3.2 Copying the full SD card image Linux User's Guide.
initramfs file is used by Mfg Tool itself (it is small linux image), it is built
using sect.6.2 Manufacturing Tool, MFGTool Freescale Yocto Project User's Guide.
It should be rebuilt when new board is used to run Mfg Tool on it,
with changed related to for example ddr settings.

For Yocto and uboot questions one can refer to dedicated resources

Freescale Yocto Project main page 

Documentation < U-Boot < DENX 

Best regards
igor

0 Kudos
Reply

4,086 Views
daweichen
Contributor III

Hi igor,

Thank you for clarifying the ****.sdcard image usage with respect to the mfgtool. 

My plan is to use the mfgtool to program my image to the eMMC. 

I assume I need to supply the 5 files for programming the eMMC device on an i.MX7SABRE SDB. (As mentioned previously)

../firmware/u-boot-imx7d%7duboot%_sd.imx

../firmware/zImage

../firmware/%initramfs%

../firmware/zImage_imx7d-%7ddtb%

..files/rootfs_nogpu.tar.bz2

What's the appropriate sequence of bitbake commands i need to run to get the files I need for programming the eMMC?

Do I execute the following two commands below

$ bitbake fsl-image-machine-test    (create a BSP image)

$ bitbake fsl-image-mfgtool-initramfs  (create a initramsfs)

or

$ bitbake fsl-image-machine-test

$ bitbake linux-imx-mfgtool

$ bitbake u-boot-mfgtool

$ bitbake fsl-image-mfgtool-initramfs

Do I need to worry about "The Freescale Yocto Project User's Guide, Section 5.5 U-Boot eMMC configuration" ?

Thank you very much,

Dawei

0 Kudos
Reply

4,086 Views
igorpadykov
NXP Employee
NXP Employee

Hi Dawei

after image building for Sabre board files should be

placed to ../files/ folder

for custom board files in both firmware (in../firmware/)

and ../files/ folder should be replaced

Suggest to create new threads for yocto/uboot questions

Best regards
igor

0 Kudos
Reply

4,086 Views
daweichen
Contributor III

Thank you, igor.  I have post another question as suggested.

Hi igor,

 

Could you confirm the default fsl-image-machine BSP enables the eMMC chip (mmc2 port)?

The Linux device tree files for i.mx7 sdb seem okay to me.

 

When I tried to use the mfgtoolv2 to program my own image files to the eMMC, the tool reported "No Device Connected" after the message Jumping to  OS image.

 

Thanks,

dawei

0 Kudos
Reply

4,086 Views
igorpadykov
NXP Employee
NXP Employee

yes emmc is enabled.

Best regards
igor

0 Kudos
Reply