Similarly, there is another another TMS sequence to switch back from SWD to JTAG protocol.
The default protocol at power-up is JTAG, so if you want to use Serial Wire, you need to use the TCK and TMS pins to scan in a special 'key', which is a sequence of TMS values which has no effect for a pure JTAG TAP but is recognized by a SWJ-DP TAP as a request to switch into Serial Wire mode.