Hi Everyone,
I’ve got myself some Chinese GD32F103CBT6’s (128KB Flash, 20KB SRAM). Got them soldered onto a breakout board, and I can successfully connect, wipe, and upload programs to it. I was expecting this MC to be pin-equivalent to the beloved bluepill’s STM32F103C8T6 (went with CB instead of C8 for the extra memory space). STM32Cube recognizes it all properly (device ID 0x410 with 128KB flash). Tried a full chip erase before any uploads.
I’ve got an 8MHz crystal across pins 5 and 6, and a decoupling capacitor on RST. Boot1 and Boot0 are tied to GND.
I’m using VScode with PlatformIO, and my platformio.ini looks like this. I’ve tried other configurations too, matching the generic bluepill and the 128kb version of the bluepill.
[env:genericSTM32F103CB]
platform = ststm32
board = genericSTM32F103CB
framework = arduino
board_build.mcu = stm32f103cbt6
board_build.f_cpu = 72000000L
Got a simple Blink program to blink PA1 every 100ms.
#include <Arduino.h>
#define LED PA1
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED,HIGH);
delay(100);
digitalWrite(LED,LOW);
}
Compiles fine, uploads fine, but the pin won’t blink.
I’ve tried:
Changing the platformio.ini environment to bluepill_f103c8_128k and bluepill_f103c8 (and changing the board name appropriately)
Addressing the pin name differently (PA1 vs PA_1), and tried different pins.
I’m wondering if I need to somehow change the clock settings? Has anyone gotten a GD32F103CBT6 to work out like a bluepill?
I’m not very experienced with more advanced embedded platforms, I’ve only recently started using STM32’s, but I’m trying to get this GD32 working to provide myself a backup for global chip shortages, in case supply chain issues fail me when trying to source STM parts. I did recently successfully build my project out on a STM32G071CBT6, and was quite pleased that I got that to work, but I expected this task to be as simple as treating the GD32 like a bluepill, but this is proving not to be the case. Fortunately the slight differences between the two chips aren’t critical to my application.
Any guidance here would be appreciated! Let me know if I can provide any more information here.