Skip to content

stm32: fix ADC build for STM32G0 - #585

Open
wentx333 wants to merge 1 commit into
simplefoc:devfrom
wentx333:fix/stm32g0-adc-build-539
Open

wentx333 wants to merge 1 commit into
simplefoc:devfrom
wentx333:fix/stm32g0-adc-build-539

Conversation

@wentx333

Copy link
Copy Markdown

Description

Fixes #539.

STM32G0 devices do not provide the injected-channel LL API used by
_findBestADCForInjectedPins(), and their ADC_ChannelConfTypeDef does not
contain an Offset member. This change guards the injected-channel checks with
the corresponding LL capability macro and relies on the existing zero
initialization for optional ADC configuration fields.

The Generic G030C8 target is also added to the STM32 CI matrix. It compiles
step_dir_listener_simple.ino, which fits within the device's 64 KB Flash and
will provide regression coverage for this configuration.

Target architecture: STM32G0 (GENERIC_G030C8TX).

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Reproduced the build errors from [BUG] STM32G030C8T6 does not compile V2.4.0 #539 on the unmodified dev branch.
  • Compiled all objects for step_dir_listener_simple.ino after the change.
  • Linked the generated objects with the STM32 Core linker scripts using
    arm-none-eabi-ld. The resulting ELF uses 40,240 bytes of Flash and 3,392
    bytes of RAM.
  • Ran git diff --check and compared actionlint results with origin/dev;
    the workflow change introduces no new findings.

The local Windows policy blocks GCC's collect2.exe wrapper, so the final ELF
was linked directly from the same compiled objects. No physical-board test was
performed.

Test Configuration/Setup:

  • Hardware: Compile-only, no physical STM32G030 board
  • IDE: Arduino CLI 1.5.1
  • MCU package version: STM32duino 3.0.0

AI assistance

Codex assisted with code navigation, local toolchain setup, applying the patch,
running checks, Git preparation, and drafting this description. I reviewed and
understood the final diff and validation results before submission.

This branch has not been deployed

No deployments
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.

1 participant