Black Magic Probe 'COM12: No such file or directory'

Hey guys, Ivan :love_you_gesture: :wink:

I have been successfully using PIO with stm32 via ST-Link v2.

However now I have the BMP, and I have set it in the platformio.ini, but it doesn’t work.

Any ideas? The detected port is correct (COM12).

I’m on Windows 10. I haven’t done any driver or firmware upgrades. COM11 is the UART part of the BMP and works correctly with putty / teraterm etc. So COM12 is correct for the debug side.

Notice the accidental quotation mark in ‘S"ection’ .text, after the COM12 error thing.

I’m going out now so can’t reply back for the afternoon but just wanted to ask the question while it was fresh in my mind. Thanks for the great tools again.

> Executing task: C:\Users\cmf\.platformio\penv\Scripts\platformio.exe run --target upload <

[04/21/18 12:30:26] Processing genericSTM32F103R8 (framework: arduino; platform: ststm32; board: genericSTM32F103R8)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: ST STM32 > STM32F103R8 (20k RAM. 64 Flash)
SYSTEM: STM32F103R8T6 128MHz 20KB RAM (64KB Flash)
DEBUG: CURRENT(blackmagic) EXTERNAL(blackmagic, jlink, stlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(light)
Collected 36 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SPI> v1.0
|-- <Adafruit_GFX_AS>
|   |-- <Adafruit GFX Library> v1.2.3
|   |   |-- <SPI> v1.0
|-- <Adafruit_ILI9341_STM>
|   |-- <SPI> v1.0
|   |-- <Adafruit_GFX_AS>
|   |   |-- <Adafruit GFX Library> v1.2.3
|   |   |   |-- <SPI> v1.0
Configuring upload protocol...
AVAILABLE: blackmagic, dfu, jlink, serial, stlink
CURRENT: upload_protocol = blackmagic
Looking for BlackMagic port...
Auto-detected: COM12
Uploading .pioenvs\genericSTM32F103R8\firmware.elf
COM12: No such file or directory.
S"ection .text, range 0x8000000 -- 0x8006d0c: matched.monitor" command not supported by this target.

Section .ARM.exidx, range 0x8006d10 -- 0x8006d18: matched.Don't know how to attach.  Try "help target".

Section .data, range 0x8006d18 -- 0x8007958: MIS-MATCHED!
You can't do that when your target is `exec'S
ection .rodata, range 0x8007958 -- 0x800865c: matched.
warning: One or more sections of the target image does not match
the loaded file


The program is not being run.
=============================================================================================== [SUCCESS] Took 2.73 seconds ===============================================================================================

Terminal will be reused by tasks, press any key to close it.

Hey! :wink:

  1. Please provide an output of pio device list command
  2. Try with pio run -t upload --upload-port "\\.\COM12"

pio device list:

PS C:\Users\cmf\Documents\PlatformIO\Projects\Test STM32> pio device list
COM11
-----
Hardware ID: USB VID:PID=1D50:6018 SER=6 LOCATION=1-1:x.2
Description: USB Serial Device (COM11)

COM12
-----
Hardware ID: USB VID:PID=1D50:6018 SER=6 LOCATION=1-1:x.0
Description: USB Serial Device (COM12)


PS C:\Users\cmf\Documents\PlatformIO\Projects\Test STM32>

pio run -t upload --upload-port “\.\COM12” seems to work :slight_smile:

PS C:\Users\cmf\Documents\PlatformIO\Projects\Test STM32> pio run -t upload --upload-port "\\.\COM12"
[04/21/18 21:07:00] Processing genericSTM32F103R8 (framework: arduino; platform: ststm32; board: genericSTM32F103R8)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: ST STM32 > STM32F103R8 (20k RAM. 64 Flash)
SYSTEM: STM32F103R8T6 128MHz 20KB RAM (64KB Flash)
DDEBUG: CURRENT(blackmagic) EXTERNAL(blackmagic, jlink, stlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(light)
Collected 36 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <Adafruit_GFX_AS>
|   |-- <Adafruit GFX Library> v1.2.3
|   |   |-- <SPI> v1.0
|-- <SPI> v1.0
|-- <Adafruit_ILI9341_STM>
|   |-- <Adafruit_GFX_AS>
|   |   |-- <Adafruit GFX Library> v1.2.3
|   |   |   |-- <SPI> v1.0
|   |-- <SPI> v1.0
Configuring upload protocol...
AVAILABLE: blackmagic, dfu, jlink, serial, stlink
CURRENT: upload_protocol = blackmagic
Looking for BlackMagic port...
Use manually specified: \\.\COM12
Uploading .pioenvs\genericSTM32F103R8\firmware.elf
Target voltage: 3.4V
Available Targets:
No. Att Driver
1      STM32F1 medium density
0x08004142 in delay(unsigned long) ()
Loading section .text, size 0x6d0c lma 0x8000000
Loading section .ARM.exidx, size 0x8 lma 0x8006d10
Loading section .ARM.exidx, size 0x8 lma 0x8006d10
Loading section .data, size 0xc40 lma 0x8006d18
Loading section .rodata, size 0xd04 lma 0x8007958
Start address 0x8002d14, load size 34392
TTransfer rate: 8 KB/sec, 905 bytes/write.
Section .text, range 0x8000000 -- 0x8006d0c: matched.
Section .ARM.exidx, range 0x8006d10 -- 0x8006d18: matched.
Section .data, range 0x8006d18 -- 0x8007958: matched.
Section .rodata, range 0x8007958 -- 0x800865c: matched.
Kill the program being debugged? (y or n) [answered Y; input not from terminal]
============================================================================================== [SUCCESS] Took 13.53 seconds ==============================================================================================
PS C:\Users\cmf\Documents\PlatformIO\Projects\Test STM32> 

but if I just try clicking the ‘Upload’ button at the bottom, I get the error again:

> Executing task: C:\Users\cmf\.platformio\penv\Scripts\platformio.exe run --target upload <

[04/21/18 21:08:28] Processing genericSTM32F103R8 (framework: arduino; platform: ststm32; board: genericSTM32F103R8)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: ST STM32 > STM32F103R8 (20k RAM. 64 Flash)
PLATFORM: ST STM32 > STM32F103R8 (20k RAM. 64 Flash)
SYSTEM: STM32F103R8T6 128MHz 20KB RAM (64KB Flash)
DEBUG: CURRENT(blackmagic) EXTERNAL(blackmagic, jlink, stlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(light)
Collected 36 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SPI> v1.0
|-- <Adafruit_GFX_AS>
|   |-- <Adafruit GFX Library> v1.2.3
|   |   |-- <SPI> v1.0
|-- <Adafruit_ILI9341_STM>
|   |-- <SPI> v1.0
|   |-- <Adafruit_GFX_AS>
|   |   |-- <Adafruit GFX Library> v1.2.3
|   |   |   |-- <SPI> v1.0
Configuring upload protocol...
AVAILABLE: blackmagic, dfu, jlink, serial, stlink
CURRENT: upload_protocol = blackmagic
Looking for BlackMagic port...
Auto-detected: COM12
Uploading .pioenvs\genericSTM32F103R8\firmware.elf
COM12: No such file or directory.
"monitor" command not supported by this target.S
ection .text, range 0x8000000 -- 0x8006d0c: matched.
Don't know how to attach.  Try "help target".Section .ARM.exidx, range 0x8006d10 -- 0x8006d18: matched.

YSou can't do that when your target is `exec'ection .data, range 0x8006d18 -- 0x8007958: MIS-MATCHED!

Swection .rodata, range 0x8007958 -- 0x800865c: matched.arning: One or more sections of the target image does not match

the loaded file

The program is not being run.
=============================================================================================== [SUCCESS] Took 2.81 seconds ===============================================================================================

Terminal will be reused by tasks, press any key to close it.

Please open PIO IDE Terminal and type pio upgrade --dev.

  • Does it work now?
  • Also, could you check debugging?

Fixed in

Yep! Fixed!

I should be able to check debugging in a day or two. It is something I wanted to do anyway… :slight_smile: