I found a temporary solution to the problem
The bean has been set in destructive write mode. The problem is in the writing and subsequent reading of the data. So for verify it, it is necessary to change the data to be written otherwise there are no error messages!
I disabled the code generation for the bean and i added the following pragma:
#pragma push /* Save file settings. */
#pragma optimization_level 0
static byte procflash(FlashData_TAddress Address, dword Data, byte Command)
{
....
}
#pragma pop /* Restore file settings. */
Now I can set the global optimization to 2 without problems!
I'm hoping for a patch that does not force me to disable the code generation for this bean