public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Difference between "go" on Script and manual enter?
@ 2007-07-20  7:41 ariga masahiro
  2007-07-23  4:25 ` ariga masahiro
  0 siblings, 1 reply; 6+ messages in thread
From: ariga masahiro @ 2007-07-20  7:41 UTC (permalink / raw)
  To: ecos-discuss

Hi everyone,

Please,anyone help me.

I tested and confirmed that it worked,
when I loaded ROM-reserved application using "fis load"
and executed "go" command manually(that is, entered commands at
RedBoot prompt).

But when I tried to do the same thing on Boot Script,
application never ran !!

Strangely,if I write only "fis load" on Script,execute Script,
and after that I enter "go" command manually and execute,
then application properly run.

I wonder what is difference between excuting "go" manually
and on Boot Script.

I tried some delays before "go", but no effect.

I post both outputs,and "fconfig" entering log.

first only execute "fis load" on Script,
------------------
My Flash ID is 4:22f9:19:0
config=0x8ffee000 cfg_base=0xa03ff000
Ethernet eth0: MAC address 00:40:31:08:01:00
IP: 0.0.0.0/255.255.255.0, Gateway: 0.0.0.0
Default server: 0.0.0.8, DNS server IP: 0.0.0.8

RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version v2_0 - built 13:16:32, Jul 20 2007

Platform: inserter (SH 7709S)
Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

RAM: 0x8c000000-0x90000000, 0x8c00afa0-0x8ffed000 available
FLASH: 0xa0000000 - 0xa0400000, 64 blocks of 0x00010000 bytes each.
== Executing boot script in 3.000 seconds - enter ^C to abort
RedBoot> fis load -b 0x8c010000 basic1
RedBoot>
------------------

then,enter "go" manually,and application ran,
------------------
RedBoot> go 0x8c010000
Network stack using 65536 bytes for misc space
                    65536 bytes for mbufs
                    131072 bytes for mbuf clusters
[cyg_net_init] Init: mbinit(0x00000000)
[cyg_net_init] Init: cyg_net_init_devs(0x00000000)
Init device 'lan91cxx_eth0'
[cyg_net_init] Init: loopattach(0x00000000)
[cyg_net_init] Init: ifinit(0x00000000)
IFP: 0x8c0427e0, next: 0x8c0904d8
IFP: 0x8c0904d8, next: 0x00000000
[cyg_net_init] Init: domaininit(0x00000000)
[cyg_net_init] Init: cyg_net_add_domain(0x8c0431d4)
New domain internet at 0x00000000
[cyg_net_init] Init: cyg_net_add_domain(0x8c042c5c)
New domain route at 0x00000000
[cyg_net_init] Init: cyg_route_init(0x00000000)
[cyg_net_init] Done
Hello eCos World!!!

Thread A, count: 1  message: 75
Thread A, count: 2  message: 75
Thread B, message: 68
------------------

then,excute both commands on Script,
Application never ran,
------------------
My Flash ID is 4:22f9:19:0
config=0x8ffee000 cfg_base=0xa03ff000
Ethernet eth0: MAC address 00:40:31:08:01:00
IP: 0.0.0.0/255.255.255.0, Gateway: 0.0.0.0
Default server: 0.0.0.8, DNS server IP: 0.0.0.8

RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version v2_0 - built 13:16:32, Jul 20 2007

Platform: inserter (SH 7709S)
Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

RAM: 0x8c000000-0x90000000, 0x8c00afa0-0x8ffed000 available
FLASH: 0xa0000000 - 0xa0400000, 64 blocks of 0x00010000 bytes each.
== Executing boot script in 3.000 seconds - enter ^C to abort
RedBoot> fis load -b 0x8c010000 basic1
RedBoot> go 0x8c010000 -w 5
About to start execution at 0x8c010000 - abort with ^C within 5 seconds
------------------

next is "fconfig" entering log,
------------------
RedBoot> fconfig
Run script at boot: true
Boot script:
.. fis load -b 0x8c010000 basic1
Enter script, terminate with empty line
>> fis load -b 0x8c010000 basic1
>> go 0x8c010000 -w 5
>>
Boot script timeout (1000ms resolution): 3
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address:
Local IP address mask: 255.255.255.0
Default server IP address: 0.0.0.8
Console baud rate: 38400
DNS server IP address: 0.0.0.8
GDB connection port: 9000
Force console for special debug messages: false
Network hardware address [MAC]: 0x00:0x40:0x31:0x08:0x01:0x00
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xa03f0000-0xa0400000: .
... Program from 0x8ffef000-0x8ffff000 at 0xa03f0000: .
RedBoot>
------------------

My Application is a sample program in Anthony J. Massa's 
"Embedded Software Development with eCos".

I appreciate any help.

Masahiro Ariga


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Difference between "go" on Script and manual enter?
  2007-07-20  7:41 [ECOS] Difference between "go" on Script and manual enter? ariga masahiro
@ 2007-07-23  4:25 ` ariga masahiro
  2007-07-23 20:05   ` Sergei Gavrikov
  0 siblings, 1 reply; 6+ messages in thread
From: ariga masahiro @ 2007-07-23  4:25 UTC (permalink / raw)
  To: ecos-discuss

Hi everyone,

Since I posted first question about Script "go" not going well
(I re_post it below),
I am still in a terrible predicament.
So,I beseech you again to help me.

I post since-then-found information.
I examined "go 0x8c010000" manually and on Script.
I traced do_go(int argc, char *argv[]) function in main.c in both cases.
I checked that arguments are the same in both cases.

Both traces same-routed until these critical points,
---
    // set up a temporary context that will take us to the trampoline
    HAL_THREAD_INIT_CONTEXT((CYG_ADDRESS)workspace_end, entry, 
go_trampoline, 0);
    // switch context to trampoline
    HAL_THREAD_SWITCH_CONTEXT(&go_saved_context, &workspace_end);
---
and I found that all arguments are same in both cases,
that in case of manual execution,when execute HAL_THREAD_SWITCH_CONTEXT, 
apllication run like
previously posted output,whereas on Script execution,it hangs and nothing 
appeares.

My questions are, are there any factors to not run properly 
HAL_THREAD_SWITCH_CONTEXT
in case of Script- "go"- execution.

I appreciate any help.

-- Below is my previous question.
> I tested and confirmed that it worked,
> when I loaded ROM-reserved application using "fis load"
> and executed "go" command manually(that is, entered commands at
> RedBoot prompt).
>
> But when I tried to do the same thing on Boot Script,
> application never ran !!
>
> Strangely,if I write only "fis load" on Script,execute Script,
> and after that I enter "go" command manually and execute,
> then application properly run.
>
> I wonder what is difference between excuting "go" manually
> and on Boot Script.
>
> I tried some delays before "go", but no effect.
>
> I post both outputs,and "fconfig" entering log.
>
> first only execute "fis load" on Script,
> ------------------
> My Flash ID is 4:22f9:19:0
> config=0x8ffee000 cfg_base=0xa03ff000
> Ethernet eth0: MAC address 00:40:31:08:01:00
> IP: 0.0.0.0/255.255.255.0, Gateway: 0.0.0.0
> Default server: 0.0.0.8, DNS server IP: 0.0.0.8
>
> RedBoot(tm) bootstrap and debug environment [ROM]
> Non-certified release, version v2_0 - built 13:16:32, Jul 20 2007
>
> Platform: inserter (SH 7709S)
> Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
>
> RAM: 0x8c000000-0x90000000, 0x8c00afa0-0x8ffed000 available
> FLASH: 0xa0000000 - 0xa0400000, 64 blocks of 0x00010000 bytes each.
> == Executing boot script in 3.000 seconds - enter ^C to abort
> RedBoot> fis load -b 0x8c010000 basic1
> RedBoot>
> ------------------
>
> then,enter "go" manually,and application ran,
> ------------------
> RedBoot> go 0x8c010000
> Network stack using 65536 bytes for misc space
>                    65536 bytes for mbufs
>                    131072 bytes for mbuf clusters
> [cyg_net_init] Init: mbinit(0x00000000)
> [cyg_net_init] Init: cyg_net_init_devs(0x00000000)
> Init device 'lan91cxx_eth0'
> [cyg_net_init] Init: loopattach(0x00000000)
> [cyg_net_init] Init: ifinit(0x00000000)
> IFP: 0x8c0427e0, next: 0x8c0904d8
> IFP: 0x8c0904d8, next: 0x00000000
> [cyg_net_init] Init: domaininit(0x00000000)
> [cyg_net_init] Init: cyg_net_add_domain(0x8c0431d4)
> New domain internet at 0x00000000
> [cyg_net_init] Init: cyg_net_add_domain(0x8c042c5c)
> New domain route at 0x00000000
> [cyg_net_init] Init: cyg_route_init(0x00000000)
> [cyg_net_init] Done
> Hello eCos World!!!
>
> Thread A, count: 1  message: 75
> Thread A, count: 2  message: 75
> Thread B, message: 68
> ------------------
>
> then,excute both commands on Script,
> Application never ran,
> ------------------
> My Flash ID is 4:22f9:19:0
> config=0x8ffee000 cfg_base=0xa03ff000
> Ethernet eth0: MAC address 00:40:31:08:01:00
> IP: 0.0.0.0/255.255.255.0, Gateway: 0.0.0.0
> Default server: 0.0.0.8, DNS server IP: 0.0.0.8
>
> RedBoot(tm) bootstrap and debug environment [ROM]
> Non-certified release, version v2_0 - built 13:16:32, Jul 20 2007
>
> Platform: inserter (SH 7709S)
> Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
>
> RAM: 0x8c000000-0x90000000, 0x8c00afa0-0x8ffed000 available
> FLASH: 0xa0000000 - 0xa0400000, 64 blocks of 0x00010000 bytes each.
> == Executing boot script in 3.000 seconds - enter ^C to abort
> RedBoot> fis load -b 0x8c010000 basic1
> RedBoot> go 0x8c010000 -w 5
> About to start execution at 0x8c010000 - abort with ^C within 5 seconds
> ------------------
>
> next is "fconfig" entering log,
> ------------------
> RedBoot> fconfig
> Run script at boot: true
> Boot script:
> .. fis load -b 0x8c010000 basic1
> Enter script, terminate with empty line
>>> fis load -b 0x8c010000 basic1
>>> go 0x8c010000 -w 5
>>>
> Boot script timeout (1000ms resolution): 3
> Use BOOTP for network configuration: false
> Gateway IP address:
> Local IP address:
> Local IP address mask: 255.255.255.0
> Default server IP address: 0.0.0.8
> Console baud rate: 38400
> DNS server IP address: 0.0.0.8
> GDB connection port: 9000
> Force console for special debug messages: false
> Network hardware address [MAC]: 0x00:0x40:0x31:0x08:0x01:0x00
> Network debug at boot time: false
> Update RedBoot non-volatile configuration - continue (y/n)? y
> ... Erase from 0xa03f0000-0xa0400000: .
> ... Program from 0x8ffef000-0x8ffff000 at 0xa03f0000: .
> RedBoot>
> ------------------
>
> My Application is a sample program in Anthony J. Massa's "Embedded 
> Software Development with eCos".

Masahiro Ariga


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Difference between "go" on Script and manual enter?
  2007-07-23  4:25 ` ariga masahiro
