Compilation failure using platform-ststm32 10.0.0

If I use the 10.0.0 release of ststm32 platform my code doesn’t compile anymore :

> Executing task in folder Gate: pio run <

Processing l0 (platform: ststm32; board: l0; framework: stm32cube)
------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/l0.html
PLATFORM: ST STM32 (10.0.0) > L0
HARDWARE: STM32F072VBT6 48MHz, 16KB RAM, 128KB Flash
DEBUG: Current (stlink) External (stlink)
PACKAGES: 
 - framework-stm32cubef0 1.11.1 
 - tool-dfuutil 1.9.200310 
 - tool-ldscripts-ststm32 0.1.0 
 - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
AssertionError: Missing MCU or Product Line field:
  File "/Users/nicolasrabault/.platformio/penv/lib/python3.8/site-packages/platformio/builder/main.py", line 170:
    env.SConscript("$BUILD_SCRIPT")
  File "/Users/nicolasrabault/.platformio/packages/tool-scons/scons-local-4.0.1/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/Users/nicolasrabault/.platformio/packages/tool-scons/scons-local-4.0.1/SCons/Script/SConscript.py", line 287:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/Users/nicolasrabault/.platformio/platforms/ststm32/builder/main.py", line 99:
    target_elf = env.BuildProgram()
  File "/Users/nicolasrabault/.platformio/packages/tool-scons/scons-local-4.0.1/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/Users/nicolasrabault/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/platformio.py", line 61:
    env.ProcessProgramDeps()
  File "/Users/nicolasrabault/.platformio/packages/tool-scons/scons-local-4.0.1/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/Users/nicolasrabault/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/platformio.py", line 127:
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "/Users/nicolasrabault/.platformio/packages/tool-scons/scons-local-4.0.1/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/Users/nicolasrabault/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/platformio.py", line 342:
    SConscript(env.GetFrameworkScript(f), exports="env")
  File "/Users/nicolasrabault/.platformio/packages/tool-scons/scons-local-4.0.1/SCons/Script/SConscript.py", line 661:
    return method(*args, **kw)
  File "/Users/nicolasrabault/.platformio/packages/tool-scons/scons-local-4.0.1/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/Users/nicolasrabault/.platformio/packages/tool-scons/scons-local-4.0.1/SCons/Script/SConscript.py", line 287:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/Users/nicolasrabault/.platformio/platforms/ststm32/builder/frameworks/stm32cube.py", line 43:
    assert PRODUCT_LINE, "Missing MCU or Product Line field"

If I go back to 9.0.0 it’s working again.
You can try to reproduce using the gate (or any other) project of this repo : GitHub - Luos-io/Examples: Drivers, apps and projects examples with Luos
Do I have something to change on my projects to make it work?

What board is this? l0 is not an official board. Have you created a private board definition? If so, please show it.

How is this thing called L0 for the STM32L0 series and then it’s a… F0 series chip? o_o

Looks to me like the build script fails because it cannot deduce the series from the MCU name or board name. Please show the full board JSON file just like Manuel said.

Edit: Aha I’ve found your board file at https://github.com/Luos-io/Examples/blob/master/Projects/Gate/boards/l0.json.

STM32Cube support was recently majorly redone in Update support for STM32Cube framework · platformio/platform-ststm32@ec29fab · GitHub (also see Enable better IntelliSense in STM32Cube framework by adding Src path to search path · Issue #449 · platformio/platform-ststm32 · GitHub).

I’ll check why the builder script can’t figure out your MCU or product line from that.

Fixed by adding

        "product_line": "STM32F072XB"

in the board’s JSON file. I’ll do a PR.

Boards now declare their series, and the builder script uses that to get the startup assembler file

so the startup file for the STM32F072VBT6 you need is

And thus that product_line value.

Fixed per Fix compilation for STM32 platform 10.0.0 by maxgerhardt · Pull Request #33 · Luos-io/Examples · GitHub.

1 Like

Thank you guys !

Indeed I defined my own board : https://github.com/Luos-io/Examples/blob/master/Projects/Button/boards/l0.json

Special thanks for @maxgerhardt for the PR :wink:

According to https://github.com/Luos-io/Examples/runs/1485188793 the compilation now starts without that board error but errors out because of the missing LuosHAL dependency… but that’s for the other topic I guess. Locally it goes through.

Dependency Graph
|-- <Luos> 1.0.0       
|   |-- <LuosHAL> 0.1.0
|-- <Gate> 0.7.0
|   |-- <Luos> 1.0.0
|   |   |-- <LuosHAL> 0.1.0
2 Likes

Yes indeed this failure is related to this topic Library dependancy doesn't download - #5 by nicolas_luos

On a completely different note the documentation is broken?

I’ll check out the other topic to

2 Likes

This link seems to be deprecated! Were did you find it?

prototyping boards.” in the front README page of your example repository: GitHub - Luos-io/Examples: Drivers, apps and projects examples with Luos

2 Likes

Thank you @maxgerhardt, we will fix that.

Thanks @maxgerhardt, broken links are fixed :slight_smile: