Hi,
I was wondering :
in my startup code ,I initialize BSS,STACK section using the byte access however It doesn't generate an ECC error on ERM module registers, actually it does generate an address in ERM_EAR1 which is the upper RAM where the BSS and STACK are in the lower RAM. Why is that?
Now to avoid any ECC errors I need to initialize the whole RAM in the beginning of my start up Code.
my target is S32K148 ,the memory places the DRAM on 0x1ffe0000 to 0x2001_f000 addresses,so that's the range to initialize to avoid ECC. IS THAT CORRECT?
Thanks,
Koorosh Hajiani
Solved! Go to Solution.
Hi lukas,
I believe the reason that I don't generate the ECC error is:
in the start_up code ,I don't read any of the SRAM locations, I just write to them.
Please correct me if I'm wrong.
However just to be on the safe side ,I will initialize the whole RAM in the beginning of my start_up code.
BR,
Koorosh Hajiani
Hi,
the RAM needs to be initialized by 32bit writes:
You can find in startup file in S32DS:
#ifdef START_FROM_FLASH
/* Init ECC RAM */
ldr r1, =__RAM_START
ldr r2, =__RAM_END
subs r2, r1
subs r2, #1
ble .LC5
movs r0, 0
movs r3, #4
.LC4:
str r0, [r1]
add r1, r1, r3
subs r2, 4
bge .LC4
.LC5:
#endif
Regards,
Lukas
Hi Lukas,
Thanks for your response.
there are 2 other questions in my post that were not answered:
0x1ffe0000---0x2001efff (in your code you referred to it as ldr r1, =__RAM_START
ldr r2, =__RAM_END), do i need to initialize all the locations within that range?
in other word __RAM_START=0x1ffe0000 and __RAM_END=__RAM_END
Thanks,
Hi,
not sure about the first question, it would require some debugging. It's just mandatory to initialize the RAM by 32bit wide writes.
The easiest option is to initialize whole RAM in mentioned range. If you don't use whole RAM and if you want to save some time at startup, you can initialize only the RAM which will be used by your application.
Regards,
Lukas
Hi lukas,
I believe the reason that I don't generate the ECC error is:
in the start_up code ,I don't read any of the SRAM locations, I just write to them.
Please correct me if I'm wrong.
However just to be on the safe side ,I will initialize the whole RAM in the beginning of my start_up code.
BR,
Koorosh Hajiani
Lucas,
Thanks for your response.
Did you look at the start_up code I attached?
Thanks,
Koorosh