2803x和2806x,利用CAN通信进行在线程序升级,思路是程序分为boot程序和主程序,boot程序跳转到主程序,两个程序都有CAN初始化部分,调试时发现,带仿真器在线仿真时,boot程序跳转到主程序后会死在主程序的CAN初始化部分: // Wait until the CPU has been granted permission to change the configuration registers
do
{
ECanaShadow.CANES.all = ECanaRegs.CANES.all;
} while(ECanaShadow.CANES.bit.CCE != 1 ); // Wait for CCE bit to be set..