MCF5234: cannot initialize internal SRAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF5234: cannot initialize internal SRAM

1,637 Views
sirlenzelot
Contributor II
Hello everybody,
 
I have problems initializing the internal SRAM.
I rtfm and followed the steps described in Chapter 6.2.3 SRAM Initialization Code.
 
When I connect to my target via the BDI2000-interface by Abatron I have immediate access to SRAM as it is configured via the interface. They don't do anything different than me: write 0x20000001 to RAMBAR-register. But if I initialize the SRAM in my code, writing to RAMBAR has no effect.
 
This is what I do:
Code:
    INT_SRAM_BASE       EQU     $20000000      ; Base add used for internal SRAM    INT_SRAM_SIZE       EQU     $00010000      ; MCF5235 has 64K internal SRAM    INT_SRAM_VALID      EQU     $20000001      ; Bit to make internal SRAM                                               ; valid/enabled.    MOVE.W              #LOCKOUT,SR            ; Lock-out interrupts    MOVE.L              #INT_SRAM_VALID,D0    MOVEC.L             D0,RAMBAR0; zero SRAM    lea.l  INT_SRAM_BASE,A0    move.l  #INT_SRAM_SIZE,D0SRAM_INIT_LOOP:    clr.b  (A0)+    subq.l  #1,D0    bne.b  SRAM_INIT_LOOP; Init VBR    MOVE.L              #VECTOR_BASE,A0    MOVEC               A0,VBR; Init IPSBAR    MOVE.L              #IPSBAR,A0    MOVE.L              #IPSBAR_VALUE,(A0)

 
Can someone give me a hint on that, please?
 
Thanks in advance
 
Dirk
Labels (1)
0 Kudos
2 Replies

350 Views
Arev
Contributor III
Hello,
I use the following Init code, with RAMBAR1 instead of RAMBAR0
 
Code:
DEFAULT_IPSBAR  .equ    0x40000000REG_VALID       .equ    0x00000001RAM_DATACODE    .equ    0x00000020_BSP_Asm_BootCode:        move.w  #0x2700,sr        // IPSBAR 'Internal Peripheral System Base Address Register'
        move.l  #(___IPSBAR + REG_VALID),d0        move.l  d0,DEFAULT_IPSBAR        // RAMBAR Register 'SRAM Base Address Register' (RAMBAR1 = CPU+0x0C05)        move.l  #(___SRAM + RAM_DATACODE + REG_VALID),d0        movec   d0,RAMBAR1        // Temporary 'Stack Pointer' Init in SRAM (SDRAM not Initialized)        move.l  #(___SP_INIT_SRAM),sp        // Coldfire MCF523x Init (PLL & peripherals)        jsr     _BSP_ColdFire_InitialiserCPU        // 'Stack Pointer'        move.l  #(___SP_INIT),sp        // FreeScale 'C_4I_CF_RUNTIME.A' (E68k_Startup.c)        jmp     __start        .end

 

I Hope this helps..

Bye
 
<< Freescale MCF5234/35 with CodeWarrior 6.2 >>
0 Kudos

350 Views
sirlenzelot
Contributor II
Hi Arev,
 
we solved the problem.
 
Our compiler was setup for using 5200. RAMBAR0 at CPU@0xC04 is used.
As we changed to 5234, everything is okay and RAMBAR1 at CPU@0xC05 is used.
 
Thanks
 
Dirk 


Message Edited by sir lenzelot on 2008-06-26 11:48 AM
0 Kudos