我们知道集成ROM的CPU中有BOOT程序。如何调用呢?调用哪个函数?例如,检测PA0 = 0或者串口接收到一个更新命令时,如何调用rom中的boot程序。谢谢!
When performing an update via a serial port (UART0, SSI0, or I2C0), ConfigureDevice() is
used to configure the selected serial port, making it ready to be used to update the firmware.
Then, Updater() sits in an endless loop accepting commands and updating the firmware
when requested. All transmissions from this main routine use the packet handler functions
(SendPacket(), ReceivePacket(), AckPacket(), and NakPacket()). Once the update is
complete, the boot loader can be reset by issuing a reset command to the boot loader
找到答案了!转载
Aha. I see now what you wanted me to see. ALL interrupts must be disabled. In hindsight, that makes perfect sense. I now disable every interrupt (including systick), then clear out the UART fifo before passing control to the ROM_UpdateUART() function. This works!
MAP_IntMasterDisable();
MAP_SysTickIntDisable();
NVIC_DIS0_R = 0xffffffff;
NVIC_DIS1_R = 0xffffffff;
MAP_UARTConfigSetExpClk(UART0_BASE, ROM_SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
Delay(1000); //just a software delay
i = UARTIntStatus(UART0_BASE, false); //get interrupt status (RAW interrupt status)
UARTIntClear(UART0_BASE, (unsigned long)i); //clear interrupt status
while(MAP_UARTCharsAvail(UART0_BASE)){ //empty the fifo
i = MAP_UARTCharGetNonBlocking(UART0_BASE);
}
Delay(1000);
ROM_UpdateUART();
I know the delays are probably not necessary, but that's what worked for me.
I do still sometimes get a failure during the flash programming from the LM Flash Programmer. In this case i'm SOL. I must go reprogram the board with the JTAG programmer. This is not an ideal solution for field updates. Is the LM Flash Programmer software reliable for in-the-field flash programming? I'm afraid of field programming failures that would leave the code erased. This is why I wanted to get around the auto-baud detect in the first place.