This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Running code from external ram on the AT91SAM7SE
- From: "Tom Deconinck" <t dot deconinck at gmail dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Tue, 6 Nov 2007 11:13:24 +0100
- Subject: [ECOS] Running code from external ram on the AT91SAM7SE
Hello,
I having problems running code out of external SDRAM on the
AT91SAM7SE512. This is a CPU similar to the AT91SAM7S family, but it
has an external bus interface and an integrated SDRAM controller.
So far I have tried an eCos minimal setup and a 'normal' hello world
application, both without any success.
My setup is as follows: I have a BDI2000 that sets up and configures
the SDRAM controller, then I use GDB to load in the ELF file (via the
BDI probe) and then I start the program.
My ecos configuration is identical to the one I use to boot from ROM,
except I changed the startup type to RAM. (The ROM setup works like a
charm) I also added the required linker settings:
MEMORY
{
ram : ORIGIN = 0x20000000, LENGTH = 0x2000000
sram : ORIGIN = 0x00200000, LENGTH = 0x8000
rom : ORIGIN = 0x00100000, LENGTH = 0x80000
}
SECTIONS
{
SECTIONS_BEGIN
CYG_LABEL_DEFN(__reserved_bootmon) = 0x00000000; . =
CYG_LABEL_DEFN(__reserved_bootmon) + 0x01000;
SECTION_rom_vectors (ram, 0x20200000, LMA_EQ_VMA)
SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA)
SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fixed_vectors (ram, 0x20000040, LMA_EQ_VMA)
SECTION_data (ram, ALIGN (0x4), FOLLOWING (.gcc_except_table))
SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
SECTIONS_END
}
I think I tracked down the problem to this code in
/arm/arch/current/src/vectors.S:
<snip>
start:
LED 5
#if defined(CYG_HAL_STARTUP_RAM) && \
!defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
// If we get restarted, hang here to avoid corrupting memory
ldr r0,.init_flag
ldr r1,[r0]
1: cmp r1,#0
bne 1b
ldr r1,init_done
str r1,[r0]
#endif
</snip>
Could someone explain what this code is supposed to do? According to
me, it just spins forever, but my assembly is kinda rusty.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss