Arduino I2C external 32Kb fram data organization
It'll be easier if you use a struct, not a union. Store all the data you want to preserve in a struct, then cast a pointer to it to be a byte pointer and just treat it as an array of bytes and read and write those bytes to the FRAM.
The union you were using explicitly did the same thing, but it's not easy to scale to multiple items.
Some caveats about what you can safely keep in the struct:

do not store pointers in it. A char array is fine because the entire array will take up space in the struct. A char * is not because all you'll save is the value of the pointer, not what it points at.

do not store objects (like String) in it. You don't know (and shouldn't know) how the object is composed internally. If need to use objects, they should have serialize and deserialize methods which would store or restore the contents of an object into an array of bytes which you could then store or restore with the FRAM.


Also remember that the C/C++ sizeof function (used below) tells you the size of thing at compile-time. So if you use it on a struct it will tell you the number of bytes it takes to store the struct. If you use it on a char *, it will tell you the number of bytes in a pointer to a char, not the number of bytes in the C string that the char * points at. If you use it on an object - like String str; sizeof(str); - it will tell you how many bytes it takes to store the String object, which will include the length of the string it stores.
Psuedo-code follows. There are more compact ways to write this; I'm aiming for clarity here.
#include &lt;Arduino.h&gt;

struct program_data {
  float first_thing;
  unsigned long second_thing;
  char third_thing[55];
  char fourth_thing;
  uint16_t fifth_thing;
} data;

void save_data(struct program_data *data_ptr) {
  byte *ptr = (byte *)data_ptr;

  for(size_t i = 0; i &lt; sizeof(struct program_data); i++)
    store_byte_in_fram(ptr[i], i);
}

void restore_data(struct program_data *data_ptr) {
  byte *ptr = (byte *)data_ptr;

  for(size_t i = 0; i &lt; sizeof(struct program_data); i++)
    retrieve_byte_from_fram(ptr[i], i);
}

// call when you want to save your data
  save_data(&amp;data);

// call when you want to restore your data
  restore_data(&amp;data);