S32R274 copy to ram issues

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

S32R274 copy to ram issues

ソリューションへジャンプ
1,208件の閲覧回数
makouda
Contributor I
Hello 
working on  S32R274. I noticed strange behavior with copying data from ROM to RAM
I can see that only chunks of code are copied to RAM. Other RAM areas are just ?????
this behavior happens even if I run step by step
board powered at 12V output up to 3.5A
 
makouda_0-1631790833325.png

 

 
0 件の賞賛
返信
1 解決策
1,195件の閲覧回数
makouda
Contributor I

well, resolved by adding RAM init assembly code

___asm(ramStart = 0x40000000                    ;/* RAM start address*/)
___asm(ramSize = 0x180000                       ;/* RAM size - System RAM only (384K)*/)
___asm(ramCount =  ramSize/64                   ; /*calculate count variable*/)
__as1( e_lis       r2, ramCount@ha              ; /*Loop counter to get all of L2SRAM*/)
__as2( e_add16i    r2, r2, ramCount@l           
___asm( se_mtctr    r2                          ; /*Store in count register*/)
__as1( e_lis       r1, ramStart@ha              ; /*r1 holds base address of the L2SRAM, 64-bit word aligned*/)
__as2( e_add16i    r1, r1, ramStart@l           ; /*Add low address*/)
___asm(_init_l2ram_loop:)
__as1( e_stmw      r16,0(r1)                    ; /*Write values of GPR 17-32 at once, these still contain the init pattern all 0*/)
__as2( e_addi      r1,r1,64                     ; /*Increment write address*/)
___asm( e_bdnz      _init_l2ram_loop            ; /*Decrement count register and jump*/)

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,196件の閲覧回数
makouda
Contributor I

well, resolved by adding RAM init assembly code

___asm(ramStart = 0x40000000                    ;/* RAM start address*/)
___asm(ramSize = 0x180000                       ;/* RAM size - System RAM only (384K)*/)
___asm(ramCount =  ramSize/64                   ; /*calculate count variable*/)
__as1( e_lis       r2, ramCount@ha              ; /*Loop counter to get all of L2SRAM*/)
__as2( e_add16i    r2, r2, ramCount@l           
___asm( se_mtctr    r2                          ; /*Store in count register*/)
__as1( e_lis       r1, ramStart@ha              ; /*r1 holds base address of the L2SRAM, 64-bit word aligned*/)
__as2( e_add16i    r1, r1, ramStart@l           ; /*Add low address*/)
___asm(_init_l2ram_loop:)
__as1( e_stmw      r16,0(r1)                    ; /*Write values of GPR 17-32 at once, these still contain the init pattern all 0*/)
__as2( e_addi      r1,r1,64                     ; /*Increment write address*/)
___asm( e_bdnz      _init_l2ram_loop            ; /*Decrement count register and jump*/)
0 件の賞賛
返信