PanelDue - FlashData structure

  • Are there any issues about data alignments in the FlashData structure? I'm playing around with the idea of adding a uint8 for a few flags, but I see some things using data sizes much larger than needed (and wonder if it's doing so for alignment type reasons.)


  • administrators

    The flash memory has to be written on 32-bit boundaries AFAIR, but the processor has no alignment restrictions when accessing data in RAM.

  • Related to this:

    When you add new elements to the FlashData structure, is there any mechanism to allow the firmware code to detect that the flashdata structure previously written was a prior version?

    In other words, if I were to add a new uint32 to flashdata, the first time the newly compiled firmware read flashdata, that newly added uint32 would contain garbage. Is there any mechanism in place to deal with that?

    The only thing I'm noticing is the magicVal value (but that resets all the variables to defaults.)

  • administrators

    When we change the format, we change the magic value to indicate that.

Log in to reply