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

On 7/9/07, Sergei Gavrikov <w3sg@softhome.net> wrote:
> On Mon, Jul 09, 2007 at 04:11:52PM -0300, Tales Toledo wrote:
> > On 7/9/07, Sergei Gavrikov <w3sg@softhome.net> wrote:
> > >On Mon, Jul 09, 2007 at 12:45:16PM -0300, Tales Toledo wrote:
> > >> On 7/6/07, Sergei Gavrikov <w3sg@softhome.net> wrote:
> > >> >On Fri, Jul 06, 2007 at 04:37:47PM -0300, Tales Toledo wrote:
> > >> >> On 7/6/07, Sergei Gavrikov <w3sg@softhome.net> wrote:
> > >> >> >On Fri, Jul 06, 2007 at 03:32:01PM -0300, Tales Toledo wrote:
> > >> >> >> Hi,
> > >> >> >>
> > >> >> >> I would like to enable all diag_printf messages at Redboot.
> > >> >> >> How can I do this?
> > >> >> >> Which cdl option should I have to enable to make it works?
> > >> >> >
> > >> >> >There are a lot of debug messages in RedBoot. That depends on
> > >packages
> > >> >> >are used to build RedBoot (RedBoot is a closely target related
> > >stuff).
> > >> >> >You can see that, U.T.S.L.
> > >> >> >
> > >> >> >find $ECOS_REPOSITORY/redboot/current/src | xargs grep DEBUG
> > >> >> >
> > >> >> >You can meet ZM_DEBUG, DEBUG_TCP, etc., etc., etc.
> > >> >> >
> > >> >> >but it seems, that more suitable way is to look at any
> > >CYGDBG_REDBOOT_*
> > >> >> >options in your `ecos.ecc' is prepared to build RedBoot
> > >> >> >
> > >> >>
> > >> >> I enable CYGDBG_REDBOOT_NET_DEBUG that is the most important for me
> > >> >> right now. Unfortunately  I am having some problems with flash
> > >> >> configuration at boot that override it with 0.
> > >> >> I can't see any messages until now...
> > >> >
> > >> >Ah, I did pass your vis-a-vis dialog with Gary. I'm seeing now what is
> > >> >your issue. That is a flash config issue, isn't that? I look at some
> > >> >RedBoot options/semaphores and found this one
> > >> >
> > >> >cdl_option CYGSEM_REDBOOT_FLASH_CONFIG_READONLY_FALLBACK {user_value 1};
> > >>
> > >> Yes, I believe it could be a flash config problem. I have tried it but
> > >> with no success. I am still having the same behavior. The flash was
> > >> written (I'm sure because i can dump and see the ip address
> > >> server/mask/gateway) but seems that Redboot don't    take this
> > >> configuration from flash at boot up.
> > >>
> > >> >
> > >> >Perhaps, some fail(s) protected itself by such a way? But, you told that
> > >> >fconfig copy in RAM is good. Did you tried to change the default flash
> > >> >config block number (cdl_option CYGNUM_REDBOOT_FLASH_CONFIG_BLOCK) ?
> > >>
> > >> I also change it. Should I see the differences at fis list command? I
> > >> choose -4 as example and the Redboot config remains at 0x407FF000. It
> > >> should be at 0x407FA000. Did i understand the cdl_option right?
> > >
> > >That has an effect, if this option is turnned off:
> > >
> > >cdl_option CYGSEM_REDBOOT_FLASH_COMBINED_FIS_AND_CONFIG {user_falue 0};
> > >                                                         ^^^^^^^^^^^^
> > >So, try such an import before make
> > >
> > You were right. I was using
> > CYGSEM_REDBOOT_FLASH_COMBINED_FIS_AND_CONFIG {user_value 1};.
> >
> > >...
> > >cat <<_EOF | ecosconfig import /dev/stdin
> > >cdl_option CYGSEM_REDBOOT_FLASH_COMBINED_FIS_AND_CONFIG {user_value 0};
> > >cdl_option CYGNUM_REDBOOT_FLASH_CONFIG_BLOCK {user_value -4};
> > >_EOF
> > >
> > >Then fulfil `fconf -i', `fis init -f' as you do it as well and compare
> > >the `fis list' results. I get the expected changes on my target.
> > >
> > With cdl_option CYGNUM_REDBOOT_FLASH_CONFIG_BLOCK {user_value -3}; I got
> > RedBoot> fis list
> > Name              FLASH addr  Mem addr    Length      Entry point
> > RedBoot           0x40000000  0x40000000  0x00030000  0x00000000
> > RedBoot config    0x407D0000  0x407D0000  0x00001000  0x00000000
> > FIS directory     0x407F0000  0x407F0000  0x00010000  0x00000000
> >
> > It works BUT... the problem is still present. Redboot doesn't seem to
> > read boot configuration from flash.
>
> 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?

>4) You did disable a caching. Is it right? But you get
> these lines on every reboot:

If I disable caching with "Redboot>cache off" my console stays to slow
and loose some characters every time I type ;-( . This is the next
step. Why did it happen?

>
> **Warning** FLASH configuration checksum error or invalid key
> "Use 'fconfig -i' to [re]initialize database
>
> That stop point is placed here (you saw): fconfig.c:load_flash_config().
>
>     if ((flash_crc(config) != config->cksum) ||
>         (config->key1 != CONFIG_KEY1)|| (config->key2 != CONFIG_KEY2)) {
>
> and, if you sure that you don't meet that magic cookies in your dumps,
> therefore, it's needed look at flash_crc(), isn't it?
>
> There is a stone in that proc, this is REDBOOT_FLASH_REVERSE_BYTEORDER
> (look on the flash_crc(), please). And I wonder about your settings in
> your ecos.ecc too. I believe that cyg_crc32 calculates all okay :) but
> what do you think about those lines:
>
>     if (swabbed)
>         conf_endian_fixup(conf);
>
> it's possible that is wrong set of the REDBOOT_FLASH_REVERSE_BYTEORDER
> value is your issue. Check that, please. Insert your own additional diag
> prints into flash_crc to print direct and endian fixed values. And use
> RedBoot's `cksum' command to calculate the check sums for RAM fconfig
> copy and FLASH fconfig copy.
>
I will check this but I think it can't be wrong since my environment
is based on viper that works fine for all.

>
> 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 19:24 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 [this message]
2007-07-10 22:04                 ` Sergei Gavrikov
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=2308fb0f0707101223k78efbaa0t1a809824859be2b5@mail.gmail.com \
    --to=toledo.tales@gmail.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=w3sg@softhome.net \
    /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).