Dear Jack,
Please find below the answer from our TPMS software expert.
It is not possible to prevent the generation of 0xFF in the trim section. This is due to the fact that trim coefficients are declared as global variables in the firmware library to be used by the compensation firmware functions, and the global variables are visible in the application project, thus appearing in the s19 file.
However CodeWarrior IDE is configured not to erase the trim section, when using the debugger or Flash Programmer tool ‘Erase and Program’ command. This means that even if 0xFF appears in the trim section, the trim section will not be erased.
Note that the trim section will be erased if the command ‘Erase Whole Device’ is executed with Flash Programmer. So do not use this command.
The fact that the debug session is not maintained is not due to trim coefficients being erased. When trim is erased this has no impact on the execution of the code, the only influence will be measurement and compensation sensor values returning dummy data.
The reason why the debug session is not maintained with the TPMS_87E_WheelLoc project is because the project was not written to be debugged. For projects to work in a debug session, several points must be considered when writing the application. The document attached explains how to write an application that will work in and outside a debug session.
Best regards,
Tomas
PS: If this answer helps to solve your question, please mark it as "Correct" or “Helpful”. Thank you.