This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48: Ethernet Bootloader example and ECC issues

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

  • Hi Gunter,
    From your description the bootloader is programming the application image into the flash with ECC. However, you are not yet jumping to the application code. You are still executing the bootloader code for which there is no corresponding ECC. As soon as you enable the ECC in the bootloader startup it fails due to ECC fault and take the prefetch abort exception. There are two solutions I can think of. If you want ECC protection even for the bootloader you will need to use either the linker generated ECC or use the CCS auto-ECC while you are loading the bootloader code into flash. The second solution is that you don't enable the ECC until you are already in the application. However, it takes a few instructions to enable the ECC. So for the first few instructions before you enable ECC the application is not protected with ECC. I will go with the first solution then.
  • Hi Tsai,

    let me check with the customer, how the bootloader itself is being loaded into Flash with or without ECC.

    I am familiar with the Debug-->Flash Settings to enable ECC for loading in the project properties.

    Could you give us an example on how to enable ECC with the Linker for the RM48?

    We know about the RM57 ECC recommendation

    But here it is an RM48.

    Thanks,

    --Gunter

  • Hi Gunter,

     The concept is the same. I think the difference is that in the linker command file the ECC address_mask for R4 devices which will be 0x003ffff8.

    ECC {

    algo_name : address_mask = 0x003ffff8
    hamming_mask = R4
    parity_mask = 0x0c
    mirroring = F021
    }

  • Hi Gunter,
    If your question is answered can you please close the thread by clicking the 'Verify Answer' button? Thanks.