@ 2007-07-23 20:05   ` Sergei Gavrikov
  2007-07-27  7:27     ` ariga masahiro
  0 siblings, 1 reply; 6+ messages in thread
From: Sergei Gavrikov @ 2007-07-23 20:05 UTC (permalink / raw)
  To: ariga masahiro; +Cc: ecos-discuss

On Mon, Jul 23, 2007 at 01:25:10PM +0900, ariga masahiro wrote:
> Hi everyone,
> 
> Since I posted first question about Script "go" not going well
> (I re_post it below),
> I am still in a terrible predicament.
> So,I beseech you again to help me.
> 
> I post since-then-found information.
> I examined "go 0x8c010000" manually and on Script.
> I traced do_go(int argc, char *argv[]) function in main.c in both cases.
> I checked that arguments are the same in both cases.
> 
> Both traces same-routed until these critical points,
> ---
>    // set up a temporary context that will take us to the trampoline
>    HAL_THREAD_INIT_CONTEXT((CYG_ADDRESS)workspace_end, entry, 
> go_trampoline, 0);
>    // switch context to trampoline
>    HAL_THREAD_SWITCH_CONTEXT(&go_saved_context, &workspace_end);
> ---
> and I found that all arguments are same in both cases,
> that in case of manual execution,when execute HAL_THREAD_SWITCH_CONTEXT, 
> apllication run like
> previously posted output,whereas on Script execution,it hangs and nothing 
> appeares.
> 
> My questions are, are there any factors to not run properly 
> HAL_THREAD_SWITCH_CONTEXT
> in case of Script- "go"- execution.
> 
> I appreciate any help.

