Pure STM32F103CBT6 upload

Using pio 4.1.0

upload_method = stlink

Target programmed successfully, but last command executed is “shutdown command invoked”, after that no running application before full power shutdown and reconnect. Its unhandy.

How can I remove shutdown and appear to run application after swd flash?

This is quite unusual. In all STM32 programming I’ve done so far, the application started immediately after upload via stlink.

What hardware (board and ST-Link probe) do you have? Can you share your code?

There is no “unusual” code.
One STM32F103CBT6 MCU extruded from Bluepill board (China’s parts);
One ST_LINK (green “usb flash”, standalone, no problem with “standard” bluepill at STLINK or DFU mode)
One BLINK demonstration sketch (code contents no matters. “Shutdown command invoked” --> “I wont work without DC reconnection”)

Third week stuck…

What do you mean by “STM32F103CBT6 MCU extruded from Bluepill board”? Is it custom hardware? If so, please provide a schematic. It’s relevant how the BOOT0 and BOOT1 pins are connected.

And regarding your code, it would be helpful to know if you are using the Android framework, CubeMX etc. The more information you provide, the more likely you are to receive a helpful answer.

BOOT0 -> R100K -> GND
BOOT1 is floating (no need to use it)
Schematic is too big to place it here, maybe simple pieces can be suitable?
Framework Arduino
Code is simple:

setup -> pinMode(LED_BUILTIN, OUTPUT);
loop -> digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); delay(1000);

The only difference between a working and a non-working setup seems to be the hardware. And as you are using a custom hardware, my guess is that the problem is related to your hardware.

The “shutdown command” you mentioned initially is the OpenOCD command to shutdown OpenOCD (and not the MCU). So it will no help your case to pursue it.

It’s probaly best to check and compare all differences between a BluePill and your hardware, in particular BOOTx, RESET and possibly even SWIO and SWCLK pins.