How to use STM32WL55JC under STM32Cube framework

Hi there,
Rather new here, could really use some help for using STM32WL55JC under STM32Cube framework.

I notice that within board setting: nucleo_wl55jc.json

  "frameworks": [
    "arduino",
    "zephyr"
  ],

Framework STM32Cube is not offered, which is confirmed by the list of support package of STM32Cube
But from the ST’s GitHub, STM32CubeWL’s package is provided.
So, I cloned it to [.platformio/packages] and rename to framework-stm32cubewl
also modified a custom board from nucleo_wl55jc.json

  "frameworks": [
    "arduino",
    "stm32cube",
    "zephyr"
  ],

and platformio.ini

[env:custom_wl55jc]
platform = ststm32
board = custom_wl55jc
framework = stm32cube

It’s promting error

Resolving custom_wl55jc dependencies...
Error: Traceback (most recent call last):
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\platformio\__main__.py", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\platformio\cli.py", line 71, in invoke
    return super().invoke(ctx)
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\platformio\project\commands\init.py", line 94, in project_init_cmd
    install_project_dependencies(
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\platformio\package\commands\install.py", line 106, in install_project_dependencies
    already_up_to_date = not install_project_env_dependencies(env, options)
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\platformio\package\commands\install.py", line 131, in install_project_env_dependencies
    _install_project_env_platform(project_env, options),
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\platformio\package\commands\install.py", line 148, in _install_project_env_platform
    PlatformPackageManager().install(
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\platformio\package\manager\platform.py", line 60, in install
    p.configure_project_packages(project_env, project_targets)
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\platformio\platform\base.py", line 184, in configure_project_packages
    self.configure_default_packages(options, targets or [])
  File "C:\OOO\XXX\.platformio\platforms\ststm32\platform.py", line 110, in configure_default_packages
    return PlatformBase.configure_default_packages(self, variables,
  File "C:\OOO\XXX\.platformio\penv\lib\site-packages\platformio\platform\base.py", line 196, in configure_default_packages
    self.packages[_pkg_name]["optional"] = False
KeyError: 'framework-stm32cubewl'

What did I miss?

Thanks in advance

That base package is missing in the PlatformIO registry (basically PIO packaged version of https://github.com/STMicroelectronics/STM32CubeWL), that’s an issue in PlatformIO, similiar to Adding STM32CubeWB package to platformIO registry · Issue #686 · platformio/platform-ststm32 · GitHub but not yet tracked.

You could manually add that into platofrm-ststm32 by locally modifying ~/.platformio/platforms/ststm32/platform.json by adding the package to the list of packages

so e.g.

    "framework-stm32cubewl": {
      "type": "framework",
      "optional": true,
      "owner": "platformio",
      "version": "symlink://C:/Users/user/Desktop/stm32cubwl"
    },

where the path is pointing to a downloaded version of the STM32CubeWL repo with added package.json of for example

{
  "description": "STM32Cube is a set of tools and embedded software bricks available free of charge to enable fast and easy development on the STM32 platform (STM32CubeWL MCU Firmware Package)",
  "keywords": [
    "framework",
    "hal",
    "stm32",
    "st"
  ],
  "name": "framework-stm32cubewl",
  "version": "1.26.2",
  "homepage": "https://github.com/STMicroelectronics/STM32CubeWL"
}
1 Like

This is it!

After follwoing the suggestion adding
a entry for framework-stm32cubewl in platform.json and
a package.json under the cloned repo works!

Thanks alot!!!

Great! I’ve tracked the missing STM32CubeWL support issue in

2 Likes

Hi, just tried to add the stm32cubewl framework manually and got the error:

Resolving nucleo_wl55jc dependencies...
Already up-to-date.
Updating metadata for the vscode IDE...
UserSideException: Processing nucleo_wl55jc (platform: ststm32; board: nucleo_wl55jc; framework: stm32cube)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_wl55jc.html
PLATFORM: ST STM32 (17.0.0) > ST Nucleo WL55JC
HARDWARE: STM32WL55JC 48MHz, 64KB RAM, 256KB Flash
DEBUG: Current (stlink) On-board (stlink) External (cmsis-dap, jlink)
PACKAGES: 
 - framework-stm32cubewl @ 1.3.0 
 - tool-ldscripts-ststm32 @ 0.2.0 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
Error: Cannot find peripheral template file to configure framework!
========================== [FAILED] Took 0.72 seconds ==========================

What did I do wrong?

That would mean that the stm32wlxx_hal_conf_template.h or stm32wlxx_hal_conf.h was not found. This file is present in the driver submodule. Are you sure you’ve cloned the https://github.com/STMicroelectronics/STM32CubeWL repo recursively? (git clone --recursive)

1 Like

It’s working, thx @maxgerhardt