i.MX Manufacturing Tool Customization Guide

31
TM Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. i.MX Manufacturing Tool Customization Guide November 10, 2011 Starle Li Sr. Software Applications Engineer

description

November 10 , 2011. i.MX Manufacturing Tool Customization Guide. Starle Li Sr . Software Applications Engineer. Agenda. Why need to do customization Mfgtool Mechanism Organize Mfgtool files and compose a UCL script Customize firmware Customize host tool - PowerPoint PPT Presentation

Transcript of i.MX Manufacturing Tool Customization Guide

Page 1: i.MX Manufacturing Tool  Customization Guide

TM

Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008.

i.MX Manufacturing Tool Customization Guide

November 10, 2011

Starle LiSr. Software Applications Engineer

Page 2: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 2

Agenda

►Why need to do customization►Mfgtool Mechanism►Organize Mfgtool files and compose a UCL script►Customize firmware►Customize host tool►Deal with issues related to Mfgtool►Seek help►Do a manufacturing oriented design►Mfgtool Road Map

Page 3: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 3

Why Need to customize Manufacturing Tool

►The mechanism of Mfgtool requires customization• Each vendor have themself board design.• Each vendor have difference storage media, such as NAND, eMMC and so on.

►Why use min OS as Mfgtools firmware• Reuse OS drivers. • Reuse OS feature, such as file system, USB stack and application(tar, gzip). • Reduce firmware porting efforts. Tiny difference between Normal OS and

Mfgtool firmware.►To meet your special requirements

• To develop the your own functionality, Mfgtool has to be customized.

Page 4: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 4

How the tool works

► Setup stage1. After a board is powered up, it has nothing to run but ROM. ROM initializes USB

and enumerates it as a dedicated device like HID device(MX23,MX28, MX50, MX6) or Bulk-IO device(MX3x, MX25, MX51, MX53).

2. Once a host detects the device, it will setup the connection with the device. Now the first task for host is to initialize RAM memory. It extract memory initialization code or data from an image (like u-boot) to do the task. It is also possible to use a memory initialization script to get initialization data.

3. After RAM is initialized, the host sends a kernel and mini RAM filesystem to RAM. The host then sends a command to ROM to jump into the kernel.

4. The kernel runs and enumerate USB as a MSC device. Now the device is ready for high speed data transfer.

5. The host runs commands in UCL script one by one.

1 3 4

ROM

Download Firmware

5

MSC UCL Command

2

Init DRAM

Page 5: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 5

Detail Document is in UTP.doc

Reference implement code is in linux-2.6-xxx/drivers/usb/gadget/fsl_updater.clinux-2.6-xxx/drivers/usb/gadget/fsl_updater.h

Uuc:git://sw-git01-tx30.am.freescale.net/linux-uuc.git

Page 6: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 6

Linux Firmware Architecture

►UTP• linux-2.6-xxx/drivers/usb/gadget/file_storage.c

Implement SCSI protocol MFG command is treated as a special case of SCSI command(vendor

specific command)– utp_handle_message is called in do_scsi_command()

► the entry of each UTP command

• linux-2.6-xxx/drivers/usb/gadget/fsl_updater.c Deals UTP protocol

►UUC• Uu.c

Uuc is responsible for command execution in a shell

Page 7: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 7

How to organize Mfgtool files

►Mfgtool components• Configuration files• User images which will be burned into storage media.• Firmwares which are used to communicates with the host to burn user images.

►Mfgtool uses profiles to manage all of the resources• Profiles folder can be found in the same path Mfgtool.exe locates.

The name of “profiles” folder can’t be changed.

Page 8: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 8

How Mfgtool organizes files

► Examples:

Page 9: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 9

Ucl.xml: User configuration list

►All user tasks are defined in the file which consists of a bunch of commands• Command to burn your own image and default files• Command to choose the dedicated storage device

►For detail, please refer to:• Manufacturing Tool UCL user manual.doc

►Example:• <CMD type="push" body="pipe tar -jxv -C /mnt/mmcblk0p1"

file="files/rootfs.tar.bz2">Sending and writting rootfs</CMD>• <CMD type="push" body="frf">Finishing rootfs write</CMD>

Page 10: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 10

Player.ini

