在應(yīng)用編程MAXQ微控制器中可分區(qū)擦除的程序和數(shù)
表7. 從RAM中執(zhí)行代碼的限制
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. |
閃存例程一般通過UART或者CAN接口來進行通信。為實現(xiàn)更可靠的錯誤恢復(fù)機制,最好是接收小的數(shù)據(jù)包,并發(fā)送某種類型的確認(rèn)信息。圖6給出了一個更新例程。記住,在掉電之前,如果沒有成功完成重新編程,需要通過JTAG端口對微控制器重新編程。
圖6. 簡化的RAM更新例程流程圖
評論