wuxx / nanoCH32V203

61 stars 7 forks source link

Arduino core support #6

Open hackery opened 1 month ago

hackery commented 1 month ago

What's needed to make this board work with the Arduino core for CH32 ?

I tried using the standard blink sketch, it builds and downloads to the nanoCH32V203, but no blinking LED. It looks like the core does not define LED_BUILTIN, but defining it as GPIO_Pin_15 as in the makefile-example doesn't work.

The example files for the WCH EVT boards (in doc/EVT/EXAM/GPIO/GPIO_Toggle) use GPIO_Pin_0. I'm working through all the available GPIOs to see if the LED is attached to another pin, but I suspect there's something else missing from the board definitions.

hackery commented 1 month ago

I got a workaround for the simple case for blink - adding this to user code

#define LED_BUILTIN 15

I imagine there are a bunch more board-specific definitions needed, will try a few peripheral samples and update. (I was using GPIO_Pin_15 in pinMode etc but of course that's a bitfield)