HI Manish,
Constant value must be assigned while it is declared. Thus we can guarantee the constant value allocated in FLASH.
for example, the first time we define constant variable ConstantVal in *.h, we need also assigned constant value to it
static const unsigned char ConstantVal;
change to
static const unsigned char ConstantVal = 100;
thus ConstantVal is 0xaa, it can not be assigned to other value anymore.
This is the same for C code.
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------