SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
The UCD3138 can erase its own program flash, either in pages or as a single block. A block erase is best used for flash security for production code. In this way, even if the backdoor is activated, the flash security is still maintained.
It is also possible to write all zeroes to the checksum and clear it. That way, the next time the UCD3138 is reset, it will power up into ROM mode and the memory can be examined. This is best for development, so that the memory contents can be analyzed if necessary.
Any changes to program flash must be made while executing in other memories – ROM, RAM, or Data Flash. It is possible to corrupt Data flash without affecting the Program Flash checksum, so it is unwise to put the flash modification program into Data Flash.
It is best to put it into Program Flash and copy it into RAM. In this way, if the program image is corrupted, the checksum will be incorrect, and the device will automatically enter ROM mode on reset. The reference firmware in most UCD3138 EVM will use the copy into RAM method.