Hello

...Let's pass RedBoot. Does the minimal eCos test (it calls itself
`context') built for ROM startup work or it hangs too? The test is built
for ROM startup will starts at once, so that is the same condition like
you run application using RedBoot's script

SOURCE

	hal/common/current/tests/context.c

BUILD

	ecosconfig new <your_target> <minimal|default|net>
	cat <<__eof >ROMSTARTUP.ecm
	cdl_component CYG_HAL_STARTUP {user_value ROM};
	__eof
	ecosconfig import ROMSTARTUP.ecm
	ecosconfig resolve
	ecosconfig tree
	make -s
	make -C hal/common/current TESTS=tests/context tests

TEST

	install/tests/
	`-- hal
	    `-- common
		`-- current
			`-- context


Try to run the `context' test is built using the _different_ eCos
templates (minimal/default/net). Will you get the equal results?

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Difference between "go" on Script and manual enter?
  2007-07-23 20:05   ` Sergei Gavrikov
@ 2007-07-27  7:27     ` ariga masahiro
  2007-07-27 10:36       ` Gary Thomas
  0 siblings, 1 reply; 6+ messages in thread
From: ariga masahiro @ 2007-07-27  7:27 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

Hi ,

Concerning my question about Script "go" not going well,
(I re_post my first question below),
I traced applications in both cases
(that is,manually "go" and Script "go").

And I discovered some factors(although I can't pinpont darn cause)
of different behaviors.

I relate my finding in hope that you could pinpoint cause,
(I apologize,too difficult to fathom source.)
and appreciate you to resolve this pain in my neck.

I use abbreviations MAN for manually "go", SCR for Script "go".

Both cases,first try to diag_printf "Network stack using".
in diag.cxx
at function
_vprintf(void (*putc)(char c, void **param), void **param, const char *fmt, 
va_list ap)
(*putc)(c, param);      //here,MAN:print 'N' to host PC, SCR:nothing though 
c contains 'N'

from here I traced,
both traced to,
 _diag_write_char(char c, void **param)
 {
     diag_write_char(c);
 }

and,
 externC void diag_write_char(char c)
 {
     /* Translate LF into CRLF */

     if( c == '\n' )
     {
         HAL_DIAG_WRITE_CHAR('\r');
     }

     HAL_DIAG_WRITE_CHAR(c);
 }
and both execute HAL_DIAG_WRITE_CHAR(c);

after jump to
hal_if.h
 __data_VV(CYGNUM_CALL_IF_CONSOLE_PROCS, __call_if_console_procs_t)

hal_if.c
 void
 hal_if_diag_write_char(char c)
 {
     hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_CONSOLE_PROCS();

     if (__chan)
         CYGACC_COMM_IF_PUTC(*__chan, c);
     else {
         __chan = CYGACC_CALL_IF_DEBUG_PROCS();

         // FIXME: What should be done if assertions are not enabled?
         // This is a bad bad situation - we have no means for diag
         // output; we want to hit a breakpoint to alert the developer
         // or something like that.
         CYG_ASSERT(__chan, "No valid channel set");

         CYGACC_COMM_IF_PUTC(*__chan, c);
     }

     // Check interrupt flag
     if (CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG()) {
         CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG_SET(0);
         cyg_hal_user_break(0);
     }
 }

from here behaves differentry,
both cases execute CYGACC_COMM_IF_PUTC(*__chan, c);
MAN:
traced to
hal_if.c
 __call_voidCOMM1(IF_PUTC, void, __comm_if_putc_t, cyg_uint8)

and
 /* Lock the scheduler. */
 externC void cyg_scheduler_lock(void)
 {
     Cyg_Scheduler::lock();

and
     static void inc_sched_lock()
     {
         sched_lock++;
     };

then,SH serial routine,
/sh/sh3/v2_0/src/sh3_scif.c
 cyg_hal_plf_scif_putc(void* __ch_data, cyg_uint8 c)

and properly print string to host PC HYPERTERMINAL.

Whereras,
SCR:
traced to
hal_if.h
 __call_voidCOMM1(IF_PUTC, void, __comm_if_putc_t, cyg_uint8)

and
 externC void cyg_scheduler_lock(void)
 {
     Cyg_Scheduler::lock();
     // get_sched_lock() is unsigned, see below "cyg_ucount32 lock"
     CYG_ASSERT( (0xff000000 & (Cyg_Scheduler::get_sched_lock())) == 0,
                 "Scheduler overlocked" );
 }

and
  static void inc_sched_lock()
  {
      sched_lock++;
  };

and
 nop_service(void)
 {
     // This is the default service. It always returns false (0), and
     // _does not_ trigger any assertions. Clients must either cope
     // with the service failure or assert.
     return 0;
 }

and
 externC void cyg_scheduler_unlock(void)
 {
     cyg_ucount32 slock = Cyg_Scheduler::get_sched_lock();

after repeat,and never jump to
       cyg_hal_plf_scif_putc(void* __ch_data, cyg_uint8 c)
and nothin print to host PC

I think CYGACC_COMM_IF_PUTC is setted in
cyg_hal_plf_scif_init(int scif_index, int comm_index,
                      int rcv_vect, cyg_uint8* base)
{
      |
      |

    // Initialize channel procs
    CYGACC_CALL_IF_SET_CONSOLE_COMM(comm_index);
    comm = CYGACC_CALL_IF_CONSOLE_PROCS();
    CYGACC_COMM_IF_CH_DATA_SET(*comm, chan);
    CYGACC_COMM_IF_WRITE_SET(*comm, cyg_hal_plf_scif_write);
    CYGACC_COMM_IF_READ_SET(*comm, cyg_hal_plf_scif_read);
    CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_plf_scif_putc);
    CYGACC_COMM_IF_GETC_SET(*comm, cyg_hal_plf_scif_getc);
    CYGACC_COMM_IF_CONTROL_SET(*comm, cyg_hal_plf_scif_control);
    CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_scif_isr);
    CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_scif_getc_timeout);

    // Restore original console
    CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);
}

and both cases execute this routine at starting time.
all points considered,converge to next part.

 hal_if_diag_write_char(char c)
 {
     hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_CONSOLE_PROCS();

here, I am sorry my spirit collapsed.

Do you think this part happens to be any cause of my trouble?

Please enlighten me.

Masahiro Ariga

-- Below is my first question.
> I tested and confirmed that it worked,
> when I loaded ROM-reserved application using "fis load"
> and executed "go" command manually(that is, entered commands at
> RedBoot prompt).
>
> But when I tried to do the same thing on Boot Script,
> application never ran !!
>
> Strangely,if I write only "fis load" on Script,execute Script,
> and after that I enter "go" command manually and execute,
> then application properly run.
>
> I wonder what is difference between excuting "go" manually
> and on Boot Script.
>
> I tried some delays before "go", but no effect.
>
> I post both outputs,and "fconfig" entering log.
>
> first only execute "fis load" on Script,
> ------------------
> My Flash ID is 4:22f9:19:0
> config=0x8ffee000 cfg_base=0xa03ff000
> Ethernet eth0: MAC address 00:40:31:08:01:00
> IP: 0.0.0.0/255.255.255.0, Gateway: 0.0.0.0
> Default server: 0.0.0.8, DNS server IP: 0.0.0.8
>
> RedBoot(tm) bootstrap and debug environment [ROM]
> Non-certified release, version v2_0 - built 13:16:32, Jul 20 2007
>
> Platform: inserter (SH 7709S)
> Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
>
> RAM: 0x8c000000-0x90000000, 0x8c00afa0-0x8ffed000 available
> FLASH: 0xa0000000 - 0xa0400000, 64 blocks of 0x00010000 bytes each.
> == Executing boot script in 3.000 seconds - enter ^C to abort
> RedBoot> fis load -b 0x8c010000 basic1
> RedBoot>
> ------------------
>
> then,enter "go" manually,and application ran,
> ------------------
> RedBoot> go 0x8c010000
> Network stack using 65536 bytes for misc space
>                    65536 bytes for mbufs
>                    131072 bytes for mbuf clusters
> [cyg_net_init] Init: mbinit(0x00000000)
> [cyg_net_init] Init: cyg_net_init_devs(0x00000000)
> Init device 'lan91cxx_eth0'
> [cyg_net_init] Init: loopattach(0x00000000)
> [cyg_net_init] Init: ifinit(0x00000000)
> IFP: 0x8c0427e0, next: 0x8c0904d8
> IFP: 0x8c0904d8, next: 0x00000000
> [cyg_net_init] Init: domaininit(0x00000000)
> [cyg_net_init] Init: cyg_net_add_domain(0x8c0431d4)
> New domain internet at 0x00000000
> [cyg_net_init] Init: cyg_net_add_domain(0x8c042c5c)
> New domain route at 0x00000000
> [cyg_net_init] Init: cyg_route_init(0x00000000)
> [cyg_net_init] Done
> Hello eCos World!!!
>
> Thread A, count: 1  message: 75
> Thread A, count: 2  message: 75
> Thread B, message: 68
> ------------------
>
> then,excute both commands on Script,
> Application never ran,
> ------------------
> My Flash ID is 4:22f9:19:0
> config=0x8ffee000 cfg_base=0xa03ff000
> Ethernet eth0: MAC address 00:40:31:08:01:00
> IP: 0.0.0.0/255.255.255.0, Gateway: 0.0.0.0
> Default server: 0.0.0.8, DNS server IP: 0.0.0.8
>
> RedBoot(tm) bootstrap and debug environment [ROM]
> Non-certified release, version v2_0 - built 13:16:32, Jul 20 2007
>
> Platform: inserter (SH 7709S)
> Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
>
> RAM: 0x8c000000-0x90000000, 0x8c00afa0-0x8ffed000 available
> FLASH: 0xa0000000 - 0xa0400000, 64 blocks of 0x00010000 bytes each.
> == Executing boot script in 3.000 seconds - enter ^C to abort
> RedBoot> fis load -b 0x8c010000 basic1
> RedBoot> go 0x8c010000 -w 5
> About to start execution at 0x8c010000 - abort with ^C within 5 seconds
> ------------------
>
> next is "fconfig" entering log,
> ------------------
> RedBoot> fconfig
> Run script at boot: true
> Boot script:
> .. fis load -b 0x8c010000 basic1
> Enter script, terminate with empty line
>>> fis load -b 0x8c010000 basic1
>>> go 0x8c010000 -w 5
>>>
> Boot script timeout (1000ms resolution): 3
> Use BOOTP for network configuration: false
> Gateway IP address:
> Local IP address:
> Local IP address mask: 255.255.255.0
> Default server IP address: 0.0.0.8
> Console baud rate: 38400
> DNS server IP address: 0.0.0.8
> GDB connection port: 9000
> Force console for special debug messages: false
> Network hardware address [MAC]: 0x00:0x40:0x31:0x08:0x01:0x00
> Network debug at boot time: false
> Update RedBoot non-volatile configuration - continue (y/n)? y
> ... Erase from 0xa03f0000-0xa0400000: .
> ... Program from 0x8ffef000-0x8ffff000 at 0xa03f0000: .
> RedBoot>
> ------------------
>
> My Application is a sample program in Anthony J. Massa's "Embedded
> Software Development with eCos".


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Difference between "go" on Script and manual enter?
  2007-07-27  7:27     ` ariga masahiro
