1# rainbow99
可以参照下面的程序修改bootcfg的数值,可以通过配置任意IO口的电平来进入bootloader。
//write the BOOTCFG flash register to enable PA1 low to enable
//the ROM bootloader at poweron
regVal = HWREG(0x400FE000 + 0x1D0); //BOOTCFG
if (regVal & 0x80000000) //committed yet?
{
HWREG(0x400FD000 + 0x000) = 0x75100000; //FMA=BOOTCFG "address"
HWREG(0x400FD000 + 0x004) = FLASH_BOOTCFG_PORT_A | FLASH_BOOTCFG_PIN_1 | FLASH_BOOTCFG_DBG1; //FMD=BOOTCFG value (PB5 low/DBG enabled)
HWREG(0x400FD000 + 0x008) = 0xA4420008; //FMC=key+commit
SysCtlDelay(100 * SysCtlClockGet() / (3 * 1000));
}
|