Announcement

Collapse
No announcement yet.

how to save different user variables and arrays to diablo's internal flash memory?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to save different user variables and arrays to diablo's internal flash memory?

    Hi there,

    I need to save different declared variables and arrays to flash to keep them non volatile.
    I do not want to use the SD card file system since I encountered sometimes corrupted partitions and crashed cards.

    Reading variables from flash seems easily to be done with var:=flash_GetWord(bank, ptr) command.
    Writing different variables to flash is not supported or only one array at once and at a different bank page with flash_WriteBlock(sourceptr, bank, page)
    Anyway, it all gets very confused simply to store some variables into the processors flash memory in a convenient way.
    Can anybody help with some functions or tools please?
    Thank you in advance!

  • #2
    Hi Marcus,

    Please try the attached example.

    This example uses an array and will check to see if the variable added to the array is different to what's in flash before writing thus saving you writing to flash if it isn't necessary.

    Best regards

    Paul
    Attached Files

    Comment


    • #3
      Hello Pauleilio,

      Thank you for your quick reply and the flashwrite example.
      I took a look at it and can use it as a reference.
      I already made something similar thus declaring a buffer where the wanted variables are stacked and saved with the flash_WriteBlock command.
      To restore the variables, they can be retrieved by the flash_GetWord command and only needed at the start-up.
      So I think my problem will get solved = very glad
      Thank you for support!

      With Best Regards,
      Marc

      Comment

      Working...
      X