public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jonas Dietsche <maillist@fsforth.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] booting from USB
Date: Thu, 03 Feb 2005 12:27:55 +0100	[thread overview]
Message-ID: <42020ABB.2010106@fsforth.de> (raw)
In-Reply-To: <20050202171101.5D7EAC108D@atlas.denx.de>

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

  reply	other threads:[~2005-02-03 11:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-01 16:55 [U-Boot-Users] booting from USB Jonas Dietsche
2005-02-01 18:38 ` Wolfgang Denk
2005-02-02 15:15   ` Jonas Dietsche
2005-02-02 17:10     ` Wolfgang Denk
2005-02-03 11:27       ` Jonas Dietsche [this message]
2005-02-03 12:02         ` Wolfgang Denk
2005-02-03 15:12           ` Jonas Dietsche
2005-02-03 15:24             ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2005-02-04  8:10 Jonas Dietsche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42020ABB.2010106@fsforth.de \
    --to=maillist@fsforth.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox