Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I've been implementing BIT tests using the Class B Safety Software Library and AN78175 (attached) as a reference. Most have been fairly straightforward. But I'm having difficulty with SelfTest_FlashCheckSum(). As the instructions in the AN direct (see below), I first build the project in PSoC Creator with the stored checksum value set to 0x0000 in the SelfTest_Flash.c file. I then open PSoC Programmer and read Flashchecksum. I copy that value and replace the previous value in code (0x0000) with the new value and compile the project and program PSoC. The issue I'm having is that at the end of the flash, after the code has calculated and accumulated a checksum value, it ultimately compares that calculated checksum (checkSum_rom) with the checksum stored in ROM in the steps above (CheckSum_from_rom). But... CheckSum_from_rom isn't initialized to the value I provided in the initial steps. It instead seems to ALWAYS have the same value (0x8000). What gives? What am I doing wrong? And why doesn't CheckSum_from_rom ever reflect the value I provided in line 79 (0x683F)?
I'm going to assume that I'm just doing something wrong, but I can't for the life of me figure out what that is. Any help would be greatly appreciated.
Message was edited by: Denver Hopkins
A day later and with fresh eyes, I had a eureka moment when I realized I'd not noticed a comment in the header for function SelfTest_FlashCheckSum() which says, "SelfTest_FlashCheckSum_Init() must be called one time before this function to store flash checksum in to EEPROM after first device start." Not calling that function seems like an obvious cause of my issue. However, I've searched the Class B Saftety Software Library and can't find the function SelfTest_FlashCheckSum_Init() anywhere.
I've since decided to use the ECC method to test Flash, but would still like to understand why the Checksum method isn't working.