Hello Florian,
I've noticed the startup code (crt0_p0.s) does not include RAM ECC initialization routine.
If this routine is missing in debug - you don't see any problem since debugger script initializes the SRAM. But after a power on reset with no debugger connected an ECC exception might occur.
Can you possibly add the red code below into your crt0_p0.s rebuild the project and retest.
Please let me know if it helps.
Thanks!
Stan
__start:
.include "initialize_gpr.inc"
.include "crt0_include_p0.inc"
e_lis r1, __SP_INIT_z4_0@h ; Initialize stack pointer r1 to
e_or2i r1, __SP_INIT_z4_0@l ; value in linker command file.
e_lis r13, _SDA_BASE_@h ; Initialize r13 to sdata base
e_or2i r13, _SDA_BASE_@l ;
e_lis r2, _SDA2_BASE_@h ; Initialize r2 to sdata2 base
e_or2i r2, _SDA2_BASE_@l ; (provided by linker).
e_addi r0,r0,0 ; Clear r0.
e_stwu r1,-64(r1) ; Terminate stack.
/* SRAM initialization code 0x4000_0000, size 0x10000 */
e_lis r11, 0x4000@h
/* Loops to cover L2SRAM, stmw allows 128 bytes (32 GPRS x 4 bytes) writes */
e_lis r12, 0
e_or2i r12, 512
start_init:
mtctr r12
init_l2sram_loop:
e_stmw r0, 0(r11) /* Write 32 GPRs to SRAM*/
e_add16i r11, r11, 128 /* Inc the ram ptr; 32 GPRs * 4 bytes = 128B */
e_bdnz init_l2sram_loop /* Loop for L2SRAM_CNT */
/* in decoupled mode initialize the core_1 SRAM also 0x5000_0000, size 0x10000*/
e_lis r12, 0x5000
/* check if we already initialized L2SRAM_LOCATION_P1 */
cmplw r11, r12
se_bgt exit_sram_init
e_lis r11, 0x5000
//e_or2i r11, L2SRAM_LOCATION_P1@l
e_lis r12, 0
e_or2i r12, 512
se_b start_init
exit_sram_init:
#endif