STM32F100R8T6B support

is it possible to use the stm32f100r8t6b with platformio

platform-ststm32/boards at develop · platformio/platform-ststm32 · GitHub doesn’t have a board definition for it, so you’d have to create one. E:g., to use the board with the Arduino framework, which is supported through here), you could first create an abitrary project (e.g. Uno + Arduino), then create a boards/ folder in the project with genericSTM32F100R8T6.json

{
    "build": {
      "core": "stm32",
      "cpu": "cortex-m3",
      "extra_flags": "-DSTM32F100xB -DSTM32F1",
      "f_cpu": "24000000L",
      "hwids": [
        [
          "0x1EAF",
          "0x0003"
        ],
        [
          "0x1EAF",
          "0x0004"
        ]
      ],
      "mcu": "stm32f100r8t6",
      "product_line": "STM32F100x8",
      "variant": "STM32F1xx/F100R(8-B)T"
    },
    "debug": {
      "jlink_device": "STM32F100R8",
      "openocd_target": "stm32f1x",
      "svd_path": "STM32F100xx.svd"
    },
    "frameworks": [
      "arduino",
      "cmsis",
      "libopencm3",
      "stm32cube"
    ],
    "name": "STM32F100R8 (8k RAM. 64 Flash)",
    "upload": {
      "disable_flushing": false,
      "maximum_ram_size": 8192,
      "maximum_size": 65536,
      "protocol": "stlink",
      "protocols": [
        "jlink",
        "cmsis-dap",
        "stlink",
        "blackmagic",
        "serial",
        "dfu"
      ],
      "require_upload_port": true,
      "use_1200bps_touch": false,
      "wait_for_upload_port": false
    },
    "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f100r8.html",
    "vendor": "Generic"
  }

And then change the platformio.ini to

[env:genericSTM32F100R8T6]
platform = ststm32
board = genericSTM32F100R8T6
framework = arduino

and an empty sketch of src/main.cpp

#include <Arduino.h>

void setup() {}
void loop() {}

should compile normally.

Linking .pio\build\genericSTM32F100R8T6\firmware.elf
Checking size .pio\build\genericSTM32F100R8T6\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   9.8% (used 800 bytes from 8192 bytes)
Flash: [=         ]  10.6% (used 6940 bytes from 65536 bytes)
Building .pio\build\genericSTM32F100R8T6\firmware.bin

thankyou,
i cant test it now because i dont have my stlink on me but i will test it

i used an nucleo as stlink (it worked with stm32cubeprogrammer) it didnt upload succesfully:

RAM: [= ] 9.6% (used 784 bytes from 8192 bytes)
Flash: [== ] 15.2% (used 9992 bytes from 65536 bytes)
Configuring upload protocol…
AVAILABLE: blackmagic, cmsis-dap, dfu, jlink, serial, stlink
CURRENT: upload_protocol = stlink
Uploading .pio/build/genericSTM32F100R8T6/firmware.elf
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:15)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
debug_level: 1

hla_swd
Warn : UNEXPECTED idcode: 0x2ba01477
Error: expected 1 of 1: 0x1ba01477
in procedure ‘program’
** OpenOCD init failed **
shutdown command invoked

*** [upload] Error 1

That’s expected when you have a fake chip. Instead of a genuine ST microelectronics chips someone put a chinese clone chip on there. You need to add a config line to override the expected ID code of the chip to the fake one per

thats not neccesary i identified the issue: i set a jumper on the nucleo wrong but now it works (it is a genuine chip, with the arm and st logo)

Hm, never seen that one before. Usually such an IDCODE identifies a fake chip.

Great that it’s working now.

what usart port does platformio use as the normal Serial on the stm32f100r8t6b

The Arduino core controls this aspect, not PlatformIO itself.

ok thnkyou so it is using USART2 right?

Yes exactly that’s the case.