Using uuu to run u-boot/SPL on i.MX SABRESDB board.

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

Using uuu to run u-boot/SPL on i.MX SABRESDB board.

Jump to solution
6,349 Views
noorahmadshinwa
Contributor III

Hi everyone!

I am trying to load SPL and u-boot on my SABRESDB board via the uuu utility on ubuntu, and am facing some difficulty that i hope someone can help me with.

I have a working SPL and u-boot.img files built from source ( i know they are working because i can load them to an SD card and boot successfully). I wanted to test the uuu utility to see if i can prepare a production script to load our images to an emmc.

I understand that the uuu first loads bootloaders to RAM, and then uses the u-boot fastboot protocol to write to emmc. However, when i try to load u-boot via uuu, i face the following issue:

 

Step 1: I can see that my chip is in SDP mode, and will accept SDP commands:

sudo ./uuu -lsusb
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.3.191-3-gf895947

Connected Known USB Devices
	Path	 Chip	 Pro	 Vid	 Pid	 BcdVersion
	==================================================
	3:2	 MX6Q	 SDP:	 0x15A2	0x0054	 0x0001

 

Step 2: I use uuu to load my SPL:

sudo ./uuu sdp: boot -f ../SPL
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.3.191-3-gf895947

Success 0    Failure 0                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                   
3:2      1/ 1 [=================100%=================] sdp: boot -f ../SPL                                                                                                                                                                                                         
Okay

 

Step 3: I check that the board is in fact running the SPL (looks OK)

sudo ./uuu -lsusb
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.3.191-3-gf895947

Connected Known USB Devices
	Path	 Chip	 Pro	 Vid	 Pid	 BcdVersion
	==================================================
	3:2	 SPL	 SDPU:	 0x0525	0xB4A4	 0x0221

 

Step 4: I want to load u-boot now:

sudo ./uuu sdpu: write -f ../u-boot.img
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.3.191-3-gf895947

Success 0    Failure 1                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                   
3:2      1/ 1 [HID(W):LIBUSB_ERROR_TIMEOUT           ] sdpu: write -f ../u-boot.img                                                                                                                                                                                                

Error: HID(W):LIBUSB_ERROR_TIMEOUT

 

Does anyone here know why i'm getting LIBUSB_ERROR_TIMEOUT?

Thank you.

0 Kudos
Reply
1 Solution
6,280 Views
noorahmadshinwa
Contributor III

Just to close this thread: I managed to get u-boot to run with the following commands:

To load and boot SPL:
> sudo ./uuu sdp: boot -f <path_to_file>/SPL_signed

>To load u-boot:
sudo ./uuu sdpu: write -f <path_to_file>/u-boot-ivt.img_signed -addr 0x177fffc0
sudo ./uuu sdpu: jump -addr 0x177fffc0

 

The lesson learned here is that you can't just run u-boot from any address. I guess the start of the u-boot executable part must align with the TEXT_BASE.

View solution in original post

0 Kudos
Reply
5 Replies
6,320 Views
noorahmadshinwa
Contributor III

Hi Aldo,

Thank you for your response.

Unfortunately, I couldn't boot with your commands either. Those look like the same commands from the default scripts I see in the uuu folder.

My u-boot is v2019.04 built from the github repo : (git clone -b v2019.04 https://github.com/u-boot/u-boot ). There is no CONFIG_SDP_LOADADDR in this version of u-boot, so I have to provide the -addr argument and write the u-boot to my SYS_TEXT_BASE which is 0x17800000 in my case. If I don't provide -addr, then the sdpu usb write command fails with (HID(W):LIBUSB_ERROR_TIMEOUT) and SPL gives the following message on the serial output:
Downloading file of size 617896 to 0x00000000...
(and it never succeeds, of course)

when i provide my -addr, it shows the following:
Downloading file of size 617896 to 0x17800000... done
(notice the "done" in the end, and my uuu also shows the command completed successfully).

Correct me if i'm wrong, but I think the suggestion you made to include -offset 0x57c00 when writing u-boot is meant for i.MX8 users who have both SPL and u-boot in a single file (_flash.bin). Regardless, I tried it and it did not work.

I noticed on other websites discussing using uuu to load SPL and u-boot that they also get the "Header Tag is not an IMX image" message. So that is not necessarily a problem because their u-boot messages appear after that. (reference https://developer.solid-run.com/knowledge-base/i-mx6-u-boot/).

These same images do work when i dd them to an SDcard. but still no luck getting uboot to run off the serial downloader. any help is greatly appreciated.


Regards,
Noor.

0 Kudos
Reply
6,348 Views
noorahmadshinwa
Contributor III

OK I found that i was missing the -addr argument for the sdpu write command, so it was attempting to write to address 0 and failing.

now i am able to write to the RAM as follows:

sudo ./uuu sdpu: write -f ../u-boot.img -addr 0x17800000
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.3.191-3-gf895947

Success 0    Failure 0                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                   
3:2      1/ 1 [=================100%=================] sdpu: write -f ../u-boot.img -addr 0x17800000                                                                                                                                                                               
Okay

 

However, when i attempt to run that u-boot by using the "jump" sdpu command, i get the following:

sudo ./uuu sdpu: jump -addr 0x17800000
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.3.191-3-gf895947

Success 0    Failure 0                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                   
3:2      1/ 1 [=================100%=================] sdpu: jump -addr 0x17800000                                                                                                                                                                                                 
Okay

 

So it looks like it should run u-boot now. However, when i look at the serial output from the board, instead of the u-boot prompt, i see SPL saying: "Header Tag is not an IMX image".

Any ideas?

0 Kudos
Reply
6,327 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

 

To download SPL and uboot you may try with the following:

uuu sdp: boot -f SPL

uuu sdpu: delay 1000  

uuu sdpu: write -f uboot.img -offset 0x57c00

uuu sdpu: jump

 

Hope this helps,

Best regards,

Aldo.

0 Kudos
Reply
6,315 Views
noorahmadshinwa
Contributor III

Hi Aldo.

I responded to your suggestion above but it seems that I made a mistake and responded to my own post. If you have any other suggestions/Ideas I would be happy to hear them.

 

Thank you.

0 Kudos
Reply
6,281 Views
noorahmadshinwa
Contributor III

Just to close this thread: I managed to get u-boot to run with the following commands:

To load and boot SPL:
> sudo ./uuu sdp: boot -f <path_to_file>/SPL_signed

>To load u-boot:
sudo ./uuu sdpu: write -f <path_to_file>/u-boot-ivt.img_signed -addr 0x177fffc0
sudo ./uuu sdpu: jump -addr 0x177fffc0

 

The lesson learned here is that you can't just run u-boot from any address. I guess the start of the u-boot executable part must align with the TEXT_BASE.

0 Kudos
Reply