Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

New platform: WeActStudio.BluePill-Plus-GD32#2071

Draft
ALTracer wants to merge 332 commits into
blackmagic-debug:mainfrom
ALTracer:feature/bluepillplus-platform
Draft

New platform: WeActStudio.BluePill-Plus-GD32#2071
ALTracer wants to merge 332 commits into
blackmagic-debug:mainfrom
ALTracer:feature/bluepillplus-platform

Conversation

@ALTracer

@ALTracer ALTracer commented Feb 9, 2025

Copy link
Copy Markdown
Contributor

Detailed description

  • This is a whole new cleaned up platform.
  • The existing problems are mismatching LED pins and incomplete mappings of board features between stlink/swlink and bluepillplus. In-tree platforms default to 72 MHz and do not leverage full potential of Gigadevices. Unmapping own SWJ-DP is not always acceptable, and stlink pinout is just weird.
  • This PR solves that by providing all necessary bindings in a dedicated platform, with chip detection and PLL configuration.

I do not expect this to be merged, because in-tree -Dprobe=bluepill already does provide some functionality. I do not implement vanilla PC13 bluepills, it's impossible for me to discern these from bluepillplus. This platform has feature parity with blackpill-f4, except I'm dissatisfied with its USBOTG-FS DWC2 bugs.
Choice of USART for Aux and SWO was influenced by existing 2x128 aux_serial DMA ping-pong buffers, which are insufficient for 1024 byte Zmodem packet operation I need in DUT firmware. So SWO is faster for burst operation. When that's refactored, I'll swap them back such that 6Mbaud VCP is possible.

TODO: I'd like to use platform_ident to indicate autodetection results, and to leverage meson options to pick linkerscripts which influence flash size for drivers and RAM size for heap/buffers/SWO.

Your checklist for this pull request

Closing issues

@dragonmux dragonmux added this to the v2.1 release milestone Feb 9, 2025
@dragonmux dragonmux added the Foreign Host Board Non Native hardware to runing Black Magic firmware on label Feb 9, 2025
@ALTracer
ALTracer force-pushed the feature/bluepillplus-platform branch from 1d39692 to fb6cb65 Compare March 6, 2025 04:41
@ALTracer
ALTracer force-pushed the feature/bluepillplus-platform branch from fb6cb65 to b84edbf Compare March 23, 2025 13:17
@ALTracer

Copy link
Copy Markdown
Contributor Author

This now supports 96 MHz APM32F103CB.
As well as classic 72MHz STM32F103CB, 96MHz GD32F103CB and 120MHz GD32F303CC (Cortex-M4), differentiating on CoreSight ROM table PIDR value. Unique ID in DESig is not exactly helpful, but serialno.c still works.
All four WeActStudio.BluePill-Plus-* boards have identical PCB, with LED on PB2 active-high, and button on PA0, USB FS device on type-C port, and 8 MHz crystal. All four chips lack USB DFU bootloader capability, only USART1 is supported for initial flashing, if you don't have another USB-SWD/JTAG adapter.
CH32F103C8 not considered due to insufficient Flash capacity.

@ALTracer
ALTracer force-pushed the feature/bluepillplus-platform branch from ed79933 to f6dab76 Compare July 13, 2025 14:53
@ALTracer
ALTracer force-pushed the feature/bluepillplus-platform branch from f6dab76 to 97627db Compare July 23, 2025 19:23
dragonmux and others added 23 commits March 14, 2026 15:43
…e off the binary and fixing it being grumpy if the length parameter was 0
…usage being able to loose the input pointers if the entry allocation fails
…ferent probe platforms and their variants in CI
… we aren't having to build libftdi and other components and getting spurious errors out the flow
TI added multiple layouts for the registers depending on a part. Implementing and maintaining it all is too much effort (and code) with dubious value.
dragonmux and others added 29 commits July 2, 2026 12:02
…g missing to properly bound the requests to the probe
… to properly bound the requests to the probe in the JTAG TMS sequence impl
…he remote protocol command functions that would result in garabge or non-sensical error messages being displayed when `platform_buffer_read()` failed with a negative error value
… SWD comms for ADIv5, `dp->ensure_idle` could be left stale pointing at the JTAG function and crash the probe
…C-V support itself is enabled in the firmware
…ilable via the normal GDB memory interfaces anyway
* Uses PB2 LED, USB FS device with external 1.5k pullup
* BMD bootloader also uses PA0 button and boot magic flags
* WeActStudio.BluePill-Plus boards have a DNF SOIC-8
  footprint for 25-series SPI NOR flash, wired to PA4/5/6/7.
* Add the pin mappings regardless of the platform flavour.
* Rely on DBGMCU_IDCODE and SCB_CPUID
@ALTracer
ALTracer force-pushed the feature/bluepillplus-platform branch from 5e3cdaf to 581a69c Compare July 13, 2026 17:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Foreign Host Board Non Native hardware to runing Black Magic firmware on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants