The project is based on MC56F84789 and the problem is in the generated code of IntFLASH (Data_Flash) bean that i used.
The funcion procflash fails when i use the function SetBlockFlash!!!
It fails at every call if the optimization level is set to 2.
If the optimization level is set to 0, there were no problem!
Does anyone have the same problem?
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