public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Halting RedBoot
@ 2010-04-01 14:13 Stefano Mora
  0 siblings, 0 replies; 5+ messages in thread
From: Stefano Mora @ 2010-04-01 14:13 UTC (permalink / raw)
  To: 'ecos-discuss@ecos.sourceware.org'

No, i'm sorry.
I found that _rb_gets() in cyg_start() returns immediately of no keys are pressed.
It has no return if i press keys until Return key.
Can turn it into a non blocked call if i press anyother keys than ^C (and timeout) ??
________________________________

Ing. Stefano Mora


--
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] 5+ messages in thread

* Re: [ECOS] Halting RedBoot
  2010-04-01 14:26 S. Z.
@ 2010-04-01 14:33 ` Gary Thomas
  0 siblings, 0 replies; 5+ messages in thread
From: Gary Thomas @ 2010-04-01 14:33 UTC (permalink / raw)
  To: S. Z.; +Cc: smora, ecos-discuss

On 04/01/2010 08:26 AM, S. Z. wrote:
> Hi,
>
> I had the same problem. I solved it by using the following code in packages/redboot/src/main.c :
>
>          while (script_timeout_ms>= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT) {
>          #if 1
>              if(_rb_break(CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT)){
>                  res = _GETS_CTRLC;
>                  break;
>              } else {
>                  res = _GETS_TIMEOUT;
>              }
>          #else
>              res = _rb_gets(line, sizeof(line), CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT);
>              if (res>= _GETS_OK) {
>                  diag_printf("== Executing boot script in %d.%03d seconds - enter ^C to abort\n",
>                              script_timeout_ms/1000, script_timeout_ms%1000);
>                  continue;  // Ignore anything but ^C
>              }
>              if (res != _GETS_TIMEOUT) break;
>          #endif
>              script_timeout_ms -= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT;
>          }
>
> HTH
>    Stamatis

Yes, that does look like it will work.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

-- 
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] 5+ messages in thread

* [ECOS] Halting RedBoot
@ 2010-04-01 14:26 S. Z.
  2010-04-01 14:33 ` Gary Thomas
  0 siblings, 1 reply; 5+ messages in thread
From: S. Z. @ 2010-04-01 14:26 UTC (permalink / raw)
  To: smora; +Cc: ecos-discuss

Hi,

I had the same problem. I solved it by using the following code in packages/redboot/src/main.c :

        while (script_timeout_ms >= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT) {
        #if 1
            if(_rb_break(CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT)){
                res = _GETS_CTRLC;
                break;
            } else {
                res = _GETS_TIMEOUT;
            }
        #else
            res = _rb_gets(line, sizeof(line), CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT);
            if (res >= _GETS_OK) {
                diag_printf("== Executing boot script in %d.%03d seconds - enter ^C to abort\n", 
                            script_timeout_ms/1000, script_timeout_ms%1000);
                continue;  // Ignore anything but ^C
            }
            if (res != _GETS_TIMEOUT) break;
        #endif
            script_timeout_ms -= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT;
        }

HTH
  Stamatis

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com

--
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] 5+ messages in thread

* Re: [ECOS] Halting RedBoot
  2010-04-01 12:29 Stefano Mora
@ 2010-04-01 14:23 ` Gary Thomas
  0 siblings, 0 replies; 5+ messages in thread
From: Gary Thomas @ 2010-04-01 14:23 UTC (permalink / raw)
  To: Stefano Mora; +Cc: 'ecos-discuss@ecos.sourceware.org'

On 04/01/2010 06:28 AM, Stefano Mora wrote:
> Hi there,
> I'm in a trouble with RedBoot cause during the boot it receives a character from the serial port (different from ^C) and the boot stops waiting for a Return.
> I don't need this behaviour cause the serial port is shared with a printer that, when the board powers up, sends a char then the board stops.
>
> My question is:
> How can i jump it?
> The code that enable the behaviour is
>          } else {
>                  script = hold_script;
>          }
> ??
>
> If i comment out this code the bootloader can stops only with Ctrl-C ??

No, this is not how to fix the problem.

The problem is that this loop is calling _rb_gets() which is
expecting to read an entire line from the console.  If that
function sees any characters, it will wait until a complete
line is entered, regardless of the timeout.

The correct way to fix this would be to use mon_read_char_with_timeout()
instead of _rb_gets().  This will take a little while to update and
test, but if you're patient I'll give you a patch to try.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

-- 
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] 5+ messages in thread

* [ECOS] Halting RedBoot
@ 2010-04-01 12:29 Stefano Mora
  2010-04-01 14:23 ` Gary Thomas
  0 siblings, 1 reply; 5+ messages in thread
From: Stefano Mora @ 2010-04-01 12:29 UTC (permalink / raw)
  To: 'ecos-discuss@ecos.sourceware.org'

Hi there,
I'm in a trouble with RedBoot cause during the boot it receives a character from the serial port (different from ^C) and the boot stops waiting for a Return.
I don't need this behaviour cause the serial port is shared with a printer that, when the board powers up, sends a char then the board stops.

My question is:
How can i jump it?
The code that enable the behaviour is
        } else {
                script = hold_script;
        }
??

If i comment out this code the bootloader can stops only with Ctrl-C ??

Thanks!
________________________________

Ing. Stefano Mora

--
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] 5+ messages in thread

end of thread, other threads:[~2010-04-01 14:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-01 14:13 [ECOS] Halting RedBoot Stefano Mora
  -- strict thread matches above, loose matches on Subject: below --
2010-04-01 14:26 S. Z.
2010-04-01 14:33 ` Gary Thomas
2010-04-01 12:29 Stefano Mora
2010-04-01 14:23 ` Gary Thomas

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