[mpc5777c] Can't I use e_stw to initialize SRAM ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[mpc5777c] Can't I use e_stw to initialize SRAM ?

ソリューションへジャンプ
1,148件の閲覧回数
jaejynshin
Contributor III

Hello Expert

I want to initialize SRAM which has ECC error using e_stw. Because I want to clear a few bytes of Ram memory.

But there was a Exception when I used e_stw.

sram_init_some:
    e_lis r5, SOME_RAM_SIZE@h # Initialize r5 to size of SRAM (Bytes)
    e_or2i r5, SOME_RAM_SIZE@l
    # e_srwi r5, r5, 0x6
    mtctr r5

    # Set Base Address of the internal SRAM
    e_lis r5, SOME_RAM_START@h
    e_or2i r5, SOME_RAM_START@l

sram_init_some_loop:
    e_stw r16,0(r5)
    e_addi r5,r5,4
    e_bdnz sram_init_some_loop

Can't I use e_stw to init SRAM?

I can't, how to initialize a few bytes of SRAM ? (not 64 bytes using e_stmw)

Thank you

Jaejyn

1 解決策
925件の閲覧回数
jaejynshin
Contributor III

I resolved it.

I used e_stmw and r30/r31 register.

I set the resolution of clearing size as 8 bytes.

Thank you anyway.

元の投稿で解決策を見る

2 返答(返信)
925件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hi,

As there is ECC protection on SRAM the operation executed is read-modify-write.

So you have to use stmw.

Peter

926件の閲覧回数
jaejynshin
Contributor III

I resolved it.

I used e_stmw and r30/r31 register.

I set the resolution of clearing size as 8 bytes.

Thank you anyway.