[U-Boot-Users] booting from USB

Jonas Dietsche maillist at fsforth.de
Thu Feb 3 12:27:55 CET 2005


Hallo Wolfgang,

>>Just played around with my usb stick and reduced the size of the first 
>>partition. When I now try the usbboot command the number of blocks is 
>>exact the size of the partition.
> 
> 
> This doesn't make sense.
> 
> 
I did the following steps:

A9M9750 # usb part
print_part of 0

Partition Map for USB device 0  --   Partition Type: DOS

Partition     Start Sector     Num Sectors     Type
     1                    1           10239      83
     2                10240           10240      83
     3                20480          235520      83

A9M9750 # usbboot 10000 0:1

Loading from USB device 0, partition 1: Name: usbda1
   Type: U-Boot
First Block: 1,  # of blocks: 10239, Block Size: 512

** Bad Magic Number **

Ok, let me see if the image on the stick is corrupt. I loaded it with 
the fatload command.
A9M9750 # fatload usb 0:1 10000 uImage
reading uImage
...............................................................................................................

1144120 bytes read
A9M9750 # bootm
## Booting image at 00010000 ...
    Image Name:   Linux-2.6.10-fs1
    Created:      2005-02-02  13:23:01 UTC
    Image Type:   ARM Linux Kernel Image (uncompressed)
    Data Size:    1144056 Bytes =  1.1 MB
    Load Address: 00008000
    Entry Point:  00008000
    Verifying Checksum ... OK
OK

And it works. Nice. But whats going/I'm doing wrong with the usbboot 
command?

> Does the "usbboot" command print the image header? Does the data look
> correct, especially the image size?
Not at all. So

> Try adding some debug prints to "common/cmd_usb.c"; like here:
> 
>     396         hdr = (image_header_t *)addr;
>     397
>     398         if (hdr->ih_magic == IH_MAGIC) {
>     399                 print_image_hdr (hdr);
>     400                 cnt = (hdr->ih_size + sizeof(image_header_t));
>     401                 cnt += info.blksz - 1;
>     402                 cnt /= info.blksz;
>     403                 cnt -= 1;
>     404         } else {
>     405                 printf("\n** Bad Magic Number **\n");
>     406                 return 1;
>     407         }
I put the print_image_hdr() before the if clause, but as expected I only 
get garbage.
    Image Name:
    Created:      2024-06-19  15:57:52 UTC
    Image Type:   Invalid CPU Invalid OS Invalid Image (uncompressed)
    Data Size:    33816832 Bytes = 32.3 MB
    Load Address: 020002fe
    Entry Point:  27f80800

Gruß,
Jonas




More information about the U-Boot mailing list