Open techolga opened 2 years ago
I solved the flash target with setting "stm8flash_target": "stm8af52A?"
in the upload section of my board.json.
for the define flag I went with the following:
build_mcu = board_config.get("build.mcu")[:9].upper()
if build_mcu[5] == 'S':
build_mcu = build_mcu[:8]
else:
build_mcu += 'x'
command = [
env.subst("$CC"), "-m%s" % board_config.get("build.cpu"),
"-D%s" % build_mcu,
"-I.", "-I", "%s" % env.subst("$PROJECT_SRC_DIR"),
"-Wp-MM", "-E", "stm8s.h"
]
Hi, I tried to get a custom Board running when I realized that I am not able to compile for targets with longer label than 8 characters.
https://github.com/platformio/platform-ststm8/blob/00bed19beec29236654bc3b239f03e0137931abe/builder/frameworks/spl.py#L46
I tried to use
board_build.mcu = stm8af52ax
in platform.ini and the SPL needs to have STM8AF52Ax to be defined. There are several targets that have a different definition schema.A similar problem could appear with the arduino framework. https://github.com/platformio/platform-ststm8/blob/00bed19beec29236654bc3b239f03e0137931abe/builder/frameworks/arduino.py#L72
Also I found the stm8flash target to not fit https://github.com/platformio/platform-ststm8/blob/00bed19beec29236654bc3b239f03e0137931abe/builder/main.py#L163
correct target would be
stm8af52a?
according to https://github.com/vdudouyt/stm8flash