CH579如何禁用Bootloader

目前寄存器R8_GLOB_CFG_INFO读出bit3为1,表示 boot-loader处于使能状态,注意到该寄存器是RO类型,WCHISPTool中没找到选项可以配置该位,请问如何关闭bootloader?

ch573 的 bootloader不支持禁用,

但是 有方法可以使bootloader下载不进去新的固件,且是自行代码可控的.

可以参考:/bbs/thread-72397-1.html

注意,此种操作,有一定的风险: 当使用上面方法把芯片flash"上锁"后,,而自己的代码又没有实现解锁功能,将会导致芯片再也下载不进代码.



Actually, it's possible to completely disable Bootloader. At datasheet page 7 you can see description of configuration word in Table 2-3, bit 6 is CFG_BOOT_ENABLE. This bit is in charge of boot selection. Configuration word is the part of InfoFlash and located at 0x00040010. WCH do not want to document InfoFlash update procedure, but it actually very like usual flash erase/write, only command codes slightly different.


有内置BOOT,可以使用串口和USB后烧写用户固件,如果没有BOOT,用户是没办法烧写固件的。

而且用户代码是没有权限修改CFG_INFO的。
禁用BOOT的目的是什么?


CH579M is a usual Cortex-M0, so any SWD debugger/flasher can be used to load firmware. Factory-provided Bootloader, which hooks USB/UART, is not a perfect idea for production. Specially if your target board has no USB/UART connectors at all and you want to prevent third parties from patching/changing your code.

Moreover, with Bootloader enabled, I can't flawlessly switch back ROM_CODE_OFS bit - MCU resets into factory boot.


我们是建议客户使用我们的boot进行升级,所有的开发,量产工具都是基于boot进行的,设计参考推荐预留串口1和usb。不存在只有swd的情况


I understand your position. Just want to mention it is not a kind of "one fit them all" solution. CH579M is a good general-purpose MCU for different applications.


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