cc2541 如何强制进入某一 Image
我在调试CC2541的oad功能,我们的方案是imageA作为主程序运行块
ImageB作为仅提供OAD功能的部分
在接收app某一指令后令2541进入ImageB,而后可以进行OAD
但是不知道如何强制进入ImageB,是否需要修改BIM
不需要修改BIM啊,程序默认如果CRC校验对的话默认是从Application Image,也就是ImageA开始跑,如果CRC不对或者没有ImageA才会从升级程序,也就是ImageB开始。所以把ImageA的标志位改一下就好啦。
if ((crc[0] != 0xFFFF) && (crc[0] != 0x0000))
{
if (crc[0] == crc[1])
{
JumpToImageAorB = 1;
// Simulate a reset for the Application code by an absolute jump to the expected INTVEC addr.
asm("LJMP 0x4030");
HAL_SYSTEM_RESET(); // Should not get here.
}
/* This check is disruptive when an OAD process to Image-A is interrupted - this check must
* complete before the still good Image-A is run.
else if (crc[1] == 0xFFFF) // If first run of an image that was physically downloaded.*/
{
crcCheck(BIM_IMG_B_PAGE, crc);
}
/**/
}