{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "build",
            "type": "shell",
            "command": "make -j4",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "taskName": "flash",
            "type": "shell",
            "command": "make flash",
            "problemMatcher": []
        },
        {
            "taskName": "openocd",
            "type": "shell",
            "command": "openocd -f \"interface/stlink-v2.cfg\" -f \"target/stm32f4x_stlink.cfg\" -c \"gdb_port pipe; log_output openocd.log\"",
            "problemMatcher": []
        }
    ]
}
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "build",
            "type": "shell",
            "command": "make -j4",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "taskName": "flash",
            "type": "shell",
            "command": "make flash",
            "problemMatcher": []
        },
        {
            "taskName": "openocd",
            "type": "shell",
            "command": "openocd -f \"interface/stlink-v2.cfg\" -f \"target/stm32f4x_stlink.cfg\" -c \"gdb_port 3333; log_output openocd.log\"",
            "problemMatcher": []
        }
    ]
}

Change openocd task to use localhost:3333
Change openocd task to use localhost:3333