Hi,
a customer is using the RM48 Ethernet Bootloader example to load .bin files into the Flash.
The Bootloader specifically uses the F021_API and
Fapi_issueProgrammingCommand((uint32_t *)dst,
(uint8_t *)src,
(uint32_t) bytes,
0,
0,
Fapi_AutoEccGeneration);
to generate ECC during the programming.
The Bootloader's sys_startup does not have any code for enabling of Flash ECC. After the bootloader has flashed the application code .bin file, it jumps to the entry point c_int00 and runs from there (i.e. in the app code .bin sys_startup.c). This has the enabling of the Flash ECC checking.
///* Enable CPU ECC checking for ATCM (flash accesses) */
SL_Init_ECCFlash(0, FLASHECC_DEFAULT);
/* Enable response to ECC errors indicated by CPU for accesses to flash */
flashWREG->FEDACCTRL1 = 0x010A060AU;
After the ECC is enabled the CPU gets a prefetch abort.
If the ECC enabling is commented out in the app code c_int00 function, the code runs fine.
What is the right process here for
[] Generating the ECC, is it ok to let the F021_API lib handle that, or should we use e.g. the Linker based ECC generation.
[] Enabling of ECC, is that done in the bootloader or in the app code, is it done correctly
[] Are we missing anything else in this process
Thanks,
--Gunter