RAM Testing in S9KEAZ128

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

RAM Testing in S9KEAZ128

338 Views
logapriya
Contributor I

Hi, i am doing RAM Test (SRAM -16kb)on the startup code before RAM Configuration and after the Reset Handler, while i write and read the entire RAM region i face the below issues,

1. it shows PE-ERROR: Warning. Can't read memory while part is running. @200004e8 (4 bytes)

2. No source available for "(gdb[2].proc[42000].threadGroup[i1],gdb[2].proc[42000].OSthread[1]).thread[1].frame[0]"

3.it will get inside the Reset Handler while running and LR and SP register Updating with the reference value which i give

Below is the code which i tried for RAM Testing

b ram_test_1
 
 error:
  ldr r5, =0x20002ff0
ldr r6, =0xaaff
str r6, [r5]
b ram_config
 
ram_test_1:
 
ldr    r2, =0x1ffff000 /* Base address to start */
    ldr    r1, =0 /* Counter to keep track of address during write operation */
ldr    r3, =2048
 
 loop_1:
 
  ldr    r0, =0xaaaaaaaa
  ldr r7, [r2]
    str r0, [r2] /* Copy the values into register */
    ldr r4, [r2]
    cmp r4, r0
    bne error
    ldr    r0, =0x55555555
    str r0, [r2] /* Copy the values into register */
    ldr r4, [r2]
    cmp r4, r0
    bne error
str r7, [r2]
 
    adds r2, #4 /* increments the address by 4 bytes */
    adds r1, #1
    cmp r1, r3
    blt loop_1 /*if r2 less than 0x200003f0 Branch less than - BLT the loop continues */
    ldr r5, =0x20002ff0
ldr r6, =0xaa55
str r6, [r5]

 

ram_config:

 

Kindly clarify.

0 Kudos
3 Replies

268 Views
bobpaddock
Senior Contributor III
Part address issues aside, take a look at this RAM Test:

http://www.ganssle.com/testingram.htm
0 Kudos

315 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

The S9KEAZ128 has 16KB SRAM, which ranges from 0x1FFF_E000 to 0x2000_1FFF, the 16KB/4=4K, which is 0x1000 or 2048

So pls try to modify:

ldr r2, =0x1fffe000 /* Base address to start */

otherwise, the high address will be incorrect.

Secondly, pls check the stack in the linker file, I suppose you'd better not write/read the stack.

Hope it can help you

BR

XiangJun Rong

0 Kudos

273 Views
logapriya
Contributor I

/* Specify the memory areas RAM 16 Kb */
MEMORY
{
SRAM : ORIGIN = 0x1FFFF000, LENGTH = 0x00004000
}

1. this is our RAM region which is specified in the linker file so i used the 0x1ffff000 as base address

2. As you mentioned i didn't write the stack area but still i face the previous warnings and it doesn't get into main function ,here is the modified code 

ram_test_3:
 
ldr    r2, =__HeapBase /* Base address to start Heap segment 0x1ffff494*/
    ldr    r1, =0 /* Counter to keep track of address during write operation */
ldr    r3, =320 /*Size of data segment 0x500 = 1280 bytes /4(each adress having 4 bytes) = 320 */
 
 loop_3:
 
  ldr    r0, =0xaaaaaaaa
  ldr r7, [r2]
    str r0, [r2] /* Copy the values into register */
    ldr r4, [r2]
    cmp r4, r0
    bne error
    ldr    r0, =0x55555555
    str r0, [r2] /* Copy the values into register */
    ldr r4, [r2]
    cmp r4, r0
    bne error
str r7, [r2]
 
    adds r2, #4 /* increments the address by 4 bytes */
    adds r1, #1
    cmp r1, r3
    blt loop_3 /*if r2 less than 0x200003f0 Branch less than - BLT the loop continues */
 
ram_test_2:
 
ldr    r2, =__bss_start__ /* Base address to start bss segment 0x1ffff494*/
    ldr    r1, =0 /* Counter to keep track of address during write operation */
ldr    r3, =496 /*Size of data segment 0x7c0 = 1984 bytes/4 = 496 */
 
 loop_2:
 
  ldr    r0, =0xaaaaaaaa
  ldr r7, [r2]
    str r0, [r2] /* Copy the values into register */
    ldr r4, [r2]
    cmp r4, r0
    bne error
    ldr    r0, =0x55555555
    str r0, [r2] /* Copy the values into register */
    ldr r4, [r2]
    cmp r4, r0
    bne error
str r7, [r2]
 
    adds r2, #4 /* increments the address by 4 bytes */
    adds r1, #1
    cmp r1, r3
    blt loop_2 /*if r2 less than 0x200003f0 Branch less than - BLT the loop continues */
 
ram_test_1:
 
ldr    r2, =__data_start__ /* Base address to start data segment 0x1ffff000*/
    ldr    r1, =0 /* Counter to keep track of address during write operation */
ldr    r3, =293 /*Size of data segment 0x494 = 1172bytes / 4 = 293 */
 
 loop_1:
 
  ldr    r0, =0xaaaaaaaa
  ldr r7, [r2]
    str r0, [r2] /* Copy the values into register */
    ldr r4, [r2]
    cmp r4, r0
    bne error
    ldr    r0, =0x55555555
    str r0, [r2] /* Copy the values into register */
    ldr r4, [r2]
    cmp r4, r0
    bne error
str r7, [r2]
 
    adds r2, #4 /* increments the address by 4 bytes */
    adds r1, #1
    cmp r1, r3
    blt loop_1 /*if r2 less than 0x200003f0 Branch less than - BLT the loop continues */
 
ram_test_4:
 
ldr    r2, =0x2000500 /* Base address to start Remaining segments 0x200000f0*/
    ldr    r1, =0 /* Counter to keep track of address during write operation */
ldr    r3, =2745 /*Size of Remaining segment 10,980 bytes/4(each adress having 4 bytes) */
 
 loop_4:
 
  ldr    r0, =0xaaaaaaaa
  ldr r7, [r2]
    str r0, [r2] /* Copy the values into register */
    ldr r4, [r2]
    cmp r4, r0
    bne error
    ldr    r0, =0x55555555
    str r0, [r2] /* Copy the values into register */
    ldr r4, [r2]
    cmp r4, r0
    bne error
str r7, [r2]
 
    adds r2, #4 /* increments the address by 4 bytes */
    adds r1, #1
    cmp r1, r3
    blt loop_4 /*if r2 less than 0x200003f0 Branch less than - BLT the loop continues */
 

3. Is there any ways to over come the warnings mentioned?

4. Is it possible to read write the entire SRAM region, except Stack in the startup code for testing purpose ?

5.I want to know what is the process happening in the SRAM before startup code execution.

kindly clarify

 

0 Kudos