I am trying to set up a TM4C1294NCPDT, using Tivaware v2.1.1.71, on a custom board to use pin PD7 = HIGH to perform a bootload at power up.
I have the following code which succeeds in writing the expected value of 0xFFFF7EFE to the BOOTCFG register (and I confirmed that the value persists over a power cycle) but when I make pin PD7 HIGH and then power up the board, the board does not go into the bootloader, it runs normally. I have verified on a scope that PD7 is actually high and I have checked that PD7 is high before nRESET changes state. I also noted that the NW bit of BOOTCFG = 1. I am not sure if that matters.
I was able to reproduce the same issue on the TM4C129 Launchpad board using PD7 so I don't think it is an issue related to the custom board. Also note that prior to programming the BOOTCFG register, I was able to do a GPIOInRead on PD7 in my code on the custom board and see a change in state if I changed the voltage applied to PD7. After programming BOOTCFG with the code below, I cannot see PD7 change state in the code, which makes me think that the pin is locked out somehow.
I would be grateful for hints as to what to check next. Do I need a write as well as a commit bit set below?
Here is the relevant code snippet:
>>
// Verify contents of BOOTCFG register
uint32_t bootcfg;
// PRT PIN P E RSV K RS DBG
#define BOOT_CFG_SET 0xFFFF7EFE // 011 111 1 0 111 1 11 10 // reserved bits preserved
// GPIO D7 - bootload if high, write key - A442, Debug unlocked
bootcfg = FLASH_BOOTCFG_R;
if ( (bootcfg & 0xFF12) != (BOOT_CFG_SET & 0xFF12) )
{
// configure BOOTCFG register
FLASH_FMD_R = (bootcfg & 0xFFFF00EC) | 0x7E12; // data
FLASH_FMA_R = 0x75100000; // BOOTCFG register address, see TM4C129 Databook p615, Table 8.3
FLASH_FMC_R = 0xA4420008; // control: command write to register with key 0xA442, see TM4C129 Databook p627
// wait for commit to clear
while ((FLASH_FMC_R) & 0x08)
{
;
}
}