CH552如何从用户代码区返回到bootloader

除了上拉DP方法外,有没有软件的方法让已经有代码的返回到bootloader代码下载状态?


根据手册,擦除3800h地址的4个字节代码后reset复位可行吗?还是说需要修改NO_BOOT_LOAD标记位后reset?

if you want to activate the bootloader from user mode just exexute a LCALL 0x3800 or LJMP 0x3800. 

It might be a good idea to disable all irqs before and maybe set the clock to the default 6MHz although i also have started the bootloader at 24Mhz.


Example (keil)


#define CALL(addr) (((void(*)(void))(unsigned char code *)addr)())

...

if(bWantBootLoader)

{

    EA=0;

    CALL(0x3800);

    while(1);

}

....


thanks bro,i'll gonna try your code!


只有登录才能回复,可以选择微信账号登录