2393225_en-US

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

2393225_en-US

2393225_en-US

Fee's first read program crashed

I'm using the FEE function of an S32K311 microcontroller to store data. FEE tests for erasing and writing work fine, but on the first read attempt, without any data written, it fails to load and crashes. Similar to the C40, the first read returns 0xFF, which I can use to identify the first read/write operation and fill in the default value. Is there a way to make the first FEE return a value like 0xFF instead of crashing? I'm using RTD 4.0.0.

Re: Fee首次读取程序跑飞

Hi@ LJH1

The first time you call Fee_Read(), you don’t have to write to it first. However, if the block has never been written to, the read job is likely to return MEMIF_BLOCK_INVALID or MEMIF_BLOCK_INCONSISTENT. The application layer should be able to treat it as “uninitialized” and then write the default value.

Do not rely on reading valid data directly on the first read; the correct approach is to check the job result after reading, and initialize default values and write them when invalid/inconsistent data is encountered.

Senlent_0-1783662229362.png


Tags (1)
No ratings
Version history
Last update:
Friday
Updated by: