-
Notifications
You must be signed in to change notification settings - Fork 76
Description
CH582 and CH583 are very useful and well performing BLE SoCs, with the native USB they have the potential to replace NRF52840 and similar in many scenarios.
Sadly, there is no Arduino core for them yet.
Is it possible to start an Arduino core for this familly?
If so it would be really important to implement the automatic flashing via USB, that is, no programmer required, the user can simply plug the native USB port and flash from the IDE (and get debug traces via CDC as well).
Usually the way we implement this simple mechanism is with CDC baudrate handler : when the user wants to upload some code, the host (PC, mac or linux) will issue a standard CDC baudrate change command and set the baudrate to an odd value, like 1200.
In the CH58x USB stack CDC handler, this value will issue a reset of the CH58x after setting the appropriate flag to stay in the bootloader after reset, meanwhile the USB flashing tool is started by the ARduino IDE and will find the CH58x USB peripheral since it is still in bootloader mode, it will then reflash it, after what the CH58x will jump to the user code.