Output Oscillator to GPIO on grand central

I’m trying to output the external 32K oscillator to a GPIO on the board, I manged to find few similar examples, but none seemed to work.
This is the last code that I tried and was expecting to see the clock on the PA17 GPIO.
I’m using Platform-IO for coding and compiling.
Any input would be great

#include <Arduino.h>



#if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL)

// Required for Serial on Zero based boards

#define Serial SERIAL_PORT_USBVIRTUAL

#endif





void setup() {

  Serial.begin(115200);

  while (!Serial);

  pinMode(36,OUTPUT);

  pinMode(5,OUTPUT);



  



  OSC32KCTRL->XOSC32K.bit.CGM = 1; // control gain mode: 1 = standard/XT 2 = high-speed/HS

  OSC32KCTRL->XOSC32K.bit.STARTUP = 0; // oscillator startup time, 0 = 62 ms

  OSC32KCTRL->XOSC32K.bit.ONDEMAND = 1; // always run

  OSC32KCTRL->XOSC32K.bit.XTALEN = 1; // enable crystal driver circuit for XIN32/XOUT32 pins

  OSC32KCTRL->XOSC32K.bit.EN32K = 1; // enable the 32 kHz output clock

  OSC32KCTRL->XOSC32K.bit.ENABLE = 1;

  while (!OSC32KCTRL->STATUS.bit.XOSC32KRDY); // wait until crystal oscillator is stable and ready to be used as a clock source







  GCLK->PCHCTRL[TC3_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK1_Val |

                                   (1 << GCLK_PCHCTRL_CHEN_Pos);

 



  GCLK->GENCTRL[3].bit.SRC = 0x5;  

  GCLK->GENCTRL[3].bit.DIV = 1;

  GCLK->GENCTRL[3].bit.GENEN = 1;

  GCLK->GENCTRL[3].bit.IDC = 1 ;

  GCLK->GENCTRL[3].bit.OOV = 1;

  



  while ( GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL3 ){

    /* Wait for synchronization */

  }



  PORT->Group[0].PINCFG[17].bit.PMUXEN = 1;

  PORT->Group[0].PMUX[8].bit.PMUXE = 0xc;

  

  



  Serial.println("setup done");



}



void loop(){ }