AnsweredAssumed Answered

Debug in External RAM - APF28 board

Question asked by Thuan Pham on Feb 20, 2013

Hello,

I bought a APF28 board from www.armadeus.com which has iMX286. It has 128KB of on-chip RAM (OCRAM) (from address 0x00000000) and 128MB of External RAM (from address 0x40000000).

I have been writing some bare-metal applications on it (timer interrupt, serial port, IO) using GNU ARM toolschain. These applications work fine in OCRAM and now I want to run them in External RAM. These programs will run through following steps:

1. Load binary to Externl RAM at 0x40000000

2. A piece of code in startup will copy 64 bytes of exception vectors from 0x40000000 to 0x00000000, here is the code to do this task:

/* Copy vector table from RAM to OCRAM */ 

    mov    r8, #0x40000000

    mov    r9, #0x0

    ldmia    r8!, {r0-r7}

    stmia    r9!, {r0-r7}

    ldmia     r8!, {r0-r7}

    stmia    r9!, {r0-r7}

3. Initialize stacks and load main function

 

However, I face a problem of unstable execution. I means, some time, it works properly but some time it work wrong or does not work at all.

Could you suggest me any idea to solve this problem?

(Please find attached for startup code and linker script that I use for two cases: run in On-chip RAM and run in External-RAM)

Thank you.

Original Attachment has been moved to: linker_OCRAM.lds.zip

Original Attachment has been moved to: startup_OCRAM.s.zip

Original Attachment has been moved to: startup_RAM.s.zip

Original Attachment has been moved to: linker_RAM.lds.zip

Outcomes