►The file is used to set configurations• [PROFILE]

PLAYER=The name of your folder which contains all the files needed in burning process.

– i.e. MX53 Linux Update• [OPERATIONS]

UTP_UPDATE=OS Firmware,120,1– You can replace “OS Firmware” with the name of your own folder, for example,

“ARD” in the diagram in previous slide.• [OS Firmware]

UCL_INSTALL_SECTION=The name of your list in ucl.xml– There are multiple lists in ucl.xml, you can specify one here.

“OS Firmware” here is just an example, which must align with the name in OPERATIONS section.

►The file must be set before running the tool.

Page 11: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 11

Linux firmware

►There are several files act as firmware• u-boot.bin

bootloader• initramfs.cpio.gz.uboot

Min root file system• uImage

kernel►Those files contains command parser and executor

• The command sent from the host is executed by these images.

Page 12: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 12

Log file

►Mfgtool.log is used to record activity of Mfgtool• The file is in the same dir with Mfgtool.exe• The file is very useful for issue-checking.

Page 13: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 13

How to customize firmware

►How to build burner• Set correct build configuration• Add necessary modules

Page 14: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 14

Uboot

►Add Mfgtool config header file in : rpm\BUILD\u-boot_xxx_version\include\configs

►Following MACRO must be defined:• #define CONFIG_MFG• #define CONFIG_INITRD_TAG• #define CONFIG_BOOTDELAY 0 • #define CONFIG_BOOTARGS "console=ttymxc0,115200 "\

"rdinit=/linuxrc“ • #define CONFIG_BOOTCOMMAND "bootm $

{loadaddr}0x90800000"; 0x90800000 is initrd address, you should change it according to your

platform memory configuration. • #define CONFIG_ENV_IS_NOWHERE

avoid read uboot command from storage

Page 15: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 15

Kernel

►Kenel config• In \linux-2.6.X\.config• Must build in USB device and related driver, such as NAND,  SD

Card ... • Must build in mass storage gadget class driver.

CONFIG_USB_FILE_STORAGE=y• Must define CONFIG_FSL_UTP=y • Buit in initramfs support

►Notes:• Disable watchdog in i.mx23, i.mx28, i.mx50, i.mx53 TO2; • For other platforms(i.mx25/51), make sure watchdog is served

CONFIG_WATCHDOG=y CONFIG_SOFT_WATCHDOG=y

Page 16: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 16

ltib

►Add config/platform/imx/imxXX_updater.cf► config/plaftorm/imx/main.lkc,   add uboot new configuration when

PKG_KERNEL_UPDATER defined ► config/platform/imx/main.lkc,   add kernel new configuration when

PKG_KERNEL_UPDATER defined ► you need choose "UUC" package. ► add new cf at config/platform/imx/preconfigs.lkc,  default

imx51_updater.cf if (PCF_PLATFORM_IMX51 && PCF_UPDATER_PROFILE) is selected.

► ./ltib, choose your platform and "mfg firmware profile",  then config/platform/imx/.config imxXX_updater.cf

Page 17: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 17

How to Optimize Power\Size

►In uboot• Close unnecessary clock source, such as display, GPU, etc.• Run lower cpu frequency.

►It is critical since the device may be only powered by USB port• A max 500mA peak current may lead USB to be abnormal.

►Remove unnecessary kernel module, such as Audio, USB host and so on.

Page 18: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 18

How to customize host tool

►Host tool is quite complicated• GUI operation• Command parser and execution• ROM communication(platform related)• USB port management

►There is no a formal doc to describe the tool.• We provide a brief doc for this.

►Mfgtool 2.0 is under development.• We will provide formal doc for this version.

Page 19: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 19

Setup development environment for host tool

►Tools necessary:• Visual Studio 2008 Professional• Windows XP/7 WDK• Windows XP/7 SDK

►Build process• Refer to <Build Requirements.docx> in mfgtools\Apps\MfgTool.exe\docs

Page 20: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 20

How to deal with issues

►There may be some issues during operations• Fail to program devices with certain possibility ratio.• The host tool reports exception or crashes.

►Solution• Analyze mfgtool.log and the output of devices(console log)

Mfgtool.log informs which command failed to run Console log may tell why the command failed

