This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Return to RedBoot
On Fri, 20 Oct 2006, Mark Salter wrote:
On Thu, 2006-10-19 at 21:35 +0300, Sergei Gavrikov wrote:
Dear eCos/RedBoot Experts,
I have a question. Is it possible to organize a work with RedBoot like
with sub-shell system? Well, may be it's a stupid idea. Does exist a
way to return from a loaded application back in RedBoot? I brief looked
at `do_go' command of RedBoot. I noticed a thing called a trampoline.
It looks like what those `trampoline' and `return_to_redboot' functions
were designed to service a comeback to RedBoot. Is that right? But I see
never this RedBoot message on my ARM target:
"Program completed with status 0"
Should I have a _special_ way to terminate a running eCos application? I
Try using CYGACC_CALL_IF_MONITOR_RETURN(0);
The argument is the returned exit status.
This has limited use though. It only really works if the application
returning to RedBoot has not modified/reprogrammed resources being
used by RedBoot. Things like reprogramming the timer used by RedBoot
would cause problems...
--Mark
Mark, Thank you! I didn't know about this VV call. I had a taste this.
It quite works for "hello, world!" program for _minimal_ eCos template
on my target, but no more. Well, I got it.
Such a program returned a control and didn't destroy the RedBoot's
country. It worked as I did expect.
// Minimalist program which returns a control to RedBoot
#include <pkgconf/hal.h>
#include <cyg/hal/hal_if.h> // VV macro defs
#include <cyg/infra/diag.h> // diag_printf
void
cyg_start (void)
{
diag_printf ("Hello, ECos World!\n");
CYGACC_CALL_IF_MONITOR_RETURN (0); // return to RedBoot
}
Thanks again,
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