Yes, that should work.
You said the Photon, so does this mean you are trying it on the gateway shield? It could reset the Photon as the reset lines are tied together. It may be best to try this without the Puoton in the shield.
If the command still doesn’t work, you can ensure the connections are proper. How are you adapting the 20-pins of the STLink to the 10-pin header on the gateway shield?
Also, what OS are you using? Windows? Linux? Mac? The drivers may not all be working, did you get OpenOCD installed properly?