This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
e7t ROM startup
- To: <ecos-discuss at sources dot redhat dot com>
- Subject: [ECOS] e7t ROM startup
- From: "Ravi Kumar B S" <ravikbs at mindtree dot com>
- Date: Tue, 25 Sep 2001 15:46:03 +0530
hi all,
i am still not out of the problem. i have really stuch up here from past one
week.
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.
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.
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/pkgconf/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[] = "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 */
};
static void
__dummy(void *p)
{
}
void __dummy_init(void)
{
__dummy((void*)&__hdr);
}
_Counter_init(__dummy_init, RedBoot_INIT_LAST);
regards,
ravi kumar.