platformio / platform-ststm32

ST STM32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm32
Apache License 2.0
397 stars 310 forks source link

Board support request: NUCLEO-WL55JCx #543

Closed gbThreepwood closed 3 years ago

gbThreepwood commented 3 years ago

The board comes in two versions NUCLEO-WL55JC1, and NUCLEO-WL55JC2, where the differences is what frequency they support for the radio: https://www.st.com/en/evaluation-tools/nucleo-wl55jc.html

The board is already supported by Mbed (https://os.mbed.com/platforms/ST-Nucleo-WL55JC/), and Zephyr (https://docs.zephyrproject.org/latest/boards/arm/nucleo_wl55jc/doc/nucleo_wl55jc.html).

I have access to both versions of the board. I have managed to get them working in PlatformIO with the Mbed framework, by adding a custom "board.json" file to my boards directory.

Status:

{
  "build": {
    "core": "stm32",
    "cpu": "cortex-m4",
    "extra_flags": "-DSTM32WL55JC1",
    "f_cpu": "48000000L",
    "mcu": "stm32wl55jc",
    "product_line": "STM32WL55xx",
    "variant": "STM32WL55JCx/WL55JC(1-2)"
  },
  "debug": {
    "default_tools": [
      "stlink"
    ],
    "jlink_device": "STM32WL55JC",
    "onboard_tools": [
      "stlink"
    ],
    "openocd_target": "stm32wlx",
    "svd_path": "STM32F411xx.svd"
  },
  "frameworks": [
    "arduino",
    "cmsis",
    "mbed",
    "stm32cube",
    "libopencm3",
    "zephyr"
  ],
  "name": "ST Nucleo WL55JC",
  "upload": {
    "maximum_ram_size": 65536,
    "maximum_size": 262144,
    "protocol": "stlink",
    "protocols": [
      "jlink",
      "cmsis-dap",
      "stlink",
      "blackmagic",
      "mbed"
    ]
  },
  "url": "https://www.st.com/en/evaluation-tools/nucleo-wl55jc.html",
  "vendor": "ST"
}

I'd be happy to create a pull request as soon as I have figured out how to resolve the remaining issues.

Is there anything else that should be updated while adding a new board? Do I create a separate pull request for updating the documentation?

gbThreepwood commented 3 years ago

I found two files "STM32WL5x_CM4.svd", and "STM32WL5x_CM0P.svd" in the installation directory for STM32CubeIDE. The files describes the registers of the M4 CPU, and the M0 CPU respectively.

The files are also available here: https://github.com/fullyautomated/st-svd

The files are under the Apache-2.0 license, thus I suppose it should be no problem to add them to the PlatformIO distribution (/platforms/ststm32/misc/svd)

gbThreepwood commented 3 years ago

After including the "STM32WL5x_CM4.svd" file, direct manipulation of the peripheral registers appears to be working fine.

gudnimg commented 3 years ago

You can find the SVD files here: https://www.keil.com/dd2/pack/ I recently updated all the files (https://github.com/platformio/platform-ststm32/pull/514) but I seem to have forgotten to add the WL series.

gbThreepwood commented 3 years ago

Thanks. I managed to find the files after going through the hassle of installing STM32Cube, but I will bookmark your link for future reference.

I have created a pull request (#544) for the json config, and related SVD file. It works on my machine, but as this is my first contribution to PlatformIO, it could be that I have overlooked something.

gbThreepwood commented 3 years ago

Creating new Mbed projects are not working anymore. The projects created yesterday are still functional, but I can not create new ones.

For some reason the STM32WL55 board appears under the platform "atmel avr" in addition to "ST STM32" in the list of boards in the project wizard. Adding the line "platforms": ["ststm32"], to the nucleo_wl55jc.json file solves that issue, but creation of new project is still broken.

gbThreepwood commented 3 years ago

Creating new Mbed projects are not working anymore. The projects created yesterday are still functional, but I can not create new ones.

Looks like the problem is not related to the new board, please ignore. It was only occurring when I choose to save the project outside the default location using a relatively long path for the project root. Strangely though it is not occurring anymore.