imx_usb_loader: sending an env to the mfg u-boot

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

imx_usb_loader: sending an env to the mfg u-boot

Jump to solution
1,297 Views
colinhelliwell
Contributor III

[Apologies for not formatting this well - I haven't yet figured out how to turn text into a code block...]

I'm trying to migrate from MfgTool on Windows to imx_usb_loader (+ utp_com) on Linux.

My board uses a i.MX6 Solo SOM, with the u-boot supplied (and modified!) by the SOM manufacturer. I have though got this working with MfgTool (even with a signed u-boot and a secured cpu). So I'm pretty confident that my images are all 'good'.

I've got as far as the mfg u-boot booting, but it seems to rely on having its environment downloaded too - the MfgTool xml includes the entry:

<CMD state="BootStrap" type="load" file="mfg.env" address="0x10500000" loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Loading mfg U-Boot parameters.</CMD>

I've added this to the .conf file for imx_loader, which so far has:

mx6_qsb
hid,1024,0x910000,0x10000000,1G,0x00907000,0x31000

firmware/mfg.env: load 0x10500000

firmware/u-boot-tx6s-8035_mfg.bin:clear_dcd,load,plug,jump header, load 0x14f0000

As I say, u-boot starts, but crashes when trying to write the env. With MfgTool it shows:

## Warning: defaulting to text format
## Info: input data size = 1575 = 0x627
Saving Environment to MMC...

whereas with imx_usb_loader I'm getting:

## Warning: defaulting to text format
## Info: input data size = 787451 = 0xC03FB

then one of a few errors/crashes.

Note that, even with a power-cycle, it seems to consistently come up with 787451

I've enabled some debug, which for this stage shows:

== work item
filename firmware/mfg.env
load_size 0 bytes
load_addr 0x10500000
dcd 0
clear_dcd 0
plug 0
jump_mode 0
jump_addr 0x00000000
== end work item
load_addr=10500000

loading binary file(firmware/mfg.env) to 10500000, skip=0, fsize=2b3 type=0

<<<691, 1024 bytes>>>
succeeded (status 0x88888888)

Am I correct in using that 'load' entry to send the env?

What's the significance of the fist line of the conf ("mx6_qsb") - not sure if I should change this?

Any suggestions please on what could be wrong?

Thanks.

Tags (1)
0 Kudos
1 Solution
969 Views
colinhelliwell
Contributor III

Ok, I've sorted that: there's two env files that the mfg u-boot needs downloading - one @ 0x10500000 and another @ 0x10540000. And, both have to include a null at the end - the u-boot image parses the data as strings and then saves the total environment to MMC.

Now getting as far as the mfg kernel booting up with the initramfs - onward now to partitioning and downloading the production images...!

View solution in original post

0 Kudos
3 Replies
969 Views
igorpadykov
NXP Employee
NXP Employee

in general issues with imx_usb_loader may be debugged using its sources

GitHub - boundarydevices/imx_usb_loader: USB & UART loader for i.MX5/6/7 series 

Best regards
igor

0 Kudos
969 Views
colinhelliwell
Contributor III

Very shabby replying to my own post.... but I've just noticed that the working MfgTool boot is saying

"Info: input data size = 1575 = 0x627"

when the size of the file is (and also as reported by imx_usb_loader) in fact 691 bytes...?

0 Kudos
970 Views
colinhelliwell
Contributor III

Ok, I've sorted that: there's two env files that the mfg u-boot needs downloading - one @ 0x10500000 and another @ 0x10540000. And, both have to include a null at the end - the u-boot image parses the data as strings and then saves the total environment to MMC.

Now getting as far as the mfg kernel booting up with the initramfs - onward now to partitioning and downloading the production images...!

0 Kudos