在应用编程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. |
闪存例程一般通过UART或者CAN接口来进行通信。为实现更可靠的错误恢复机制,最好是接收小的数据包,并发送某种类型的确认信息。图6给出了一个更新例程。记住,在掉电之前,如果没有成功完成重新编程,需要通过JTAG端口对微控制器重新编程。
图6. 简化的RAM更新例程流程图
评论