[SOLVED] J-Flash Not Initializing RM42L432 ECC on Sectors With All 0xFF Values

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] J-Flash Not Initializing RM42L432 ECC on Sectors With All 0xFF Values

    I have a bootloader and application. My application is laid out like so:

    Bytes 0-3: 32-bit Length Field
    Bytes 4-(Length-5): Application code
    Bytes (Length - 4)-(Length -1): CRC32

    Right now, the length field is larger than it needs to be, just so I don't have to think about expanding it in my linker properties as I add more features. This means that several sectors towards the end of my application space are not used, and set to 0xFF by the linker.

    The bootloader verifies the CRC of the application space, including all the "blank" sectors, before launching the application, and this works fine when I program through my IDE (IAR), but when I program the same image through J-Flash, the bootloader receives a dabort indicating an ECC error (ESMSR3 is 0x00000080) when it tries to read some bytes in the sectors that have nothing but 0xFF values.

    I have done some experimenting, and I have at least two workarounds:
    1. Only set the length field in the application to as long as I need it be, so no sector covered by my length field goes totally unused.
    2. Change the linker properties to set unused areas to something besides 0xFF, e.g. 0xA5.

    These workarounds are OK, but I was wondering why it appears the ECC is not being initialized on sectors that are explicitly set to nothing but 0xFF values. My hypothesis is that the J-Flash does not actually "write" the 0xFF values in a sector that contains nothing but that value, it just erases the sectors, which does not trigger the automatic ECC generation. Is that correct? Is there a way to ensure that the correct ECC values are generated for all sectors in an image, regardless of contents?

    The post was edited 1 time, last by sams: Typo in address ().

  • Hello,

    Thank you for your inquiry.
    The following wiki article should give more insight to this topic and how J-Link handles the ECC for this target device type.
    wiki.segger.com/TI_RMxxL

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thanks Nino, but that wiki article talks about the ECC protection of RAM, not Flash. My problem seems to be that the Flash ECC is not being initialized. The error reliably happens when reading a byte in a sector of Flash that has nothing but 0xFF values, it does not appear to be caused by accessing a particular RAM address.
  • Hello,

    Sorry for the misunderstanding.
    Could you open a ticket regarding the issue?
    A link to the ticket system can be found in my signature.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.