Hi there,
I’ve got a custom made board with a STM32F100C8T on it and want to use it together with PlatformIO.
I want to program it with the Arduino Framework and want/must use my ST-LINK V2 for programming/debugging.
So I guess the challenge is similar to STM32F100RET support, still I haven’t been successful, yet.
As the STM32F100C8 has no board definition in PlatformIO yet, but it is supported in STM32duino (2.2.0), I created a custom one by copypasting from various sources:
{
"build": {
"core": "stm32",
"cpu": "cortex-m3",
"extra_flags": "-DSTM32F100xB -DSTM32F1",
"f_cpu": "24000000L",
"mcu": "stm32f100c8t",
"product_line": "STM32F100xB",
"variant": "STM32F1xx/F100C(8-B)T"
},
"connectivity": [
],
"debug": {
"jlink_device": "STM32F100C8",
"openocd_target": "stm32f1x",
"svd_path": "STM32F100x.svd"
},
"frameworks": [
"stm32cube",
"arduino"
],
"name": "STM32F100C8 (20k RAM. 64k Flash)",
"upload": {
"disable_flushing": false,
"maximum_ram_size": 20480,
"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/stm32f100c8.html",
"vendor": "ST"
}
platformio.ini looks like this:
[env:genericSTM32F100C8]
platform = ststm32
board = genericSTM32F100C8
framework = arduino
Blink example compiles and flashes with OpenOCD, but obviously, it doesn’t run (I tried various Pin settings to rule out that I am stimulating the wrong GPIO).
When trying to debug, it seems that the processor does not even boot up correctly (never reaches setup() method of the blink example) and gets stuck in an “Infinite Loop” routine.
I don’t have injected any custom clock setup code, so I assume it just uses the STM32duino setup, which is (8/4)*6=24 MHz internal clock.
Do you have any hints? Sorry if I am missing something obvious, but I am stuck a this point
Hint: When programming with STM32Cube IDE, programming, debugging and running hardware works as expected, so I guess a hardware problem can be ruled out.
Thanks a lot!