This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: e7t ROM startup
- To: "Ravi Kumar B S" <ravikbs at mindtree dot com>, <ecos-discuss at sources dot redhat dot com>
- Subject: RE: [ECOS] e7t ROM startup
- From: "Robert Cragie" <rcc at jennic dot com>
- Date: Wed, 26 Sep 2001 15:52:23 +0100
I have not used the Evaluator E7T, but have used the Integrator. I have had
a quick look through the Evaluator E7T User Guide and come up with some
suggestions - I hope they are right.
> here i am trying to add the module header to a sample application and put
> that in the flash and run it from there. as suggested earlier i
> am trying to
> follow the same procedure which is used to build the redboot. i am able to
> build the image (uuencoded) and put that to the flash. after 'flashwrite',
> when i say rommodules, it is not displaying the application
> (supposed to be a
> module) which i have put in the flash. the part of the make file
> which i have
> used to build the standalone application is there at the end of
> the mail. i
> am also providing the counter_module.c where i have defined the module
> header.
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.
>
> am i missing anything else? can somebody help in resolving this problem? i
> will not be able to move further as this is very critical for my project.
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.
> 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=`$(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>
********* You don't need this - remove it (begin)
>
> /* ARM e7t module stuff */
>
> #ifndef CHECKSUM
> #define CHECKSUM 0x0
> #endif
>
> extern char __exception_handlers, __rom_data_end;
>
> const char __title[] = "Counter";
> const char __help[] = "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 =
> {
> 0x4D484944, /* identifies the module header */
> 2, /* flag = 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 */
> };
********* You don't need this - remove it (end)
>
> static void
> __dummy(void *p)
> {
> }
>
> void __dummy_init(void)
> {
> __dummy((void*)&__hdr);
> }
>
> _Counter_init(__dummy_init, RedBoot_INIT_LAST);
>
>
> regards,
> ravi kumar.
>
>