Programming iMX28 without mfgtool

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Programming iMX28 without mfgtool

1,233件の閲覧回数
stephenhewitson
Contributor III

Hi,

I am trying to make an automated production environment for programming and testing our product. Previously we would call mfgtool from a custom application, which meant that a user was still required to be present during the programming stage, where we wanted if to be under application control.

BitInit is a piece of software that allows the OTP bits to be burned. This is provided with DevSupport.dll that contains a whole load of functionality allowing the iMX28 to be programmed from a C# application.

This is just to help people who are having a similar requirement...

First we need to get the iMX28 to enumerate as a dummy USB harddrive:

CurrentDevice =(DevSupport.DeviceManager.HidDevice)DevSupport.DeviceManager.Instance.FindDevice(typeof(DevSupport.DeviceManager.HidDeviceClass), new ushort?((ushort)5538), new ushort?());

DevSupport.Api.HidApi.DownloadFw dFW = new DevSupport.Api.HidApi.DownloadFw(@"c:\temp\uce_ivt.sb");

CurrentDevice.SendCommand(dFW);


Then we need to wait for the enumeration to complete:

System.Collections.ObjectModel.Collection<DevSupport.DeviceManager.Device> cDevices = new System.Collections.ObjectModel.Collection<DevSupport.DeviceManager.Device>();

while (cDevices.Count == 0)

{

     cDevices = DevSupport.DeviceManager.WpdDeviceClass.Instance.Refresh();

     Thread.Sleep(500);

}

We've now identified the device, but we need the volume too to actually send stuff to it. So we get a list of all the volumes on the PC and find the one that has the same drive letter as the Windows Portable Device we found earlier.

Once we've matched the two together, we can send UTP Commands as per the ucl.xml file.

System.Collections.ObjectModel.Collection<DevSupport.DeviceManager.Device> cVolumes = DevSupport.DeviceManager.VolumeDeviceClass.Instance.Refresh();

foreach(DevSupport.DeviceManager.Device volume in cVolumes)

{

     if (volume.ToString().Contains(cDevices[0].FriendlyName.Replace("\\", String.Empty)))

     {

          DevSupport.DeviceManager.UTP.UpdateTransportProtocol utp = new DevSupport.DeviceManager.UTP.UpdateTransportProtocol((DevSupport.DeviceManager.Volume)volume);

          utp.UtpCommand("MediaType:NAND");

          utp.UtpCommand("QueryStoreName:NAND FLASH Storage,Timeout:10");

          utp.UtpCommand("wfw");

          utp.UtpCommand("fwtype:EB_SB");

          utp.UtpWrite("send", @"c:\temp\files\eboot_ivt.sb");

          utp.UtpCommand("save");

          utp.UtpCommand("wfw");

          utp.UtpCommand("fwtype:NK_NB");

          utp.UtpWrite("send", @"c:\temp\files\nk.nb0");

          utp.UtpCommand("save");

          utp.UtpCommand("QueryFolderStatus:FlashDisk,Timeout:10");

          utp.UtpCommand("Done");

     }

}

Hopefully this all makes sense and people find it useful.

Thanks,

Stephen

ラベル(2)
0 件の賞賛
2 返答(返信)

680件の閲覧回数
mads_andreasen
Contributor I

I am also trying to make some programming of the iMX28 for automated production in C#.

I can´t find anything about BitInit is it a Xilinx tool?

and where did you find the code for it?

any help would be appreciated.

Thanks,

Mads

0 件の賞賛

680件の閲覧回数
stephenhewitson
Contributor III

Mads,

Sorry its taken so long. BitInit is available here -> https://www.freescale.com/webapp/Download?colCode=IMX_OPT_TOOLS&appType=license&location=null&fasp=1...

That gives you DevSupport.dll, and the 2 Interop libraries you need.

0 件の賞賛