flash u-boot from uboot using ums

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

flash u-boot from uboot using ums

Jump to solution
7,101 Views
razriel
Contributor II

I have imx8mn evk board.

I want to be able to test changes in u-boot.   I prefer to flash u-boot only to save cycle time instead of flashing the full image.

I am using the ums from the bootloader and able to see boot and rootfs partitions of the emmc on my host/build machine by running ums 0 mmc 2

the u-boot image is not located in the boot partition. I believe its in a known address in the emmc.

I guess I should be able to do a dd command with if=my new u-boot image, of =/dev/mmc and a known offset. can someone confirm its possible. and give me the offsest address and block size.

BR,

Roy 

 

Labels (1)
0 Kudos
Reply
1 Solution
7,027 Views
dvlogic
Contributor III

The dd command will write into the main raw eMMC memory partition area.  The eMMC will also have a boot partition.  I believe when you use the uuu command, it will write the u-boot into the boot partition and enable it in the eMMC part configuration.

u-boot=> mmc partconf 2
EXT_CSD[179], PARTITION_CONFIG:
BOOT_ACK: 0x0
BOOT_PARTITION_ENABLE: 0x1
PARTITION_ACCESS: 0x0

The second 0 in the "mmc partconf 2 0 0 0" will disable the eMMC from booting from the boot partition and instead boot from the main partition. 

Hope this helps - by no means am I an expert, I've just figured most of this out through reading and trial and error.  

View solution in original post

0 Kudos
Reply
9 Replies
7,024 Views
razriel
Contributor II

thanks. it worked.

now I am able to see my changes in the print.

 

0 Kudos
Reply
7,097 Views
dvlogic
Contributor III

I've done that when I was developing my custom u-boot.  The dd command is as follows:

dd if=imx-boot of=/dev/imxdisk bs=1k seek=32 conv=fsync

where my /dev/imxdisk is the mounted USB drive exposed by the ums mmc 2 command (Auto-mounted using the following udev rule)

KERNEL=="sd[b-z]", SUBSYSTEM=="block", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="a4a5", ACTION=="add", \
MODE="0666", SYMLINK+="imxdisk"

0 Kudos
Reply
7,091 Views
joanxie
NXP TechSupport
NXP TechSupport

you can refer to the linux user guide, which includes detailed information about this

 

0 Kudos
Reply
7,081 Views
razriel
Contributor II

Can you please add page or chapter in the guide ? I was checking it and could not find.

0 Kudos
Reply
7,073 Views
joanxie
NXP TechSupport
NXP TechSupport

I mean download images to the board by uuu or dd command, you can refer to the user guide, for ums, you can refer to the link as below:

"https://developer.technexion.com/docs/using-u-boots-ums-command-to-write-flash-storage-over-usb-otg"

 

0 Kudos
Reply
7,042 Views
razriel
Contributor II

I am still unable to see changes I have created in u-boot running

I am doing the followng procedure:

1. creating patch file to be called by bbappend file of my custom u-boot in yocto.

2. the patch file print another printf line in SPL part of "DDRINFO: ddr init"

3. running bitbake imx-image-core

4. verifying source code of u-boot is changed in build/tmp/work/.../git/drivers/ddr_init.c

5. running ums 0 emmc 2 in u-boot terminal

6. running sudo dd if=imx-boot of=/dev/sda bs=1k seek=32 conv=fsync in my ununtu build machine

getting message write is succefull ~1.8 MB in ~0.3 seconds

7. Ctrl C to stop ums in u-boot consloe and running reset command.

8. u-boot loads again with no print new print

what am I doing wrong ? 

 

Thanks,

Roy

0 Kudos
Reply
7,039 Views
dvlogic
Contributor III

You probably need to change the boot configuration to boot from main eMMC instead of the special boot part.  I'm not in front of my board but I think its the following command 

mmc partconf 2 0 0 0

(I think without the parameters the mmc partconf may show you the current settings too)

0 Kudos
Reply
7,029 Views
razriel
Contributor II

this is what I get

u-boot=> mmc partconf 2
EXT_CSD[179], PARTITION_CONFIG:
BOOT_ACK: 0x0
BOOT_PARTITION_ENABLE: 0x1
PARTITION_ACCESS: 0x0

can you please explain more about mmc partconf. 

when I flash the full image in download mode where to u-boot is flashed ?

what actully happend when I did the dd to seek=32  ? it was written to another location ?

this issue is not clear to me and I cannot find much information about it  in the linux user manual.

 

Thanks

 

Roy

0 Kudos
Reply
7,028 Views
dvlogic
Contributor III

The dd command will write into the main raw eMMC memory partition area.  The eMMC will also have a boot partition.  I believe when you use the uuu command, it will write the u-boot into the boot partition and enable it in the eMMC part configuration.

u-boot=> mmc partconf 2
EXT_CSD[179], PARTITION_CONFIG:
BOOT_ACK: 0x0
BOOT_PARTITION_ENABLE: 0x1
PARTITION_ACCESS: 0x0

The second 0 in the "mmc partconf 2 0 0 0" will disable the eMMC from booting from the boot partition and instead boot from the main partition. 

Hope this helps - by no means am I an expert, I've just figured most of this out through reading and trial and error.  

0 Kudos
Reply