public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Running code from external ram on the AT91SAM7SE
@ 2007-11-06 10:13 Tom Deconinck
  2007-11-06 10:34 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Deconinck @ 2007-11-06 10:13 UTC (permalink / raw)
  To: ecos-discuss

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-11-07 12:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-06 10:13 [ECOS] Running code from external ram on the AT91SAM7SE Tom Deconinck
2007-11-06 10:34 ` Andrew Lunn
2007-11-06 16:12   ` Tom Deconinck
2007-11-06 16:23     ` Andrew Lunn
2007-11-07 12:34       ` Tom Deconinck
2007-11-07 12:48         ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).