recently I got a new board called blackpill (a STM32F401CCU6 version, not the STM32F103). This board is interesting for it has a type c female socket on it and it also improves the way of entering the DFU mode. I checked the datasheet and I am pretty sure the pin definition of STM32F401CCU6 is the same as the STM32F401 Discovery board, which is using STM32F401VCT6.
However, I used the demo RT-STM32F401C-DISCOVERY, only change the LED pin and compiled, downloaded it into the blackpill, but the LED seems not to blink. May I ask are there any settings I need to change to make the example run on that blackpill? Any thoughts would be helpful, thank you.
The code I changed in the example is changing the LED pin with:
Code: Select all
static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
while (true) {
palSetPad(GPIOC, 13);
chThdSleepMilliseconds(500);
palClearPad(GPIOC, 13);
chThdSleepMilliseconds(500);
}
}
The Chibios I am using is ver17.6.3, compiled with arm-none-eabi-gcc-9.2.1 and downloaded via dfu-util. The download is succeeded for I can downloaded other bin files the vendor provided and the LED is blinking.
The vendor also provides the schematic file where I listed in the attachments. The blackpill uses a 25Mhz, 9PF high-speed oscillator and a 32.768K, 6PF low-speed oscillator. The vendor also provides an examples of PWM with an LED written with Keil.