I am currently working on the Flash Array Integrity implementation for the S32K312 controller.
According to the reference manual, the MISR value is calculated using a specific polynomial shown in below image. However, my offline calculated MISR values do not match the values generated in the User Mode (UM) registers even after multiple tries.

Upon further review, I noted that the MISR calculation occurs after ECC detection, and ECC parity cannot be calculated offline.

Could you please advise on the standard production-level approach for this implementation? Specifically, I would like to know:
1. Is it possible to calculate expected MISR values offline and store them in Flash or NVM?
2. Or is it necessary to run the code once to capture the calculated MISR value directly from the UM registers and save it for future checks?
Please guide me on the recommended strategy for a production-ready solution.
Best regards,
Sandeep Singh