This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
both redboot and application 'ROM' startup
- From: qiulinyuan <qlytianya at hotmail dot com>
- To: <ecos-discuss at ecos dot sourceware dot org>
- Date: Tue, 7 Sep 2010 11:15:04 +0800
- Subject: [ECOS] both redboot and application 'ROM' startup
Hi All,
Gernally, RedBoot use startup type "ROM", and application use startup type "RAM", then we can use RedBoot "load" application into ram and "go" it.
But I want to set both the redboot and application of ecos execute in flash.
I have got some informations from this mailing list about this problem.I have known that the files rom.ldi and rom.h in the pkgconf directory should be modified before compiling the application.
Bellowing is the rom.h and rom.ldi for the redboot.
rom.h
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
#endif
#define CYGMEM_REGION_ram (0x30000000)
#define CYGMEM_REGION_ram_SIZE (0x00200000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#define CYGMEM_REGION_rom (0x80000000)
#define CYGMEM_REGION_rom_SIZE (0x1000000)
#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
#define CYGMEM_REGION_sram (0x73000000)
#define CYGMEM_REGION_sram_SIZE (0x4000)
#define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x30200000 - (size_t) CYG_LABEL_NAME (__heap1))
rom.ldi
#include <cyg/infra/cyg_type.inc>
MEMORY
{
ram : ORIGIN = 0x30000000, LENGTH = 0x00200000
rom : ORIGIN = 0x80000000, LENGTH = 0x1000000
sram : ORIGIN = 0x73000000, LENGTH = 0x4000
}
SECTIONS
{
SECTIONS_BEGIN
SECTION_rom_vectors (rom, 0x80000000, LMA_EQ_VMA)
SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_RELOCS (rom, ALIGN (0x1), LMA_EQ_VMA)
SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_got (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_eh_frame (rom, ALIGN (0x04), LMA_EQ_VMA)
SECTION_fixed_vectors (ram, 0x30000020, LMA_EQ_VMA)
SECTION_data (ram, 0x30008000, FOLLOWING (.eh_frame))
SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
SECTIONS_END
}
The redboot works well. Then I modified the files for the applicaion as follows
rom.h
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
#endif
#define CYGMEM_REGION_ram (0x30000000)
#define CYGMEM_REGION_ram_SIZE (0x00200000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#define CYGMEM_REGION_rom (0x80100000)
#define CYGMEM_REGION_rom_SIZE (0x1000000)
#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
#define CYGMEM_REGION_sram (0x73000000)
#define CYGMEM_REGION_sram_SIZE (0x4000)
#define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x30200000 - (size_t) CYG_LABEL_NAME (__heap1))
rom.ldi
#include <cyg/infra/cyg_type.inc>
MEMORY
{
ram : ORIGIN = 0x30000000, LENGTH = 0x00200000
rom : ORIGIN = 0x80100000, LENGTH = 0x1000000
sram : ORIGIN = 0x73000000, LENGTH = 0x4000
}
SECTIONS
{
SECTIONS_BEGIN
SECTION_rom_vectors (rom, 0x80100000, LMA_EQ_VMA)
SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_RELOCS (rom, ALIGN (0x1), LMA_EQ_VMA)
SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_got (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_eh_frame (rom, ALIGN (0x04), LMA_EQ_VMA)
SECTION_fixed_vectors (ram, 0x30000020, LMA_EQ_VMA)
SECTION_data (ram, 0x30008000, FOLLOWING (.eh_frame))
SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
SECTIONS_END
}
Then I compile the application and flash the application at 0x80100000.
However the application don't work well,it stopped at the sentence 'bl cyg_start' in the file vector.S.
Does anyone have done this ? And could somebody give me more details about how to set both the redboot and application execute in flash?
Thanks a lot!
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss