Hoverboard controller (gd32f103) debugging

I’m trying to get simplefoc working on a hoverboard controller. It has a gd32f103 (stm clone) on it. I’m using stlink to program and can upload sketches. The stlink doesn’t support serial so I’m trying to use an usb/ftdi on its pa2/3 pins.

Anyway no debug data is coming through so I’m blind. I guess i could hook up an led and blink morse code!

Any suggestions?

Hello!
This board looks like the main board of a balance car.
There are many differences between gd32 and STM32.
Can you provide specific model or information and yor connection mode?

CMSIS_DAP…
It has serial port and supports gd32

After some major help from Max Gerhardt - I finally got debugging (breakpoints, etc) and serial working!
Here’s the issue where he helped me out:

Next to see if simplefoc will run on it!


I have my stlink connected to SWD and an ftdi usb/serial connected to PA2/PA3

TLDR: 1) I needed to use board=genericSTM32F103RC 2) The GD32 has no quartz oscillator so Max russled up some code that setup the equivalent in software and 3) I was seeing some RX/TX instability which may have been down to cable shielding, not flushing serial or running chip too fast.

@Owen_Williams Were you able to upload SimpleFOC on to your hoverboard controller?

Thanks.