I use the MCU of KEA128 and define an global struct(unsigned char Flash_Buf[256];).
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?
Hi Bill,
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?
Best Regards,
Alexis Andalon
Hi Andalon:
Clearly describe the details as below:
Normal:
4.Check byte67 of “Flash_Buf[512]”,this byte is CRC byte
5-1.If the CRC byte not correct, store the default value into Flash_Buf[512](default value include 200bytes)
5-2.If the CRC byte is correct, use the value of “Flash_Buf[512]” from the m_orange_m
TEST:
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[512]” after byte 67 will be modify to 0xff, but we not modify those bytes, but before 67bytes is always correct.
PS.
Hi Bill,
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?
Best Regards,
Alexis Andalon