The platformio documentation says this about the upload_protocol "Override default Development Platforms upload command with a custom command. You can pass a full upload command with arguments and options or mix with upload_flags."
Using VSC v1.61.0 and PIO IDE v2.3.3 under MacOS v11.6 (Intel) it seems that upload_flags is ignored when upload_protocol = custom is specified in the platformio.ini file:
The platformio documentation says this about the upload_protocol "Override default Development Platforms upload command with a custom command. You can pass a full upload command with arguments and options or mix with upload_flags."
Using VSC v1.61.0 and PIO IDE v2.3.3 under MacOS v11.6 (Intel) it seems that upload_flags is ignored when upload_protocol = custom is specified in the platformio.ini file:
[env:pico] build_type = release platform = raspberrypi board = pico framework = arduino monitor_speed = 115200 build_flags = -DPICOPROBE upload_protocol = custom upload_command = /Users/Simon/MyPico/openocd/src/openocd upload_flags = -s/Users/Simon/MyPico/openocd/tcl -f/interface/picoprobe.cfg -f/target/rp2040.cfg -c"program $PROG_PATH verify reset exit"
In order to have the desired effect, the command and flags must be specified for the upload_command alone.