Dear Maximilian:
Yesterday, I tried to buy an original STlink/V2 bundle from Mouser, Digikey, Newark, Arrow, Allied and a couple more distributors. Nobody has stock. This is the reason I am bothering you and asking for help because in this way I am forced me to use these Chinese fake products. I am sorry for that.
From your last suggestions, please be patient with these long texts:
Option debug_tool = custom
…throws an error on the Debug console:
Reading symbols from d:\DATA\Carpetas\PlatformIO-Work\NEW_TIM2_CH1_PWM.pio\build\bluepill_f103c8\firmware.elf…
done.
PlatformIO Unified Debugger → Redirecting...
PlatformIO: debug_tool = custom
PlatformIO: Initializing remote target…
.pioinit:13: Error in sourced command file:
=================================
Now, again returning to with option:
debug_tool = stlink, the platformio.ini contains the following.
I had to correct the paths in order to point to the files such as stlink.cfg
In my PC, your original suggested paths didn’t work.
This option, also fails.
[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
framework = stm32cube
upload_protocol = stlink
debug_tool = stlink
debug_server = c:\Users\Bob\.platformio\packages\tool-openocd\bin\openocd.exe-s
c:\Users\Bob\.platformio\packages\tool-openocd\openocd\scripts\interface
-f interface\stlink.cfg
-c "transport select hla_swd"
-c "set CPUTAPID 0x2ba01477"
-f target\stm32f1x.cfg
-c "reset_config none"
===============================
This is what the console shows. Also I attach a picture of what the platformio.ini errors are.
Maybe you can detect something here. I am starting with STM32 chips AND with PlatformIO at the same time. I can’t offer any experience nor wise assumptions here.
Executing task: C:\Users\Bob.platformio\penv\Scripts\platformio.exe run
InvalidProjectConfError: Invalid 'D:\DATA\Carpetas\PlatformIO-Work\NEW_TIM2_CH1_PWM\platformio.ini' (project configuration file): 'Source contains parsing errors: 'D:\\DATA\\Carpetas\\PlatformIO-Work\\NEW_TIM2_CH1_PWM\\platformio.ini'
[line 20]: '-f interface\\stlink.cfg\n'
[line 21]: '-c "transport select hla_swd"\n'
[line 22]: '-c "set CPUTAPID 0x2ba01477"\n'
[line 23]: '-f target\\stm32f1x.cfg\n'
[line 24]: '-c "reset_config none"\n''
Traceback (most recent call last):
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\project\config.py", line 99, in read
self._parser.read(path, "utf-8")
File "C:\Users\Bob\.platformio\python3\Lib\configparser.py", line 713, in read
self._read(fp, filename)
File "C:\Users\Bob\.platformio\python3\Lib\configparser.py", line 1132, in _read
raise e
configparser.ParsingError: Source contains parsing errors: 'D:\\DATA\\Carpetas\\PlatformIO-Work\\NEW_TIM2_CH1_PWM\\platformio.ini'
[line 20]: '-f interface\\stlink.cfg\n'
[line 21]: '-c "transport select hla_swd"\n'
[line 22]: '-c "set CPUTAPID 0x2ba01477"\n'
[line 23]: '-f target\\stm32f1x.cfg\n'
[line 24]: '-c "reset_config none"\n'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\Bob\.platformio\penv\Scripts\platformio.exe\__main__.py", line 7, in <module>
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\__main__.py", line 134, in main
maintenance.on_platformio_exit()
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\maintenance.py", line 65, in on_platformio_exit
telemetry.on_exit()
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\telemetry.py", line 177, in on_exit
TelemetryLogger().send()
^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\util.py", line 132, in get_instance
_instances[cls] = cls(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\telemetry.py", line 78, in __init__
self._http_session = HTTPSession()
^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\http.py", line 52, in __init__
self.headers.update({"User-Agent": app.get_user_agent()})
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\app.py", line 277, in get_user_agent
if not get_setting("enable_telemetry"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\app.py", line 208, in get_setting
with State() as state:
^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\app.py", line 88, in __init__
self.path = resolve_state_path("core_dir", "appstate.json")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\app.py", line 77, in resolve_state_path
state_dir = ProjectConfig.get_instance().get("platformio", conf_option_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\project\config.py", line 489, in get_instance
instance = {"mtime": mtime, "config": ProjectConfig(path)}
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\project\config.py", line 87, in __init__
self.read(path, parse_extra)
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\project\config.py", line 101, in read
raise exception.InvalidProjectConfError(path, str(exc)) from exc
platformio.project.exception.InvalidProjectConfError: Invalid 'D:\DATA\Carpetas\PlatformIO-Work\NEW_TIM2_CH1_PWM\platformio.ini' (project configuration file): 'Source contains parsing errors: 'D:\\DATA\\Carpetas\\PlatformIO-Work\\NEW_TIM2_CH1_PWM\\platformio.ini'
[line 20]: '-f interface\\stlink.cfg\n'
[line 21]: '-c "transport select hla_swd"\n'
[line 22]: '-c "set CPUTAPID 0x2ba01477"\n'
[line 23]: '-f target\\stm32f1x.cfg\n'
[line 24]: '-c "reset_config none"\n''
Exception ignored in atexit callback: <function _finalize at 0x0000025B4FC66F20>
Traceback (most recent call last):
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\telemetry.py", line 313, in _finalize
telemetry = TelemetryLogger()
^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\util.py", line 132, in get_instance
_instances[cls] = cls(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\telemetry.py", line 78, in __init__
self._http_session = HTTPSession()
^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\http.py", line 52, in __init__
self.headers.update({"User-Agent": app.get_user_agent()})
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\app.py", line 277, in get_user_agent
if not get_setting("enable_telemetry"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\app.py", line 208, in get_setting
with State() as state:
^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\app.py", line 88, in __init__
self.path = resolve_state_path("core_dir", "appstate.json")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\app.py", line 77, in resolve_state_path
state_dir = ProjectConfig.get_instance().get("platformio", conf_option_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\project\config.py", line 489, in get_instance
instance = {"mtime": mtime, "config": ProjectConfig(path)}
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\project\config.py", line 87, in __init__
self.read(path, parse_extra)
File "C:\Users\Bob\.platformio\penv\Lib\site-packages\platformio\project\config.py", line 101, in read
raise exception.InvalidProjectConfError(path, str(exc)) from exc
platformio.project.exception.InvalidProjectConfError: Invalid 'D:\DATA\Carpetas\PlatformIO-Work\NEW_TIM2_CH1_PWM\platformio.ini' (project configuration file): 'Source contains parsing errors: 'D:\\DATA\\Carpetas\\PlatformIO-Work\\NEW_TIM2_CH1_PWM\\platformio.ini'
[line 20]: '-f interface\\stlink.cfg\n'
[line 21]: '-c "transport select hla_swd"\n'
[line 22]: '-c "set CPUTAPID 0x2ba01477"\n'
[line 23]: '-f target\\stm32f1x.cfg\n'
[line 24]: '-c "reset_config none"\n''
* The terminal process "C:\Users\Bob\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.