This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re:e7t ROM startup
- To: <ecos-discuss at sources dot redhat dot com>
- Subject: [ECOS] Re:e7t ROM startup
- From: "Ravi Kumar B S" <ravikbs at mindtree dot com>
- Date: Wed, 26 Sep 2001 20:56:36 +0530
hi,
thanks for reply.
i tried what ever you have suggested. but without any success.=20
I think you should be using 'flashload' (p 4-17 of Evaluator E7T User
Guide), not 'flashwrite'. As far as I can tell, 'flashwrite' is a 'raw'
write to the flash, i.e. copies RAM to flash, without putting any module
header on.
i tried using the flashload but it is not giving any success.
According to p 4-29 of Evaluator E7T User Guide, I don't think you need =
to
include a module header in your code; this will be added by the =
bootstrap
loader. This may well confuse the module management software.
i dont think that BSL will add any thing to our application. because =
when
building the redboot the module header is explicitly added(
packages/hal/arm/e7t/current/cdl/hal_arm_e7t.cdl). and i am able to =
build the
redboot and put it in the flash and see that it is listed when i say
'rommodules'. what really wonder is if it is possible to add the module
header for the redboot why cant it be added for any other application =
and
make it work similarly. that is why i still doubt that i am missing in =
adding
the modul header. is it possible to look at the make file and the module
header file and tell me if i am missing anything.
thanks and regards,
/Ravi kumar.
> note: counter.c is my sample application and counter_module.c is the =
file
> which contains the module header.
>
> counter: $(wildcard
> $(REPOSITORY)/arm-ecos-standalone/counter/counter_module.c
> $(PREFIX)/lib/target.ld $(PREFIX)/lib/vectors.o =
$(PREFIX)/lib/libtarget.a
> $(PREFIX)/lib/libextras.a)
> # First build version with no checksum.
> @echo "First build version with no checksum."
> $(XCC) -c -I$(INCLUDE_PATH) counter.c
> $(XCC) -c -I$(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<)
> $(CFLAGS) -o
> counter_ncs.o $<
> $(XCC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o =
counter_ncs.tmp
> counter_ncs.o counter.o
> $(OBJCOPY) --strip-debug counter_ncs.tmp counter_ncs.img
> $(OBJCOPY) -O binary counter_ncs.img counter_ncs.bin
> # Then build version with checksum from previously built =
image.
> $(XCC) -c -DCHECKSUM=3D`$(dir $<)flash_cksum.tcl =
counter_ncs.bin`
> -I$(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o
> counter_cs.o $<
> $(XCC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o =
counter_cs.tmp
> counter_cs.o counter.o
> $(OBJCOPY) --strip-debug counter_cs.tmp counter.img
> $(OBJCOPY) -O binary counter.img counter.bin
> uuencode counter.bin counter.bin.tmp | tr '`' ' ' > counter.UU
>
> --------------------------------------------------------
> counter_module.c
> --------------------------------------------------------
>
> /* This is the module 'wrapper' for a simple application */
>
> /* #include
> </u/ARM/new_ecos/packages/arm-ecos-standalone/install/include/pkgc
> onf/hal.h>
> */
> #include <pkgconf/hal.h>
> #include <cyg/infra/cyg_type.h>
> #include <cyg/hal/hal_stub.h>
>
> /* ARM e7t module stuff */
>
> #ifndef CHECKSUM
> #define CHECKSUM 0x0
> #endif
>
> extern char __exception_handlers, __rom_data_end;
>
> const char __title[] =3D "Counter";
> const char __help[] =3D "Counter " __DATE__;
>
> struct ModuleHeader {
> cyg_uint32 magic;
> cyg_uint16 flags;
> cyg_uint8 major;
> cyg_uint8 minor;
> cyg_uint32 checksum;
> cyg_uint32 ro_base;
> cyg_uint32 ro_limit;
> cyg_uint32 rw_base;
> cyg_uint32 zi_base;
> cyg_uint32 zi_limit;
> cyg_uint32 self;
> cyg_uint32 start;
> cyg_uint32 init;
> cyg_uint32 final;
> cyg_uint32 service;
> cyg_uint32 title;
> cyg_uint32 help;
> cyg_uint32 cmdtbl;
> cyg_uint32 swi_base;
> cyg_uint32 swi_handler;
> };
>
> const static struct ModuleHeader __hdr =3D
> {
> 0x4D484944, /* identifies the module header */
> 2, /* flag =3D auto start */
> 1, /* major version */
> 0, /* minor version */
> CHECKSUM, /* checksum */
> (cyg_uint32) &__exception_handlers, /* start of
> module (read-only) image */
> (cyg_uint32) &__rom_data_end, /* end of image */
> 0, /* r/w base - unused */
> 0, /* bss base - unused */
> 0, /* bss limit - unused */
> (cyg_uint32) &__hdr, /* self (for module identification) */
> (cyg_uint32) &__exception_handlers, /* startup */
> 0, /* init */
> 0, /* final */
> 0, /* service */
> (cyg_uint32) &__title, /* title */
> (cyg_uint32) &__help, /* help string */
> 0, /* command table - unused */
> 0, /* SWI table - unsused */
> 0, /* SWI handler - unused */
> };
>
> static void
> __dummy(void *p)
> {
> }
>
> void __dummy_init(void)
> {
> __dummy((void*)&__hdr);
> }
>
> _Counter_init(__dummy_init, RedBoot_INIT_LAST);
>
>