在應用編程MAXQ微控制器中可分區擦除的程序和數
表7. 從RAM中執行代碼的限制
SC.UPA must be set to 0 before executing a RAM-based routine. This means that the application must jump to the RAM routine from the code segments P0 P1. |
RAM cannot be accessed as data and program at the same time. This means that only the registers and hardware stack are available for data storage. |
The Interrupt Vector must point to a RAM routine if interrupts are enabled. Typically interrupts are turned off and polling is used due to the simplicity of the RAM reflash routine. |
閃存例程一般通過(guò)UART或者CAN接口來(lái)進(jìn)行通信。為實(shí)現更可靠的錯誤恢復機制,最好是接收小的數據包,并發(fā)送某種類(lèi)型的確認信息。圖6給出了一個(gè)更新例程。記住,在掉電之前,如果沒(méi)有成功完成重新編程,需要通過(guò)JTAG端口對微控制器重新編程。
圖6. 簡(jiǎn)化的RAM更新例程流程圖
評論