Skip to content

GD32: fix build with current SimpleFOC (all platforms), restore StepDirListener interrupt - #17

Merged
Candas1 merged 3 commits into
Candas1:dev-gd32from
candas-agent:fix/gd32-api-update
Nov 18, 2026
Merged

Candas1 merged 3 commits into
Candas1:dev-gd32from
candas-agent:fix/gd32-api-update

Conversation

@candas-agent

@candas-agent candas-agent commented Nov 18, 2026 •

Copy link
Copy Markdown

After syncing dev-gd32 with simplefoc/master, the GD32 driver no longer builds, and the CI fails on every platform. Three small fixes:

  • gd32/PinNames.h included only on GD32: it was above the _GD32_DEF_ guard in gd32_mcu.cpp, so every other platform failed with gd32/PinNames.h: No such file or directory (cause of the AVR, ESP32, SAMD, RP2040, MDED, SILABS, STM32 workflow failures).
  • _driverSyncLowSide() returns void* (current sense API since 2.3.4): it now returns the current sense params, LowsideCurrentSense::init() checks it against SIMPLEFOC_CURRENT_SENSE_INIT_FAILED. This was already broken before the sync (ambiguating new declaration error).
  • StepDirListener: attachInterrupt restored. The workaround commented it out for every board; the current GD32 Arduino core accepts the call (polarity is a PinStatus). The file is now identical to simplefoc/master.

Nothing else changes: the fixed dead time (DEAD_TIME 60) and the hard-coded TIMER0 channels stay as they are.

The STM32 workflow is expected to keep failing: it also fails on simplefoc/master (stm32_mcu.cpp:126: cannot convert 'TIM_HandleTypeDef*' to 'TIM_TypeDef*' with the STM32 Arduino core 3.0), unrelated to this branch.

Tested locally (build only, no hardware run yet):

  • genericGD32F130C8, current platform-gd32 / ArduinoCore-GD32: minimal sketch (6PWM driver + 2-phase low side current sense + foc_current), and Candas1/Split_Hoverboard_SimpleFOC (dev) with hall sensors and with -D SENSORLESS after renaming FluxObserverSensor to MXLEMMINGObserverSensor
  • B-G431B-ESC1 (ststm32 19.7.1, STM32 core 2.12): the gd32 files compile to nothing

🤖 Generated with Claude Code

candas-agent and others added 3 commits November 18, 2026 16:50
…nce 2.3.4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The GD32 Arduino core now accepts it (polarity is a PinStatus since
SimpleFOC 2.3.x). The workaround disabled step/dir on every board.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It was above the _GD32_DEF_ guard, so every other platform failed with
'gd32/PinNames.h: No such file or directory' (all CI workflows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@candas-agent candas-agent changed the title GD32: fix build with current SimpleFOC, restore StepDirListener interrupt GD32: fix build with current SimpleFOC (all platforms), restore StepDirListener interrupt Nov 18, 2026
@Candas1
Candas1 merged commit 947a0a2 into Candas1:dev-gd32 Nov 18, 2026
22 of 30 checks passed
@candas-agent
candas-agent deleted the fix/gd32-api-update branch November 18, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants