Skip to content

ARDUINO_ARCH_HC32 defined to late? #17

@ellensp

Description

@ellensp

Please bare with me my terminology is probably all wrong (frameworks are above my pay grade!)

With Marlin when you build (for any system) one of the stages it goes through is

.platformio/packages/toolchain-atmelavr/bin/avr-g++" -D__MARLIN_FIRMWARE__ -DNDEBUG -D__MARLIN_DEPS__ -w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h
The generates a list of all used defines for use in buildroot/share/PlatformIO/scripts/preprocessor.py

On all other platforms this 'builds' without issue
On Framework-arduino-hc32f46x this triggers the error in Marlin/src/pins/hc32f4/env_validate.h

#ifndef ARDUINO_ARCH_HC32
  #error "Oops! Select an HC32F460 board in 'Tools > Board.'"
#endif

This breaks buildroot/share/PlatformIO/scripts/preflight-checks.py
Normally if you set #define MOTHERBOARD to a board that requires a different ENV: this will tell you the valid envronments you can use.

A worknig eg: start with stock configs and set #define MOTHERBOARD BOARD_BTT_SKR_V1_4
click build and marlin tells you
"Error: Build environment 'mega2560' is incompatible with BOARD_BTT_SKR_V1_4. Use one of these environments: LPC1768"

With a HC32 board:
eg #define MOTHERBOARD BOARD_AQUILA_V101
results in #error "Oops! Select an HC32F460 board in 'Tools > Board.'"

removing the check from Marlin/src/pins/hc32f4/env_validate.h gives the expected results
"Error: Build environment 'mega2560' is incompatible with BOARD_AQUILA_V101. Use one of these environments: HC32F460C_aquila_101"
But this is not a solution.

Could you look into this?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions