Has anyone used serial download to bootup imx6?

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

Has anyone used serial download to bootup imx6?

13,922 Views
EdSutter
Senior Contributor II

My (future) iMX6-based board will not have any removeable memory, so I need to be able to boot a raw board with the serial downloader.  I did a similar thing with the iMX53-QSB, but now I need to do it for the iMX6 (currently on the SABRESDB); however, apparently the iMX6 doesn't support UART-ish serial download (ARRGGHH!!), so the process is a bit more complicted (I think)...

Has anyone walked this path yet?

Labels (1)
33 Replies

857 Views
EdSutter
Senior Contributor II

Yea, sounds like you're on linux. I have to support some W7 hosted stuff for now; hence the use of mfgtool.  I am being a bit anal about the need for the tool to actually terminate correctly, so you're right I could just ignore that.  I was hoping there was some clean workaround for it though.

Anyway, I found those tools you mentioned.  Currently trying to build them from source, so if I can't get that worked out, I may take you up on your offer to send them to me.

Thanks much,

Ed

0 Kudos

857 Views
sinanakman
Senior Contributor III

Yes by all means if you need anything on the Linux side. Hopefully you will get the W7 tool working properly as well. It would sure help others. Good luck for now.

Sinan

0 Kudos

857 Views
EdSutter
Senior Contributor II

Well, I managed to build the imx_usb.c tool (which required the libusb package) on both W7 and UBUNTU.  I can download u-boot to my board using the tool on UBUNTU; however on W7, the call to libusb_open() fails with LIBUSB_ERROR_NOT_SUPPORTED.

0 Kudos

857 Views
sinanakman
Senior Contributor III

Sounds like a problem with libusb on w7. I don't know anything about w7, but is it building one static executable or does it simply not find/load the dynamic lib. Just a thought.

0 Kudos

857 Views
EdSutter
Senior Contributor II

Its a static linkage.  I build the libusb library and then build imx_usb using that library.  Tried it with both cygwin (gcc) and Visual Studio and I get the same result.

One other thing I'm noticing with the version of imx_usb that I built for UBUNTU...

It appears that if I accidentally try to use imx_usb to install u-boot without having reset the board (to put it back in boot-from-USB-mode) then obviously it will fail that time (as expected); however, after that, even if I properly reset the board in the correct boot mode, imx_usb fails until I reboot my linux box.

0 Kudos

857 Views
sinanakman
Senior Contributor III

The way I understood the mechanism is that if the flash is empty or if the boot loader fails then imx_usb would feed the working binary and that would boot. That is when it is in internal mode. Some of the times I didn't even have Linux on the target at all so I thought  a target  reset was just enough for the SoC to take the new switch settings into account and boot. Or perhaps you refer to your Linux host that you need to reboot for the target to boot from USB : that problem I certainly never had, I almost never reboot my Linux host for months. But perhaps what happens is that your Linux host PC does not refresh the list of connected USB devices, so that imx_usb tool simply doesn't find the Freescale device (mx6 otg). I am running a Fedora distro with latest Linux kernel. I don't know if what you are seeing an old kernel usb bug. After you switch the boot mode to internal and reset your target board, check with lsusb on the host before running imx_usb if Freescale USB ID is listed at all. Hope I understood your problem correctly.

0 Kudos

857 Views
EdSutter
Senior Contributor II

Yea, sorry for the confusion.  I was referring to the host-Linux side.  Not sure what's going on.  It does see the device, but the initial writes fail.  I'm running a UBUNTU (not the latest) host, so who knows!

So at this point I have two issues (neither of which are killing me):

1. Can't use imx_usb on W7.

    This is no big deal since the build environment is on my ubuntu-linux box anyway.

2. The imx_usb transfer fails if I don't reset the board first (this is expected); but any attempt after that also fails.

    This too, I can live with.  Just gotta remember to reset each time.

As I progress, if I figure out solutions for these I'll post them here.

Thanks much,

Ed

857 Views
patrickwood
Contributor II

Did anyone ever work this out? I'm having what seems to be the same problem -- MfgTool loads uboot and then sits around waiting for some sort of response from the board for the "jump" event.  imx_usb works quite well for me on linux, but of course, we need a windows solution; and in my case imx_usb on win7 gets the LIBUSB_ERROR_INVALID_PARAM error from a bulk send operation with both the MinGW and VisualStudio builds.

Strange that a bunch of other small USB operations that send the DCD right before the bulk transfer work fine.

0 Kudos

857 Views
EdSutter
Senior Contributor II

Patrick,

Unfortunately I can't help either... Had the same issue.. Needed (wanted) something on windows 'cause that's what most of our lab pcs are running.  Building/running on windows gave me the same issue.  Turned out to be easier to just load linux up on one of our lab pcs and do it with imx_usb.

Regards,

Ed

0 Kudos

857 Views
patrickwood
Contributor II

I made the mistake of assuming the one packaged with MfgTool2 would be the "correct" version, but the one in sb_loader.zip on the Boundary site works while the Freescale one in the MfgTool2 distribution doesn't.  Now it's working like a charm, and the accompanying sources will help our Windows developers put together something a little more professional than my cygwin bash script.

Thanks for the useful link and quick replies, all!

0 Kudos

857 Views
EricNelson
Senior Contributor II

Hey Patrick,

The trouble with GUI tools like the MFG tool is that they try to make things pretty.

It turns out that under the hood, the MFG tool has a tool called SB_LOADER that does roughly the same thing.

Some details are in this post:

     http://boundarydevices.com/windows-users-and-unbricking-an-i-mx-device/

0 Kudos

857 Views
patrickwood
Contributor II

It would seem that this program is exactly what I need; however, I get the following error when I run it:

  Waiting for HID device for 2 seconds...

HID device was not found.

Please place the device in recovery mode and restart the program.

Now, of course the device is in recovery mode -- MfgTool2.exe has no problems seeing it if I run that instead, and, of course, I can write to it from linux using imx_usb (which I was just testing before I moved the USB cable over to my Win 7 box).

0 Kudos

857 Views
sinanakman
Senior Contributor III

Hi Patrick, sorry I am really not a windows guy and run everything

on Linux. Hopefully Ed had some success and can follow up with

you.

Regards

Sinan Akman

0 Kudos