目前寄存器R8_GLOB_CFG_INFO讀出bit3為1,表示?boot-loader處于使能狀態(tài),注意到該寄存器是RO類型,WCHISPTool中沒找到選項可以配置該位,請問如何關(guān)閉bootloader?
ch573 的 bootloader不支持禁用,
但是 有方法可以使bootloader下載不進去新的固件,且是自行代碼可控的.
可以參考:http://www.findthetime.net/bbs/thread-72397-1.html
注意,此種操作,有一定的風險: 當使用上面方法把芯片flash"上鎖"后,,而自己的代碼又沒有實現(xiàn)解鎖功能,將會導致芯片再也下載不進代碼.
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.
有內(nèi)置BOOT,可以使用串口和USB后燒寫用戶固件,如果沒有BOOT,用戶是沒辦法燒寫固件的。
而且用戶代碼是沒有權(quán)限修改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進行升級,所有的開發(fā),量產(chǎn)工具都是基于boot進行的,設(shè)計參考推薦預留串口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.