Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE, MOTORWARE
Hello,
we have some Problems with floating point operations, when the uC is secured by the CSM Zone 2.
The code:
volatile float fDebugVal3 = 0.000488234; volatile _iq iqDebugVal4; _iq function( uint16_t par1, uint16_t par2, float par3 ) { float fReturn; //some other code fReturn = fDebugVal3; iqDebugVal4 = _IQ( fReturn * 4096.0 ); return _IQ( fReturn * 4096.0); }
When the above code is running, when flash is protected, the variable iqDebugVal4 is 0. The code is running out of sector E, which is protected by Zone2. The variables fDebugVal3 and iqDebugVal4 is in unprotected RAML. When I place these variables in protected RAML via #pragma, i get the same result of 0.
When I run this code with the debugger, i get the correct result of 1.9998.
We use the compiler version v20.2.3.LTS. With Compiler Version 21.6.0.LTS, its the same problem. In the Processor Options we set --float_support to softlib.
regards
David