I use the MCU of KEA128 and define an global struct(unsigned char Flash_Buf;).
1.The struct assign some value
2.Execute the power on - off test.
3.Some time the value of struct will be crash
Have any one met the same question?
Could you show an example of how are you doing to assign the value? Also, what do you mean about the structure crash? The program enter a hard-fault?
Clearly describe the details as below:
4.Check byte67 of “Flash_Buf”,this byte is CRC byte
5-1.If the CRC byte not correct, store the default value into Flash_Buf(default value include 200bytes)
5-2.If the CRC byte is correct, use the value of “Flash_Buf” from the m_orange_m
1.Power on è HOST send an write command via CAN bus(repeat) è Power off at any time.
2.Now can find out sometime before the write sequence ,the structure of “Flash_Buf” after byte 67 will be modify to 0xff, but we not modify those bytes, but before 67bytes is always correct.
Let me check if I'm understanding correctly, you store some values in the array in this flash section and before the reset all this array is full but after the reset the flash after the 67 byte the data previously write is not compatible.
I want to ask a couple of questions:
- The initialization is done inside the main code and are you checking if there's some kind of reset in the SIM_SRSID?
- In the MAP file the Flash_Buf is assigned correctly?
- If you read the buffer at the start of the program the data is the same or the change in the buffer is done after?
Retrieving data ...