Atmel SWD. Enabling normal GPIO function on the SWO pin
I kinda forgot i posted this question here, but in the meantime I found the answer on some other site that I can't find right now.

You can disable the SWO functionality simply through this code:

#include &lt;core_cm4.h&gt;
void disableSWO(void)
{
    CoreDebug_Type *core = CoreDebug_BASE;
    core-&gt;DEMCR = (0&lt;&lt;CoreDebug_DEMCR_TRCENA_Pos);
}


Just call disableSWO() and SWO pin is disabled. I could debug while still keeping the SPI working.