Has anyone used flash mirror mode on the TM4C129? My understanding is that enabling it will translate reads of the lower half of flash into reads of the upper half, and possibly vice versa, but writes and erasures won't be affected. Instead, I'm seeing the entire lower half reading as erased and attempting to read the upper half results in a hard fault.
// TM4C1294KCPDT with 512 KB of flash
// Flash: 0x00000000 to 0x0007FFFF, upper half at 0x00040000
// This code runs from RAM
volatile uint32_t oldLower, oldUpper, oldFlashConf, newFlashConf, newLower, newUpper;
ROM_IntMasterDisable();
// Read first word of lower and upper halfs of flash
oldLower = HWREG(0x00000000); // 0x20000200
oldUpper = HWREG(0x00040000); // 0xCCCCCCCC
// Enable flash mirror mode
oldFlashConf = HWREG(FLASH_CONF); // 0x00000000
HWREGBITW(FLASH_CONF + 3, 6)= 1;
newFlashConf = HWREG(FLASH_CONF); // 0x40000000
// Read first word of lower half of flash
newLower = HWREG(0x00000000); // 0xFFFFFFFF (expected 0xCCCCCCCC)
// Try to read first word of upper half of flash
asm volatile(" BKPT #0");
newUpper = HWREG(0x00040000); // Hard fault (expected 0x20000200)