Hello,
So I want to store the library file variables in flash
This is not very standard. Flash is not designed for variables as they change a lot and you have only limited cycles of flash programming.
You should use RAM for store of variables.
If the variables need to survive destructive reset, you can use EEPROM for such purpose or registers which are not affected by destructive reset.
Best regards,
Peter