Flash crash?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flash crash?

655 Views
billchang
Contributor II

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?

0 Kudos
3 Replies

587 Views
Alexis_A
NXP TechSupport
NXP TechSupport

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

0 Kudos

587 Views
billchang
Contributor II

Hi Andalon:

 

Clearly describe the details as below:

Normal:

  1. Define the value of “unsigned char Flash_Buf[256]”
  2. In the file of .ld , reserve the fixed memory(512bytes) of “m_orange_m (rx) : ORIGIN = 0x00000600, LENGTH = 0x200”
  3. After the power on, re-store the value of “Flash_Buf[512]” from the m_orange_m

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

  1. Programmer start use the byte1~byte67, and when HOST send an write command via CAN bus, let the value of “Flash_Buf[512]” write into the m_orange_m area.(now calculation the CRC of byte1~byte66 and store into byte 67)

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.

  1. Before execute the write command, need execute the EraseSector function, it maybe cause by the EraseSector function, but before byte 67 is always correct, so this is not root cause.
  2. This phenomenon is happen in test of power on – power off, if the power always on the phenomenon is not happen.
0 Kudos

587 Views
Alexis_A
NXP TechSupport
NXP TechSupport

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

0 Kudos