请问 CH552 上电进入bootloader的逻辑是什么?(使用小米充电宝供电有时无法启动)

我最近尝试使用小米充电宝为CH552的板子供电,却发现有时无法启动。经观测:小米充电宝D+,D-空载各有约2.58V电压。如果板子一侧是MicroUSB接口,连接充电宝先插MicroUSB,再插TypeA,可以启动,如果先插TypeA,再插MicroUSB,则无法启动。测试板子是一个烧录了闪灯程序的最小系统。启动与否依据是否观察到闪灯而定。我猜测是进入了Bootloader。


1593287901158321.png

测试1,D+上拉10K,再插Type A,无法启动。可以理解是进入bootloader


1593287902760045.png

测试2,插Type A,可以启动。

1593287902275023.png

测试3,插MicroUSB,无法启动。猜测是MicroUSB的电极太短,上电后D+直接被拉高进入Bootloader。


请问 CH552 上电进入bootloader的逻辑是什么?是不是直接在上电后检测D+的数字逻辑电平并决定是否跳转用户程序?

552芯片进boot的方式有三种:

1、空片(即未下载过的芯片)第一次上电默认进boot,当下载过程序后再次上电需要触发才能进boot;

2、触发进boot   冷上电检测P36引脚是否是高电平,如果是高电平则进boot;

3、通过IAP方式跳转进boot;

如果上电时D+有电压 那会满足进boot的条件跑boot程序。



前面的测试1和测试3 你可以打开电脑的设备管理器,看一下外部接口中有没有USB MODULE设备。如果出现了说明此时在跑BOOT程序。


非常感谢,之前简单在插充电宝的同时将USB插入电脑并没有办法识别,估计是USB电平冲突所致。这样的话如果USB供电端数据线是电阻分压的情况,需要让用户插拔TypeA以避免进入Bootloader。


0.png

官方解答不给力,连个简单的解决方案都不推荐。



The p1.5 download configuration seems to work only with the latest version. i have bought some 1K pcs of CH554G and facing a huge issue because of this bootloader problem. whenever a device is connected to the USB before power on it automatically enters in to boot mode and the entire unit is not working. i have the chip with bootloader version 1.10 and 3.2 but both are not working. when i contacted the support team they simply telling this function is added only to the latest version chip. so that means previous version chips are of no use!!!

if you are having a older version boot code chip then no matter what you select in the WCHISP tool download cfg p1.5 or p3.6 it always works with p3.6 only.


(已翻译)

p1.5下载配置似乎仅适用于最新版本。 我已经购买了大约1K的CH554G,由于这个引导程序问题而面临着一个巨大的问题。 只要将设备连接到USB,然后再打开电源,设备就会自动进入启动模式,并且整个设备都无法工作。 我的引导加载程序版本为1.10和3.2,但两者均无法正常工作。 当我联系支持团队时,他们只是告诉此功能仅添加到最新版本的芯片中。 所以这意味着以前版本的芯片没有用!!!!

如果您使用的是较早版本的引导代码芯片,则无论您在WCHISP工具下载cfg p1.5还是p3.6中选择什么,它始终仅适用于p3.6。


sorry... in my last post i wrongly mentioned the boot code version. i tested with 1.1 and 2.31 which p1.5 is not working. WCH people says that from 2.36 version only it will work.


(已翻译)
抱歉...在我的上一篇文章中,我错误地提到了启动代码版本。 我用1.1和2.31进行了测试,其中p1.5不起作用。 WCH的人们说,只有2.36版本可以使用。


Our chip BOOTLOADER version greater than or equal to 2.30 supports download pin configuration. The 1.1 version does not support it.


可以在D+引脚加15K~33K的下拉电阻,避免MCU进boot


@Madhan

As mentioned above aktivating the bootloader by poweron reset with P1.5 needs at least loader 2.30. I have seen chips with v1.1, v2.31 and recently v2.40. So If your chips have v1.1 there ist simply no was to use P1.5. 

The only way would bei to add an extra pulldown at D+ or replace the loader with v2.31 or v2.40. I personally recoment v2.40 because it ist much more secure than the others.

Replacing the loader is not easy but doable if 1.1 ist installed. Been there, done that.... 

Google should give you some ideas how to do that.


One extra Note:

At AliExpress some guys sell CH552 with deactivated or missing bootloader. Thus making those chips unusable unless WCH releases some dokument about the SPI programming. 

We have done some tests with those chips but could not find any way to activate the loader. We have tried all combinations we are aware off including serial programming.


Hello, the SPI upgrade protocol part is not open to users. If the chip can’t enter the boot, you can apply to add me qq. I will tell you my address. You can send these chips to us for testing.


嗯,这个程序我很认真的看过了,唯一的疑问是我怎么再回到这个boot loader程序,如果是集成再application里面,那升级过程中有可能出现掉电等极端情况,那岂不是会变砖?


发错,忽略


@wangyy i have a chip with boot version 2.31 but still it does not support p1.5. is there any way to update the usb bootloader to 2.40 verion or is there any way to remove the usb bootloader? 


@usbman i have both 1.1v and 2.31 version bootloader. kindly share me som details to delete it or update it.


Thanks in advance.


@WCH_Tao i have tried to add a pull down resisitor of 10k which is ok for few devices but not all...


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