At the beginning hi to all forum users:)
I have question about TI bootloader. In previous job I was working with STM32 uC. It has embedded bootloader in ROM memory similar way
that TI TM4C1294 has. The only difference is that STM32 by default has specified BOOT pin to enable bootloader during power up by applying
low or high signal to that pin. TI uC has the same function disabled by default, to enable it I need to update BOOTCFG register.
I found in documentation that i need to make a "commit" operation to it. I do everything as described in datasheet but it not working:/
Can anyone with bigger experience take a fast look to attached code and tell me where I made a mistake?
void InitBootloader(void)
{
// Registers for bootloader selection
uint32_t reg;
uint32_t* fmaReg;
uint32_t* fmdReg;
uint32_t* fmcReg;
uint32_t* bootcfgReg;
fmaReg = (uint32_t*)FLASH_FMA;
fmdReg = (uint32_t*)FLASH_FMD;
fmcReg = (uint32_t*)FLASH_FMC;
bootcfgReg = (uint32_t*)FLASH_BOOTCFG;
//Read BOOTCFG value
reg = *bootcfgReg;
//Clear boot GPIO trigger settings
reg &= 0xFFFF00FF;
//Set new settings:
//PORTF = 0x5
//PIN2 = 0x2
//POL = 0
//EN = 0
reg |= 0xA8 << 8;
*fmaReg = 0x75100000;
*fmdReg = reg;
*fmcReg = 0xA442;
UARTprintf("Old BOOTCFG: %x\n", *bootcfgReg);
UARTprintf("New BOOTCFG: %x\n", reg);
}
If I understand datasheet correct the commit operation has 3 steeps:
1) Setup address in FMA register
2) Setup value in FMD register
3) Trigger operation by passing special key value to FMC register
After power up the register value not changes and I do not know why. It is possible I made simple mistake by choosing wrong key value
or something similar. I just need someone fresh look to that code.