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.

FMA values for writing FMPPE8 and above (protection on TivaC Snowflake with OpenOCD)

Hello,

I've recently implemented support in OpenOCD (a very popular free
software tool for on-chip-debug) for protecting flash memory of Snowflake Tiva C
parts (see http://openocd.zylin.com/#/c/2267/ ), but the testing results are
confusing, only the first 32 sectors can be protected.

Upon careful inspection
of tm4c129* datasheets I found that the FMA values for writing FMPPE8 and above
are strange: 0x0000.00011 (unexpected extra zero before 11). I wrote my code in
assumption that this is just a typo, but the debug log provided to me by karlp,
one of our users, made me believe 0x00000011 is not a correct value for writing
FMPPE8, the register contents was lost after power-cycling. The testing was done
with an integrated ICDI debugger of a TM4C1294XL launchpad board.

Can you please
recheck the datasheets and provide me with some more info on properly
implementing protection? You might also want to test my code directly, for that
just fetch with "git fetch http://openocd.zylin.com/openocd
refs/changes/67/2267/1". I only have two Blizzard (tm4c123gxl) launchpads here
for testing, so can't do it myself.

Thank you in advance!

  • Hello Pavel,

    Is the issue only for FMPPE registers, or is it there for FMPRE registers also, i.e the values are lost after power cycle?

    Regards

    Amit

  • From the debug log I got from karlp, it seems the issue is only with FMPPE registers >= 8, those before work as expected. I haven't tried implementing FMPRE at all as nobody has requested it so far, so haven't done any tests, and since I have no Snowflake hardware, I can't do it myself. 

    I hope somebody who is interested in Tiva C support can give me a hand here and test the patch to get more datapoints. Also, securing manually by writes to FMPPE8 and above might be interesting to try.

  • For the reference, the log (human-readable, doesn't require any openocd knowledge) is here:  http://paste.fedoraproject.org/129122/09175814/ . You can see how FMPPE7 works and FMPPE8 write is ignored apparently.

  • Hi, 

    I know this is an old issue, but I am faced with the same. 

    I have a TM4C129 that I am trying to protect. 

    Protecting FMPRE0-7 works as expected, but FMPRE8-15 does not retain their values thrugh POR.

    Is there any special handling required for FMPRE8-15?

    The code I am using is this:

        HWREG(FLASH_FMPRE8) = 0;
            for(ui32Temp = 0x10; ui32Temp <= 0x10; ui32Temp += 2) //Protect all FMPRE registers. Datasheet p.597
        {
            //
            // Tell the flash controller to write the flash protection register.
            //
            HWREG(FLASH_FMA) = ui32Temp;
            HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_COMT;
    
            //
            // Wait until the write has completed.
            //
            while(HWREG(FLASH_FMC) & FLASH_FMC_COMT)
            {
            }
        }
    

    Best regards,

    Mads

  • Hello Mads

    The errata has been updated for the device. FMPPE8-15 and FMPRE8-15 are not commitable on the TM4C129x device,

    Regards
    Amit
  • Thanks for an ultra fast reply!
  • Hello Mads

    Also to add to the post a note: there are no major issue with the TM4C129x device that have been found so any new errata is not planned as of now

    Regards
    Amit