boundarydevices / imx_usb_loader

USB & UART loader for i.MX5/6/7/8 series
GNU Lesser General Public License v2.1
262 stars 158 forks source link

i.MX6 fails to boot into Mfg Linux image mode #81

Closed julumme closed 6 years ago

julumme commented 6 years ago

Im working on a custom imx6 device which is based on imx6 solo but with 512M of RAM instead of 1G. Im trying to migrate from using Windows and MfgTool (works, but is quite cumbersome) to Linux with this guide (https://community.nxp.com/thread/441563), but Im having problems getting the board boot to "linux gadget" mode.

I've copied zImage, u-boot, initrd image and dtb which are working on Windows side from the "firmware" folder of mfgtool to _imx_usbloader/firmware folder. The mx6_usb_work.conf looks like this:

imx6-sabresd
#hid/bulk,[old_header,]max packet size, {ram start, ram size}(repeat valid ram areas)
hid,1024,0x10000000, 512M
# Note; only dcd as first step (setup ram)
firmware/u-boot-imx6dlsabresd_sd.imx:dcd
# Then load a kernel with initramfs (self contained linux) at known address
firmware/zImage:load 0x12000000
firmware/fsl-image-mfgtool-initramfs-imx6sxsabresd.cpio.gz.u-boot: load 0x12C00000
firmware/zImage-imx6dl-sabresd.dtb: load 0x18000000
# Now, we load a u-boot that expects preloaded software at known adress
# Note, to make this boot, the clear_dcd field seems necessary
firmware/u-boot-imx6dlsabresd_sd.imx:clear_dcd,load,plug,jump header

Now when I run the imx_usb tool, this is what happens:

jlumme@vbox:~/imx_usb_loader$ sudo ./imx_usb
config file <.//imx_usb.conf>
vid=0x066f pid=0x3780 file_name=mx23_usb_work.conf
vid=0x15a2 pid=0x004f file_name=mx28_usb_work.conf
vid=0x15a2 pid=0x0052 file_name=mx50_usb_work.conf
vid=0x15a2 pid=0x0054 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0061 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0063 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0071 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x007d file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0080 file_name=mx6_usb_work.conf
vid=0x1fc9 pid=0x0128 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0076 file_name=mx7_usb_work.conf
vid=0x1fc9 pid=0x0126 file_name=mx7ulp_usb_work.conf
vid=0x15a2 pid=0x0041 file_name=mx51_usb_work.conf
vid=0x15a2 pid=0x004e file_name=mx53_usb_work.conf
vid=0x15a2 pid=0x006a file_name=vybrid_usb_work.conf
vid=0x066f pid=0x37ff file_name=linux_gadget.conf
vid=0x1b67 pid=0x4fff file_name=mx6_usb_sdp_spl.conf
vid=0x0525 pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
vid=0x1fc9 pid=0x012b file_name=mx8mq_usb_work.conf
config file <.//mx6_usb_work.conf>
parse .//mx6_usb_work.conf
Trying to open device vid=0x15a2 pid=0x0061
Interface 0 claimed
HAB security state: development mode (0x56787856)
== work item
filename firmware/u-boot-imx6dlsabresd_sd.imx
load_size 0 bytes
load_addr 0x00000000
dcd 1
clear_dcd 0
plug 0
jump_mode 0
jump_addr 0x00000000
== end work item
loading DCD table @0x10000000
report 2 out err=-7, last_trans=0 len=0x230 max=0x400 retry=10
report 2 out err=-7, last_trans=0 len=0x230 max=0x200 retry=9
report 2 out err=-7, last_trans=0 len=0x230 max=0x100 retry=8
report 2 out err=-7, last_trans=0 len=0x230 max=0x80 retry=7
report 2 out err=-7, last_trans=0 len=0x230 max=0x40 retry=6
report 2 out err=-7, last_trans=0 len=0x230 max=0x20 retry=5
report 2 out err=-7, last_trans=0 len=0x230 max=0x10 retry=4
report 2 out err=-7, last_trans=0 len=0x230 max=0x8 retry=3
report 2 out err=-7, last_trans=0 len=0x230 max=0x10 retry=2
report 2 out err=-7, last_trans=0 len=0x230 max=0x8 retry=1
Giving up
clear dcd_ptr=0x177ff42c
!!perform_dcd returned -7
do_download failed, err=-7
do_command err=-7, last_trans=0
do_command err=-7, last_trans=0
do_command err=-7, last_trans=0
do_command err=-7, last_trans=0
do_command err=-7, last_trans=0

Im not really sure what is happening, but it appears that after the first "lading DCD table @..." I see other people have something like:

loading DCD table @0x********

<<<-192, 1024 bytes>>>
succeeded (status 0x128a8a12)
<<<-192, 1024 bytes>>>
succeeded (status 0x128a8a12)

But I start getting these "report 2.." messages... What could be the problem here ?

tkisky commented 6 years ago

On 5/9/2018 9:58 PM, julumme wrote:

Im working on a custom imx6 device which is based on imx6 solo but with 512M of RAM instead of 1G. Im trying to migrate from using Windows and MfgTool (works, but is quite cumbersome) to Linux with this guide (https://community.nxp.com/thread/441563), but Im having problems getting the board boot to "linux gadget" mode.

I've copied zImage, u-boot, initrd image and dtb which are working on Windows side from the "firmware" folder of mfgtool to /imx_usb_loader/firmware/ folder. The mx6_usb_work.conf looks like this:

|imx6-sabresd #hid/bulk,[old_header,]max packet size, {ram start, ram size}(repeat valid ram areas) hid,1024,0x10000000, 512M # Note; only dcd as first step (setup ram)

This line should be something like

hid,1024,0x910000,0x10000000,512M,0x00900000,0x40000

Though the default should be fine even with only 512M hid,1024,0x910000,0x10000000,1G,0x00900000,0x40000

julumme commented 6 years ago

Hi tkisky,

Thank you, this was the solution to this indeed! Can you explain me how that line exactly gets formed ?
The hid and max packet size is understandable, but after that it gets hazy for me...