在應(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. |
閃存例程一般通過(guò)UART或者CAN接口來(lái)進(jìn)行通信。為實(shí)現(xiàn)更可靠的錯(cuò)誤恢復(fù)機(jī)制,最好是接收小的數(shù)據(jù)包,并發(fā)送某種類(lèi)型的確認(rèn)信息。圖6給出了一個(gè)更新例程。記住,在掉電之前,如果沒(méi)有成功完成重新編程,需要通過(guò)JTAG端口對(duì)微控制器重新編程。
圖6. 簡(jiǎn)化的RAM更新例程流程圖
評(píng)論