SPL with STM32VLDISCOVERY

Hi,
I’m trying to modify platformio files in order to use spl with my stm32vldiscovery board.

I updated the f100rb.json file to have spl under frameworks:
image

I checked that my spl package contains stm32f1 files
when i try to build the project i get an error:

Resolving disco_f100rb dependencies...
Already up-to-date.
Updating metadata for the vscode IDE...
UserSideException: Processing disco_f100rb (platform: ststm32; board: disco_f100rb; framework: spl)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/disco_f100rb.html
PLATFORM: ST STM32 (17.5.0) > ST STM32VLDISCOVERY
HARDWARE: STM32F100RBT6 24MHz, 8KB RAM, 128KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES: 
 - framework-spl @ 2.10202.0+sha.5c2d987 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
KeyError: "Invalid board option 'build.core'":
  File "/Users/amitgedj/.platformio/penv/lib/python3.10/site-packages/platformio/builder/main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "/Users/amitgedj/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 612:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/Users/amitgedj/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 279:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/Users/amitgedj/.platformio/platforms/ststm32/builder/main.py", line 120:
    target_elf = env.BuildProgram()
  File "/Users/amitgedj/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Util/envs.py", line 251:
    return self.method(*nargs, **kwargs)
  File "/Users/amitgedj/.platformio/penv/lib/python3.10/site-packages/platformio/builder/tools/piobuild.py", line 61:
    env.ProcessProgramDeps()
  File "/Users/amitgedj/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Util/envs.py", line 251:
    return self.method(*nargs, **kwargs)
  File "/Users/amitgedj/.platformio/penv/lib/python3.10/site-packages/platformio/builder/tools/piobuild.py", line 121:
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "/Users/amitgedj/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Util/envs.py", line 251:
    return self.method(*nargs, **kwargs)
  File "/Users/amitgedj/.platformio/penv/lib/python3.10/site-packages/platformio/builder/tools/piobuild.py", line 347:
    SConscript(env.GetFrameworkScript(name), exports="env")
  File "/Users/amitgedj/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 676:
    return method(*args, **kw)
  File "/Users/amitgedj/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 612:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/Users/amitgedj/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 279:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/Users/amitgedj/.platformio/platforms/ststm32/builder/frameworks/spl.py", line 78:
    join(FRAMEWORK_DIR, board.get("build.core"),
  File "/Users/amitgedj/.platformio/penv/lib/python3.10/site-packages/platformio/platform/board.py", line 47:
    raise KeyError("Invalid board option '%s'" % path)
========================== [FAILED] Took 0.21 seconds ==========================

anyone have any suggestion to solve this?
thanks

I solved this problem, apperantly the board json file didnt contained “core: stm32”
It fixed this problem and now it seems that my project can recognize the relevant packages.
my new problem is that it doesnt recognize built in functions like:
GPIO_InitTypeDef
EXTI_InitTypeDef

any suggestions?

Report this bug to https://github.com/platformio/platform-ststm32/issues/.

Did you include all needed headers for it, specifically stm32f10x_gpio.h? The demo code for L1, F3 and F3 series chips uses these structures just fine.

Hi, Thanks for the reply.
The GPIO got fixed by including stm32f10x_gpio.h.
i have NVIC_InitTypeDef that i didnt find it in any package.

I’m migrating from IAR, there wasnt any problem with using all those typdefs without including all the packages so I’m not sure what is missing…

Thanks

EXTI_InitTypeDef is defined in stm32f10x_exti.h.

NVIC_InitTypeDef is defiend in misc.h.

The header files should be somewhere in C:\Users\<user>\.platformio\packages\framework-spl-f1.

Thanks for the respond. I managed to find all the files I need.
My problem now seems to be an outdated board with st-link V1 and not V2 (which PIO support as for my understanding). my mac doesnt recognize the board at all and my win11 pc can’t update the st-link version.
After all that, I think i need to use another board…

Does https://www.st.com/en/development-tools/stm32cubeprog.html recognize the ST-Link and can connect to it?

The used OpenOCD version should still have support for ST-Link V1 with no changes. The stlink.cfg file handles all st-links, even v1.

on my mac it doesnt recognize the st-link.
on my win pc it does but says that st-linkV1 is not supported

What about the older tool https://www.st.com/en/development-tools/stsw-link004.html?

It does recognize the board and i was able to connect but cant update the st-link version.
PlatformIO still dont recognize the board

What’s the exact output of the Project Task “Advanced → Verbose Upload”? (Make sure to disconnect with ST-Link Utility first)

I closed ST-Link Utility and ran Verbose Upload, ended with an error:

main.c file is empty. PlatformIO dont recognize any com port for connecting to the board

Full output

CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/disco_f100rb.html
PLATFORM: ST STM32 (17.5.0) > ST STM32VLDISCOVERY
HARDWARE: STM32F100RB 24MHz, 8KB RAM, 128KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES: 
 - framework-spl @ 2.10202.0+sha.5c2d987 (git+https://github.com/maxgerhardt/pio-framework-spl-stm32.git) 
 - tool-dfuutil @ 1.11.0 
 - tool-dfuutil-arduino @ 1.11.0 
 - tool-openocd @ 3.1200.0 (12.0) 
 - tool-stm32duino @ 1.0.1 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 1 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
arm-none-eabi-gcc -o .pio/build/disco_f100rb/src/main.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60115 -DSTM32F100xB -DSTM32F10X_MD_VL -DSTM32F10X_MD_VL -DF_CPU=24000000L -DUSE_STDPERIPH_DRIVER -Iinclude -Isrc -I/Users/amitgedj/.platformio/packages/framework-spl/stm32/cmsis/cores/stm32 -I/Users/amitgedj/.platformio/packages/framework-spl/stm32/cmsis/variants/stm32f1 -I/Users/amitgedj/.platformio/packages/framework-spl/stm32/spl/variants/stm32f1/inc -I/Users/amitgedj/.platformio/packages/framework-spl/stm32/spl/variants/stm32f1/src src/main.c
arm-none-eabi-gcc -o .pio/build/disco_f100rb/firmware.elf -T /Users/amitgedj/.platformio/packages/framework-spl/platformio/ldscripts/STM32F100RB_FLASH.ld -Os -Wl,--gc-sections,--relax -mthumb -mcpu=cortex-m3 -nostartfiles .pio/build/disco_f100rb/src/main.o -L/Users/amitgedj/.platformio/platforms/ststm32/ldscripts -L.pio/build/disco_f100rb -Wl,--start-group -lc -lgcc -lm -lstdc++ .pio/build/disco_f100rb/libFrameworkCMSISVariant.a .pio/build/disco_f100rb/libFrameworkSPL.a -Wl,--end-group
.pio/build/disco_f100rb/libFrameworkCMSISVariant.a(startup_stm32f10x.o): In function `Reset_Handler':
startup_stm32f10x.c:(.text.Reset_Handler+0x1e): undefined reference to `main'
collect2: error: ld returned 1 exit status
*** [.pio/build/disco_f100rb/firmware.elf] Error 1

But that’s a compiler error, not an upload error at all. It says you have not defined a main() function (example). Where did you put your main code? What’s the content of src/main.c?

src/main.c was empty.

I updated the file to contain the main function to return 0 and received this output:

CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/disco_f100rb.html
PLATFORM: ST STM32 (17.5.0) > ST STM32VLDISCOVERY
HARDWARE: STM32F100RB 24MHz, 8KB RAM, 128KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES: 
 - framework-spl @ 2.10202.0+sha.5c2d987 (git+https://github.com/maxgerhardt/pio-framework-spl-stm32.git) 
 - tool-dfuutil @ 1.11.0 
 - tool-dfuutil-arduino @ 1.11.0 
 - tool-openocd @ 3.1200.0 (12.0) 
 - tool-stm32duino @ 1.0.1 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 1 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
arm-none-eabi-gcc -o .pio/build/disco_f100rb/src/main.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60115 -DSTM32F100xB -DSTM32F10X_MD_VL -DSTM32F10X_MD_VL -DF_CPU=24000000L -DUSE_STDPERIPH_DRIVER -Iinclude -Isrc -I/Users/amitgedj/.platformio/packages/framework-spl/stm32/cmsis/cores/stm32 -I/Users/amitgedj/.platformio/packages/framework-spl/stm32/cmsis/variants/stm32f1 -I/Users/amitgedj/.platformio/packages/framework-spl/stm32/spl/variants/stm32f1/inc -I/Users/amitgedj/.platformio/packages/framework-spl/stm32/spl/variants/stm32f1/src src/main.c
arm-none-eabi-gcc -o .pio/build/disco_f100rb/firmware.elf -T /Users/amitgedj/.platformio/packages/framework-spl/platformio/ldscripts/STM32F100RB_FLASH.ld -Os -Wl,--gc-sections,--relax -mthumb -mcpu=cortex-m3 -nostartfiles .pio/build/disco_f100rb/src/main.o -L/Users/amitgedj/.platformio/platforms/ststm32/ldscripts -L.pio/build/disco_f100rb -Wl,--start-group -lc -lgcc -lm -lstdc++ .pio/build/disco_f100rb/libFrameworkCMSISVariant.a .pio/build/disco_f100rb/libFrameworkSPL.a -Wl,--end-group
MethodWrapper(["checkprogsize"], [".pio/build/disco_f100rb/firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 0 bytes from 8192 bytes)
Flash: [          ]   0.6% (used 752 bytes from 131072 bytes)
.pio/build/disco_f100rb/firmware.elf  :
section           size        addr
.text              752   134217728
.data                0   536870912
.bss                 0   536870912
._usrstack         256   536870912
.comment           126           0
.ARM.attributes     51           0
Total             1185
<lambda>(["upload"], [".pio/build/disco_f100rb/firmware.elf"])
AVAILABLE: blackmagic, cmsis-dap, jlink, stlink
CURRENT: upload_protocol = stlink
openocd -d2 -s /Users/amitgedj/.platformio/packages/tool-openocd/openocd/scripts -f interface/stlink.cfg -c "transport select hla_swd" -f target/stm32f1x.cfg -c "program {.pio/build/disco_f100rb/firmware.elf}  verify reset; shutdown;"
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-17:03)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

*** [upload] Error 1
======================================================================================= [FAILED] Took 1.20 seconds =======================================================================================

This seems ot be running on Mac, but https://www.eevblog.com/forum/microcontrollers/stlink-firmware/?action=dlattach;attach=389805 says “ST-LINK (V1) boards are not supported on Linux and macOS operating systems”. Not sure if it doesn’t even register on the USB level or if there’s a drive issue or whatever. Other programs like stlink have dropped ST-Linkv1 support for Mac some time ago.

I would suggest you use Windows. A Windows VM inside Mac. Or connect an external ST-Linkv2 programmer to the board, disconnect the on-board ST-Linkv1.

Upgrading a ST-Link v1 to v2 requires non-trivial hardware modifications..

I saw that st-linkV1 are not supported on macOS anymore but I thought maybe it still work because of the outdated version on the board…

Thanks for the help.
i’ll try running it on windows pc and will update.

I tried running the same code on a windows device.
I downloaded first the stsw-link004 you suggested and was able to connect to the device.

after trying to do verbose upload i received this error:

CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/disco_f100rb.html
PLATFORM: ST STM32 (17.5.0) > ST STM32VLDISCOVERY
HARDWARE: STM32F100RBT6 24MHz, 8KB RAM, 128KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
 - framework-spl @ 2.10202.0+sha.5c2d987 (git+https://github.com/maxgerhardt/pio-framework-spl-stm32.git)
 - tool-dfuutil @ 1.11.0
 - tool-dfuutil-arduino @ 1.11.0
 - tool-openocd @ 3.1200.0 (12.0)
 - tool-stm32duino @ 1.0.2
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
Warning! Cannot find a linker script for the required board! Firmware will be linked with a default linker script!  
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
arm-none-eabi-gcc -o .pio\build\disco_f100rb\src\main.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60115 -DSTM32F1 -DSTM32F100xB -DF_CPU=24000000L -DUSE_STDPERIPH_DRIVER -Iinclude -Isrc -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\cores\stm32 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src src\main.c
arm-none-eabi-gcc -o .pio\build\disco_f100rb\FrameworkCMSISVariant\system_stm32f10x.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60115 -DSTM32F1 -DSTM32F100xB -DF_CPU=24000000L -DUSE_STDPERIPH_DRIVER -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\cores\stm32 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src C:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1\system_stm32f10x.c
arm-none-eabi-gcc -o .pio\build\disco_f100rb\FrameworkSPL\misc.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60115 -DSTM32F1 -DSTM32F100xB -DF_CPU=24000000L -DUSE_STDPERIPH_DRIVER -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\cores\stm32 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src\misc.c
arm-none-eabi-gcc -o .pio\build\disco_f100rb\FrameworkSPL\stm32f10x_adc.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60115 -DSTM32F1 -DSTM32F100xB -DF_CPU=24000000L -DUSE_STDPERIPH_DRIVER -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\cores\stm32 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc -IC:\UIn file included from src\main.c:1:0:
sersC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1/stm32f10x.h:95:3: error: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src C:\Users\25sha\.platformio\packages\framework-spl\stm32\s  #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
p   ^~~~l\variants\stm32f1\src\stm32~
fIn file included from C:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1\system_stm32f10x.c:64:0:
10xC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1\stm32f10x.h:95:3: error: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
_ad  #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"        
c.   ^~~~c~

arm-none-eabi-gcc -o .pio\build\disco_f100rb\FrameworkSPL\stm32f10x_bkp.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60115 -DSTM32F1 -DSTM32F100xB -DF_CPU=240000In file included from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc/stm32f10x_adc.h:31:0,
00L -DUSE_STDPERIPH_DRIVER -IC:\Users\25sha\.pla                 from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src\stm32f10x_adc.c:22:
tformio\packages\C:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1/stm32f10x.h:95:3: error: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"        
fr  #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
amework-spl\   ^~~~~
sIn file included from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc/misc.h:31:0,
tm32\cmsis                 from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src\misc.c:23:
\cores\C:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1/stm32f10x.h:95:3: error: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
stm  #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"        
32   ^~~~~
 -In file included from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc/stm32f10x_bkp.h:31:0,
IC:                 from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src\stm32f10x_bkp.c:22:
\UseC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1/stm32f10x.h:95:3: error: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
rs\25sh  #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"    
a\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1 -IC:\Users\25sha\.platformio\pac   ^~~~~k
agIn file included from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc/stm32f10x_cec.h:31:0,
es\f                 from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src\stm32f10x_cec.c:22:
raC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1/stm32f10x.h:95:3: error: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
mew  #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"        
ork   ^~~~-s~p
l*** [.pio\build\disco_f100rb\src\main.o] Error 1
\st*** [.pio\build\disco_f100rb\FrameworkCMSISVariant\system_stm32f10x.o] Error 1
m32In file included from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc/stm32f10x_crc.h:31:0,
\spl\                 from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src\stm32f10x_crc.c:22:
varC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1/stm32f10x.h:95:3: error: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
iant  #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"       
s\stm   ^~~~3~2f1
\i*** [.pio\build\disco_f100rb\FrameworkSPL\stm32f10x_adc.o] Error 1
nc In file included from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc/stm32f10x_can.h:31:0,
-IC                 from C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src\stm32f10x_can.c:22:
:\UC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1/stm32f10x.h:95:3: error: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
ser  #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"        
s\   ^~~~2~
5s*** [.pio\build\disco_f100rb\FrameworkSPL\misc.o] Error 1
ha\*** [.pio\build\disco_f100rb\FrameworkSPL\stm32f10x_bkp.o] Error 1
.pl*** [.pio\build\disco_f100rb\FrameworkSPL\stm32f10x_cec.o] Error 1
atf*** [.pio\build\disco_f100rb\FrameworkSPL\stm32f10x_crc.o] Error 1
ormio\packages\framework-spl\stm32\spl\variants\stm32f1\src C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src\stm32f10x_bkp.c
arm-none-eabi-gcc -o .pio\build\disco_f100rb\FrameworkSPL\stm32f10x_can.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60115 -DSTM32F1 -DSTM32F100xB -DF_CPU=24000000L -DUSE_STDPERIPH_DRIVER -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\cores\stm32 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\*** [.pio\build\disco_f100rb\FrameworkSPL\stm32f10x_can.o] Error 1
src\stm32f10x_can.c
arm-none-eabi-gcc -o .pio\build\disco_f100rb\FrameworkSPL\stm32f10x_cec.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60115 -DSTM32F1 -DSTM32F100xB -DF_CPU=24000000L -DUSE_STDPERIPH_DRIVER -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\cores\stm32 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src\stm32f10x_cec.c
arm-none-eabi-gcc -o .pio\build\disco_f100rb\FrameworkSPL\stm32f10x_crc.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60115 -DSTM32F1 -DSTM32F100xB -DF_CPU=24000000L -DUSE_STDPERIPH_DRIVER -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\cores\stm32 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\cmsis\variants\stm32f1 -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\inc -IC:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src C:\Users\25sha\.platformio\packages\framework-spl\stm32\spl\variants\stm32f1\src\stm32f10x_crc.c
============================================ [FAILED] Took 1.77 seconds ============================================

It seems that PlatformIO couldnt find the board connected to the pc…
my pc recognized the board as a disk drive and nothing else…
image

any suggestion?

Did you use the exact same f100rb.json file? This looks to me as if it’s missing a -D macro definition in “extra_flags”.

This code checks if the riught STM32F10X_XXX macro was activated

#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL) 
  /* #define STM32F10X_LD */     /*!< STM32F10X_LD: STM32 Low density devices */
  /* #define STM32F10X_LD_VL */  /*!< STM32F10X_LD_VL: STM32 Low density Value Line devices */
  /* #define STM32F10X_MD */     /*!< STM32F10X_MD: STM32 Medium density devices */
  /* #define STM32F10X_MD_VL */  /*!< STM32F10X_MD_VL: STM32 Medium density Value Line devices */
  /* #define STM32F10X_HD */     /*!< STM32F10X_HD: STM32 High density devices */
  /* #define STM32F10X_HD_VL */  /*!< STM32F10X_HD_VL: STM32 High density value line devices */
  /* #define STM32F10X_XL */     /*!< STM32F10X_XL: STM32 XL-density devices */
  /* #define STM32F10X_CL */     /*!< STM32F10X_CL: STM32 Connectivity line devices */
#endif
/*  Tip: To avoid modifying this file each time you need to switch between these
        devices, you can define the device in your toolchain compiler preprocessor.

 - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
   where the Flash memory density ranges between 16 and 32 Kbytes.
 - Low-density value line devices are STM32F100xx microcontrollers where the Flash
   memory density ranges between 16 and 32 Kbytes.
 - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
   where the Flash memory density ranges between 64 and 128 Kbytes.
 - Medium-density value line devices are STM32F100xx microcontrollers where the 
   Flash memory density ranges between 64 and 128 Kbytes.   
 - High-density devices are STM32F101xx and STM32F103xx microcontrollers where
   the Flash memory density ranges between 256 and 512 Kbytes.
 - High-density value line devices are STM32F100xx microcontrollers where the 
   Flash memory density ranges between 256 and 512 Kbytes.   
 - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where
   the Flash memory density ranges between 512 and 1024 Kbytes.
 - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.
  */

#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL)
 #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
#endif

So for a STM32F100xx with 128K flash this should be -DSTM32F10X_MD

You could also add

build_flags = 
   -DSTM32F10X_MD

into the platformio.ini.

I used the same disco_f100rc.json file.
i added to the platform.ini file-

build_flags = -DSTM32F10X_MD_VL

tried with build_flags = -DSTM32F10X_MD too

now theres a different error. not wure if things going

Processing disco_f100rb (platform: ststm32; board: disco_f100rb; framework: spl; build_flags: -DSTM32F10X_MD_VL)
--------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/disco_f100rb.html
PLATFORM: ST STM32 (17.5.0) > ST STM32VLDISCOVERY
HARDWARE: STM32F100RBT6 24MHz, 8KB RAM, 128KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
 - framework-spl @ 2.10202.0+sha.5c2d987 (git+https://github.com/maxgerhardt/pio-framework-spl-stm32.git)
 - tool-dfuutil @ 1.11.0
 - tool-dfuutil-arduino @ 1.11.0
 - tool-openocd @ 3.1200.0 (12.0)
 - tool-stm32duino @ 1.0.2
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
Warning! Cannot find a linker script for the required board! Firmware will be linked with a default linker script!        
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
MethodWrapper(["checkprogsize"], [".pio\build\disco_f100rb\firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 0 bytes from 8192 bytes)
Flash: [          ]   0.2% (used 284 bytes from 131072 bytes)
.pio\build\disco_f100rb\firmware.elf  :

section             size        addr

.isr_vector          484   134217728

.text                284   134218212

.rodata                0   134218496

.data                  0   536870912

.bss                   0   536870912

._user_heap_stack   1536   536870912

.ARM.attributes       49           0

.comment             126           0

Total               2479
<lambda>(["upload"], [".pio\build\disco_f100rb\firmware.elf"])
AVAILABLE: blackmagic, cmsis-dap, jlink, stlink
CURRENT: upload_protocol = stlink
openocd -d2 -s C:\Users\25sha\.platformio\packages\tool-openocd/openocd/scripts -f interface/stlink.cfg -c "transport select hla_swd" -f target/stm32f1x.cfg -c "program {.pio\build\disco_f100rb\firmware.elf}  verify reset; shutdown;"
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD     
Info : clock speed 1000 kHz
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Error: open failed
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

*** [upload] Error 1
=============================================== [FAILED] Took 1.39 seconds ===============================================

It looks to me as the same error from before on my mac