@ 2007-07-27 10:36       ` Gary Thomas
  2007-07-30  5:44         ` ariga masahiro
  0 siblings, 1 reply; 6+ messages in thread
From: Gary Thomas @ 2007-07-27 10:36 UTC (permalink / raw)
  To: ariga masahiro; +Cc: Sergei Gavrikov, ecos-discuss

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ariga masahiro wrote:
> Hi ,
> 
> Concerning my question about Script "go" not going well,
> (I re_post my first question below),
> I traced applications in both cases
> (that is,manually "go" and Script "go").

Does your system have more than one serial port?  If so, are you
using what RedBoot considers channel #0?  This can explain a difference
in behaviour between script 'go' and typing 'go'.  The reason is
that RedBoot has a notion of the "current" console.  When it comes
up, there is a default (channel 0).  RedBoot will display output on
*all* available channels, and accept input from *any* channel, until
the first character is typed.  That device/channel then becomes the
current console.  When you execute your eCos program, I/O is directed
(via RedBoot) to the current console.

So, if you are actually connected to channel #1, when you run the
script, I/O will be going to channel #0, thus you don't see it!  If
you type commands instead, the eCos I/O will properly go to channel #1.

If this matches your setup - try using the other serial port :-)

> 
> And I discovered some factors(although I can't pinpont darn cause)
> of different behaviors.
> 
> I relate my finding in hope that you could pinpoint cause,
> (I apologize,too difficult to fathom source.)
> and appreciate you to resolve this pain in my neck.
> 
> I use abbreviations MAN for manually "go", SCR for Script "go".
> 
> Both cases,first try to diag_printf "Network stack using".
> in diag.cxx
> at function
> _vprintf(void (*putc)(char c, void **param), void **param, const char
> *fmt, va_list ap)
> (*putc)(c, param);      //here,MAN:print 'N' to host PC, SCR:nothing
> though c contains 'N'
> 
> from here I traced,
> both traced to,
> _diag_write_char(char c, void **param)
> {
>     diag_write_char(c);
> }
> 
> and,
> externC void diag_write_char(char c)
> {
>     /* Translate LF into CRLF */
> 
>     if( c == '\n' )
>     {
>         HAL_DIAG_WRITE_CHAR('\r');
>     }
> 
>     HAL_DIAG_WRITE_CHAR(c);
> }
> and both execute HAL_DIAG_WRITE_CHAR(c);
> 
> after jump to
> hal_if.h
> __data_VV(CYGNUM_CALL_IF_CONSOLE_PROCS, __call_if_console_procs_t)
> 
> hal_if.c
> void
> hal_if_diag_write_char(char c)
> {
>     hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_CONSOLE_PROCS();
> 
>     if (__chan)
>         CYGACC_COMM_IF_PUTC(*__chan, c);
>     else {
>         __chan = CYGACC_CALL_IF_DEBUG_PROCS();
> 
>         // FIXME: What should be done if assertions are not enabled?
>         // This is a bad bad situation - we have no means for diag
>         // output; we want to hit a breakpoint to alert the developer
>         // or something like that.
>         CYG_ASSERT(__chan, "No valid channel set");
> 
>         CYGACC_COMM_IF_PUTC(*__chan, c);
>     }
> 
>     // Check interrupt flag
>     if (CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG()) {
>         CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG_SET(0);
>         cyg_hal_user_break(0);
>     }
> }
> 
> from here behaves differentry,
> both cases execute CYGACC_COMM_IF_PUTC(*__chan, c);
> MAN:
> traced to
> hal_if.c
> __call_voidCOMM1(IF_PUTC, void, __comm_if_putc_t, cyg_uint8)
> 
> and
> /* Lock the scheduler. */
> externC void cyg_scheduler_lock(void)
> {
>     Cyg_Scheduler::lock();
> 
> and
>     static void inc_sched_lock()
>     {
>         sched_lock++;
>     };
> 
> then,SH serial routine,
> /sh/sh3/v2_0/src/sh3_scif.c
> cyg_hal_plf_scif_putc(void* __ch_data, cyg_uint8 c)
> 
> and properly print string to host PC HYPERTERMINAL.
> 
> Whereras,
> SCR:
> traced to
> hal_if.h
> __call_voidCOMM1(IF_PUTC, void, __comm_if_putc_t, cyg_uint8)
> 
> and
> externC void cyg_scheduler_lock(void)
> {
>     Cyg_Scheduler::lock();
>     // get_sched_lock() is unsigned, see below "cyg_ucount32 lock"
>     CYG_ASSERT( (0xff000000 & (Cyg_Scheduler::get_sched_lock())) == 0,
>                 "Scheduler overlocked" );
> }
> 
> and
>  static void inc_sched_lock()
>  {
>      sched_lock++;
>  };
> 
> and
> nop_service(void)
> {
>     // This is the default service. It always returns false (0), and
>     // _does not_ trigger any assertions. Clients must either cope
>     // with the service failure or assert.
>     return 0;
> }
> 
> and
> externC void cyg_scheduler_unlock(void)
> {
>     cyg_ucount32 slock = Cyg_Scheduler::get_sched_lock();
> 
> after repeat,and never jump to
>       cyg_hal_plf_scif_putc(void* __ch_data, cyg_uint8 c)
> and nothin print to host PC
> 
> I think CYGACC_COMM_IF_PUTC is setted in
> cyg_hal_plf_scif_init(int scif_index, int comm_index,
>                      int rcv_vect, cyg_uint8* base)
> {
>      |
>      |
> 
>    // Initialize channel procs
>    CYGACC_CALL_IF_SET_CONSOLE_COMM(comm_index);
>    comm = CYGACC_CALL_IF_CONSOLE_PROCS();
>    CYGACC_COMM_IF_CH_DATA_SET(*comm, chan);
>    CYGACC_COMM_IF_WRITE_SET(*comm, cyg_hal_plf_scif_write);
>    CYGACC_COMM_IF_READ_SET(*comm, cyg_hal_plf_scif_read);
>    CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_plf_scif_putc);
>    CYGACC_COMM_IF_GETC_SET(*comm, cyg_hal_plf_scif_getc);
>    CYGACC_COMM_IF_CONTROL_SET(*comm, cyg_hal_plf_scif_control);
>    CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_scif_isr);
>    CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_scif_getc_timeout);
> 
>    // Restore original console
>    CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);
> }
> 
> and both cases execute this routine at starting time.
> all points considered,converge to next part.
> 
> hal_if_diag_write_char(char c)
> {
>     hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_CONSOLE_PROCS();
> 
> here, I am sorry my spirit collapsed.
> 
> Do you think this part happens to be any cause of my trouble?
> 
> Please enlighten me.
> 
> Masahiro Ariga
> 
> -- Below is my first question.
>> I tested and confirmed that it worked,
>> when I loaded ROM-reserved application using "fis load"
>> and executed "go" command manually(that is, entered commands at
>> RedBoot prompt).
>>
>> But when I tried to do the same thing on Boot Script,
>> application never ran !!
>>
>> Strangely,if I write only "fis load" on Script,execute Script,
>> and after that I enter "go" command manually and execute,
>> then application properly run.
>>
>> I wonder what is difference between excuting "go" manually
>> and on Boot Script.
>>
>> I tried some delays before "go", but no effect.
>>
>> I post both outputs,and "fconfig" entering log.
>>
>> first only execute "fis load" on Script,
>> ------------------
>> My Flash ID is 4:22f9:19:0
>> config=0x8ffee000 cfg_base=0xa03ff000
>> Ethernet eth0: MAC address 00:40:31:08:01:00
>> IP: 0.0.0.0/255.255.255.0, Gateway: 0.0.0.0
>> Default server: 0.0.0.8, DNS server IP: 0.0.0.8
>>
>> RedBoot(tm) bootstrap and debug environment [ROM]
>> Non-certified release, version v2_0 - built 13:16:32, Jul 20 2007
>>
>> Platform: inserter (SH 7709S)
>> Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
>>
>> RAM: 0x8c000000-0x90000000, 0x8c00afa0-0x8ffed000 available
>> FLASH: 0xa0000000 - 0xa0400000, 64 blocks of 0x00010000 bytes each.
>> == Executing boot script in 3.000 seconds - enter ^C to abort
>> RedBoot> fis load -b 0x8c010000 basic1
>> RedBoot>
>> ------------------
>>
>> then,enter "go" manually,and application ran,
>> ------------------
>> RedBoot> go 0x8c010000
>> Network stack using 65536 bytes for misc space
>>                    65536 bytes for mbufs
>>                    131072 bytes for mbuf clusters
>> [cyg_net_init] Init: mbinit(0x00000000)
>> [cyg_net_init] Init: cyg_net_init_devs(0x00000000)
>> Init device 'lan91cxx_eth0'
>> [cyg_net_init] Init: loopattach(0x00000000)
>> [cyg_net_init] Init: ifinit(0x00000000)
>> IFP: 0x8c0427e0, next: 0x8c0904d8
>> IFP: 0x8c0904d8, next: 0x00000000
>> [cyg_net_init] Init: domaininit(0x00000000)
>> [cyg_net_init] Init: cyg_net_add_domain(0x8c0431d4)
>> New domain internet at 0x00000000
>> [cyg_net_init] Init: cyg_net_add_domain(0x8c042c5c)
>> New domain route at 0x00000000
>> [cyg_net_init] Init: cyg_route_init(0x00000000)
>> [cyg_net_init] Done
>> Hello eCos World!!!
>>
>> Thread A, count: 1  message: 75
>> Thread A, count: 2  message: 75
>> Thread B, message: 68
>> ------------------
>>
>> then,excute both commands on Script,
>> Application never ran,
>> ------------------
>> My Flash ID is 4:22f9:19:0
>> config=0x8ffee000 cfg_base=0xa03ff000
>> Ethernet eth0: MAC address 00:40:31:08:01:00
>> IP: 0.0.0.0/255.255.255.0, Gateway: 0.0.0.0
>> Default server: 0.0.0.8, DNS server IP: 0.0.0.8
>>
>> RedBoot(tm) bootstrap and debug environment [ROM]
>> Non-certified release, version v2_0 - built 13:16:32, Jul 20 2007
>>
>> Platform: inserter (SH 7709S)
>> Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
>>
>> RAM: 0x8c000000-0x90000000, 0x8c00afa0-0x8ffed000 available
>> FLASH: 0xa0000000 - 0xa0400000, 64 blocks of 0x00010000 bytes each.
>> == Executing boot script in 3.000 seconds - enter ^C to abort
>> RedBoot> fis load -b 0x8c010000 basic1
>> RedBoot> go 0x8c010000 -w 5
>> About to start execution at 0x8c010000 - abort with ^C within 5 seconds
>> ------------------
>>
>> next is "fconfig" entering log,
>> ------------------
>> RedBoot> fconfig
>> Run script at boot: true
>> Boot script:
>> .. fis load -b 0x8c010000 basic1
>> Enter script, terminate with empty line
>>>> fis load -b 0x8c010000 basic1
>>>> go 0x8c010000 -w 5
>>>>
>> Boot script timeout (1000ms resolution): 3
>> Use BOOTP for network configuration: false
>> Gateway IP address:
>> Local IP address:
>> Local IP address mask: 255.255.255.0
>> Default server IP address: 0.0.0.8
>> Console baud rate: 38400
>> DNS server IP address: 0.0.0.8
>> GDB connection port: 9000
>> Force console for special debug messages: false
>> Network hardware address [MAC]: 0x00:0x40:0x31:0x08:0x01:0x00
>> Network debug at boot time: false
>> Update RedBoot non-volatile configuration - continue (y/n)? y
>> ... Erase from 0xa03f0000-0xa0400000: .
>> ... Program from 0x8ffef000-0x8ffff000 at 0xa03f0000: .
>> RedBoot>
>> ------------------
>>
>> My Application is a sample program in Anthony J. Massa's "Embedded
>> Software Development with eCos".
> 
> 


- --
- ------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
- ------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFGqcqgmaKbSsQGV8ARAoTwAJ9pZoWKE/u+e25I4BT92RHzVyA1EQCgsHz1
xxAzcfaYDSO5UtxpeIKPYVk=
=SSde
-----END PGP SIGNATURE-----

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Difference between "go" on Script and manual enter?
  2007-07-27 10:36       ` Gary Thomas
@ 2007-07-30  5:44         ` ariga masahiro
  0 siblings, 0 replies; 6+ messages in thread
From: ariga masahiro @ 2007-07-30  5:44 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Sergei Gavrikov, ecos-discuss

Hi,

Gary wrote,
> So, if you are actually connected to channel #1, when you run the
> script, I/O will be going to channel #0, thus you don't see it!  If
> you type commands instead, the eCos I/O will properly go to channel #1.

Yes ! Since I couldn't make RedBoot output to HyperTerminal using channel 0,
I used channel 1 in load command like,
load -v -m ymodem -c 1

I added "channel 1" before "go" in Script,then worked beautifully.

Thank you,Gary, you saved my life!

Masahiro Ariga 


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-07-30  5:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-20  7:41 [ECOS] Difference between "go" on Script and manual enter? ariga masahiro
2007-07-23  4:25 ` ariga masahiro
2007-07-23 20:05   ` Sergei Gavrikov
2007-07-27  7:27     ` ariga masahiro
2007-07-27 10:36       ` Gary Thomas
2007-07-30  5:44         ` ariga masahiro

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).