DeqingSun / ch55xduino

An Arduino-like programming API for the CH55X
GNU Lesser General Public License v2.1
437 stars 86 forks source link

How to enter Bootloader for CH552 from code? #63

Closed lpuser13 closed 2 years ago

lpuser13 commented 2 years ago

Hi I have been using this core for CH552 successfully for a while now....tnx

I am now trying to activate the Bootloader (built-in default v02.31) from within the code - without success. (I can enter the booloader using DP+ approach using WCHISPTool{v2.70} to download firmware)

I have tried LJMP 0x3800, but it never seems to enter the bootloader.

Does anyone have a working example available?

FYI: my config in the IDE is USB with 148B USB RAM @ 24MHz

DeqingSun commented 2 years ago

@lpuser13 check https://github.com/DeqingSun/ch55xduino/blob/78d01729a897dd2080c855575f0042dc18c31fc4/ch55xduino/ch55x/cores/ch55xduino/USBCDC.c#L49

lpuser13 commented 2 years ago

Cool will try it out later today.....tnx

lpuser13 commented 2 years ago

Worked fine, many thanks for the support and prompt response.