public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Sergei Gavrikov <w3sg@SoftHome.net>
To: Tales Toledo <toledo.tales@gmail.com>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] How to enable diag_printf at Redboot
Date: Tue, 10 Jul 2007 22:04:00 -0000	[thread overview]
Message-ID: <20070710220328.GA22048@ubuntu> (raw)
In-Reply-To: <2308fb0f0707101223k78efbaa0t1a809824859be2b5@mail.gmail.com>

Execuse me a double post, I have a doubts about e-mail delivery.

On Tue, Jul 10, 2007 at 04:23:59PM -0300, Tales Toledo wrote:
> On 7/9/07, Sergei Gavrikov <w3sg@softhome.net> wrote:
> >I again did review your previous RedBoot dumps. You known/sure that is
> >1) RAM copy of `fconfig' is correct, 2) Written flash copy of `fconfig'
> >seems or is correct too, there are a valid human readable chunks at the
> >least,
> 
> Just checking ... 1) and 2) Ok. You can see as follow
> RedBoot> fconfig -i
> Initialize non-volatile configuration - continue (y/n)? y
> Run script at boot: false
> Use BOOTP for network configuration: false
> Gateway IP address: 192.168.1.1
> Local IP address: 192.168.1.100
> Local IP address mask: 255.255.255.0
> Default server IP address: 192.168.1.1
> DNS domain name: <Not a string: 0x1FE32F5>
> DNS server IP address: 192.168.1.1
> Network hardware address [MAC]: 0x7C:0x71:0x43:0xA6:0x7C:0x92
> GDB connection port: 9000
> Force console for special debug messages: false
> Network debug at boot time: false
> Update RedBoot non-volatile configuration - continue (y/n)? y
> ... Erase from 0x407d0000-0x407d1000: .
> ... Program from 0x01fe3000-0x01fe4000 at 0x407d0000: .
> RedBoot> ck
> RedBoot> cksum
> usage: cksum -b <addr> -l <length>
> RedBoot> cksum -b 0x01fe3000 -l 0x1000
> POSIX cksum = 2836439824 4096 (0xa910a310 0x00001000)
> RedBoot> cksum -b 0x407d0000 -l 0x1000
> POSIX cksum = 2836439824 4096 (0xa910a310 0x00001000)
> RedBoot>
> 
> >3) you don't see the BAD magic values in your dumps (0x0BADFACE
> >or 0xDEADDEAD).
> 
> RedBoot> dump -b 0x407d0000 -l 0x1000
> 407D0000: 00 00 10 00 0B AD FA CE  01 0C 01 00 62 6F 6F 74  
> |............boot|
> 407D0010: 5F 73 63 72 69 70 74 00  00 00 00 00 04 11 01 0C  
> |_script.........|
> 407D0020: 62 6F 6F 74 5F 73 63 72  69 70 74 5F 64 61 74 61  
> |boot_script_data|
> 407D0030: 00 62 6F 6F 74 5F 73 63  72 69 70 74 00 00 00 00  
> |.boot_script....|
> 
> I can see 0x0BADFACE... I miss this point, what is wrong with that?

It seems I thought itself :-), you have to see both those keys, because
the RedBoot config is (flash_config.h)

struct _config {
    unsigned long len;
    unsigned long key1;
    unsigned char config_data[MAX_CONFIG_DATA-(4*4)];
    unsigned long key2;
    unsigned long cksum;
};

I did try to say what that point checks just 3 things: CRC, KEY1
(0x0BADFACE) and KEY2 (0xDEADDEAD):

    if ((flash_crc(config) != config->cksum) ||
        (config->key1 != CONFIG_KEY1)|| (config->key2 != CONFIG_KEY2)) {
        diag_printf("**Warning** FLASH configuration checksum error or invalid key\n");
        diag_printf("Use 'fconfig -i' to [re]initialize database\n");
        config_init();
        return;
    }

Check what that KEY2/CRC is present at the end of 4K area. You believe
that CRC is okay. So, this is the last point. Try to build a minimalist
RedBoot, i.e.  which supports serial and Flash devices only. That
reduces a size of RedBoot and rebuild-time. That will be to have a few
config options. I wonder it's possible 'fconfig' issue won't be occur...
So, try to remove NET stuff from RedBoot:

ecosconfig new <your target> redboot
ecosconfig import <your ecm file>
ecoscongig remove CYGPKG_DEVS_ETH_POWERPC_FEC
...
ecosconfig resolve
make

Well, I don't know your target stuff, so, look on top your own ecos.ecc
file to know which NET* related packages (Eth I/O drivers, DNS client,
etc.) you can remove, and try to build such a minimal RedBoot image.

Will you get 'fconfig' warning with the minimalist RedBoot? If you
will... I have no more ideas, sorry :-(.


  Sergei


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2007-07-10 22:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-06 18:32 Tales Toledo
2007-07-06 19:12 ` Sergei Gavrikov
2007-07-06 19:37   ` Tales Toledo
2007-07-06 21:14     ` Sergei Gavrikov
2007-07-09 15:45       ` Tales Toledo
2007-07-09 17:29         ` Sergei Gavrikov
2007-07-09 19:11           ` Tales Toledo
2007-07-09 21:48             ` Sergei Gavrikov
2007-07-10 19:24               ` Tales Toledo
2007-07-10 22:04                 ` Sergei Gavrikov [this message]
2007-07-12 21:00                   ` Tales Toledo
2007-07-12 21:37                     ` Sergei Gavrikov

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=20070710220328.GA22048@ubuntu \
    --to=w3sg@softhome.net \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=toledo.tales@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).