Closed salfter closed 1 year ago
The examples here are at least supposed to mirror https://github.com/Community-PIO-CH32V/platform-ch32v/blob/develop/examples/blinky-none-os/src/main.c but they got out of sync. Platform example uses PC1. Will sync the examples..
I ordered one of the inexpensive kits from an AliExpress vendor that includes a CH32V003F4P6_EVT_R0 eval board, a programmer, and other bits and pieces. What's the first thing most people try to bring up on a new eval board? A blinky program. I grabbed the one from here, wired the board to the programmer, ran a jumper from PA1 to LED1, and loaded the code onto the board...and got nothing for my trouble.
It turns out that PA1 and PA2 on these boards are wired to the onboard 24-MHz crystal, which is used as the clock source for the microcontroller. I tweaked the source to use PC1 instead, and once flashed, it behaved as expected.
To avoid this bit of frustration for other new users, you might be interested in the PR I'm about to submit.