Question regarding use of AXIM vs ITCM.
I just solved a bug in my software, and can't quite understand how it happened. My code is a built in hardware test for our board, and a bootloader, which communicates with a serial bus and downloads different compoents to different memories. One of those components is on the internal flash, and is the main software.
Loading the main software worked fine. However, the software also supported queries about the tests, and after the software was loaded, the CRC check would fail on the newly loaded software until the power was cycled. After cycling power, the CRC check would pass.
I looked at this under a debugger, and found that the CRC check was in fact giving a different result after rewriting the flash contents (an incorrect value) and a correct value after cycling power. My first guess was cache problems, but since the loader component of the software does things to the flash, and has no need for caching, it doesn't turn the caches on.
I had been running the CRC over the region where the main software was stored, (0x280000-0x2FFFFF). I noticed that under the debugger, when I looked at the newly-burned region, including the CRC itself, the values shown and the values actually there disagreed until reset. That gave me the idea for the fix, and I just changed the boundaries of the CRC to 0x8080000-808FFFF. Now the software worked perfectly.
I did notice while debugging that during a load from the flash, the values getting loaded into the registers of the CRC component seemed to be correct, even if I didn't see them correctly under the debugger. What I don't understand is what the processor was "seeing" on the ITCM bus after the flash was rewritten? How was it coming up with an incorrect value?