This routine is called at the beginning of the boot loader and determines if the boot loader should run the application code, or wait for a new image. It checks the following five conditions:
- If the code is running on a device that does not support the AES hardware encryption, the boot loader will not execute an application program.
- If the device does not have valid keys stored in the EEPROM, the application program will not be executed. Instead, the boot loader enters a state where it waits for an unencrypted image of the keys to be uploaded.
- MyCheckUpdateFunc will call the user-defined function CheckGPIOPin. If this function returns true, the boot loader will not execute the application program, rather it will wait to upload a new encrypted application image. In the example boot loader program, it checks if the EK-TM4C129EXL LaunchPad SW2 button is being held low.
- MyCheckUpdateFunc checks if a software reset occurred and if a RAM-based predetermined value is set signifying the boot loader was called by the application. If these are true, the boot loader waits to upload a new encrypted application image.
- MyCheckUpdateFunc computes an AES-CBCMAC hash on the application code area and compares the result to the last 16 bytes of the application image. If the images match, the boot loader executes the application code. If the images do not match, it waits to upload a new encrypted application image.