– You have to connect UART port of devices to your PC to get console log• Debug the tool if host tool reports exception or crashes

Setup debug environment for the tool and debug it.

Page 21: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 21

Issues most frequently met

►Failed to burn device using external USB hub• It is very common issue when burning device which only powered by

USB. Here is solution: Check power supply status

– Measure the current value of USB port to see if it exceeds max limitation.– Measure the voltage of i.mx chip

► VBUS from USB port ► MX chip USB PHY 2.5V ► MX chip USB PHY 3.3V ► MX chip core voltage

Check if USB hub is fully compatible with USB specification– It is recommended to use Belkin USB hub– The USB hub must powered by independent power supply(adapter)– No more 3 devices are allowed to be connected to USB hub.

► Too many devices will lead to poor performance and raise failure rate

Page 22: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 22

Issues most frequently met

►Failed to burn device on some certain type PC• Customers may complain Mfgtool works fine on some PCs, but failed on

others.• Solution: require customers to use any PC which meets below

conditions: CPU: Intel E3400 or higher, Frequency: 2GHz+ Memory: 1GB+ OS: Windows XP (SP3)/Windows 7 version.

– Administration account is necessary to install driver (For i.mx35/51/53). USB2.0 root hub is a must, NO USB 1.1 root hub is allowed.

– A PC with both USB2.0 and USB1.1 root hub is not allowed to use Mfgtool.• For detail, please refer to < Manufacturing Tool Factory Operation

manual.docx >

Page 23: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 23

Issues most frequently met

►Mixture of USB 2 and USB1.1 probably share a same USB physical port• Mfgtool can’t figure out

which USB root hub the port belongs to.

Page 24: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 24

Issues most frequently met

►Failed to run commands related to ROM • Commands types

<CMD type="boot" body="BootStrap" file ="u-boot.bin“… <CMD type="load" file="uImage“… <CMD type="jump" >

• Check if DDR memory parameter is correct DDR memory parameter works on Samsung may not work fine on Micron

memory.– It is important since many factories use different memory from multiple suppliers.

Do DDR integrity test to see if there is an issue Try DDR parameter calibration and re-burn devices using the new DDR

parameter.

Page 25: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 25

Issues most frequently met

►Failed to run commands with “push” type• Ex. <CMD type="push" body="pipe….• Refer to UCL doc to see if you use correct commands

Some commands require a bunch of commands to be used– Ex. “frf” command must be followed when a “pipe” comand is issued.

Page 26: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 26

How to seek helps

►Setup a SR• Only available for Tier one customers.

►Seek help in i.mx community• http://imxcommunity.org/group/manufacturing-tool-mfgtool• Search the community to see if it has been solved.• Raise the issue in the community

You will get feedback from Freescale AE, R&D or FAE.

Page 27: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 27

How to get the latest Mfgtool version

►Get it from the latest BSP release• Mfgtool is treated as a BSP feature.

►Get the latest Mfgtool host tool in i.mx community• http://imxcommunity.org/group/manufacturing-tool-mfgtool• We will periodically upload the latest Mfgtool in the community

Page 28: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 28

How to do a manufacturing oriented design

►This is a critical issue which often is ignored• The design must include

A way to boot from USB mode(we call it serial download mode)– Ex. Use key combination to enter USB mode.

• It is strongly recommended to include A way to boot from external SD slot

– Most of devices has an external SD slot– It is vital for end-user to restore their broken firmware– It is very useful for manufacturing

► Can use Mfgtool-SD to do burning work

• Some indicators Ex. LED which can be lightened to indicate the end of burning work.

Page 29: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008.

Mfgtool Road Map

►Mfgtool - USB 2.0• Good portability.• Extension capability• Single device version• Performance optimization

►Mfgtool – SD• Low usage cost• Bring simplicity for development(like PC install OS)• Ucl compatible with Mfgtool-USB.

29

Page 30: i.MX Manufacturing Tool  Customization Guide

TMFreescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008.

Mfgtool Road Map

Mfgtools-SD

Mfgtool-USB - Single port

Mfgtools-USB Multi-port

Stable version

30

2011 Dec 2012 Feb 2011 April 2012 Jul

Page 31: i.MX Manufacturing Tool  Customization Guide

TM