Hello all,

I'm trying to use the TOM for output generation of PWM.
The PWM works, but I'm having issues with the FXCLK selection. FXCLK[0 ... 5] is the clock source for TOM and should offer different frequencies (/1, /8, /256, /4096, /65536) should offer different frequencies,
but no matter which one I choose, the output frequency is always the same (as if I chose /1 clock).

I'm using ILLD

Configuration of GTM, CMU and TOM is below:

Ifx_GTM *gtm = &MODULE_GTM;

// enable GTM

// GTM global clocks init
IfxGtm_Cmu_setGclkFrequency(gtm, (float)GTM_CFG_GCLK_FREQUENCY);

// configure cmu_clk1 as clock source for FXCLK
IfxGtm_Cmu_setClkFrequency(gtm, IfxGtm_Cmu_Clk_1, 10000000);

// enable cmu_clk1
IfxGtm_Cmu_enableClocks(gtm, IFXGTM_CMU_CLKEN_CLK1);

// select clock source for FXCLKx (ILLD doesn't support this)
gtm->CMU.FXCLK.CTRL.B.FXCLK_SEL = 2; // selects cmu_clk1 as FXCLK source

// enable FXCLK clocks
IfxGtm_Cmu_enableClocks(gtm, IFXGTM_CMU_CLKEN_FXCLK);


// tom config struct
IfxGtm_Tom_Pwm_Config TomConfig;

// init config to default values
IfxGtm_Tom_Pwm_initConfig(&TomConfig, gtm);

// set source clock
TomConfig.clock = IfxGtm_Tom_Ch_ClkSrc_cmuFxclk2; // should be cmu_clk1 / 256, but is actually cmu_clk1 ??

// init config values
TomConfig.tom 	            = _tomOutChannel->tom;
TomConfig.tomChannel 	    = _tomOutChannel->channel;
TomConfig.pin.outputPin     = _tomOutChannel;
TomConfig.pin.outputMode = PWM_LSDRV_MODE;
TomConfig.pin.padDriver     = PWM_LSDRV_PAD_DRIVER;
TomConfig.dutyCycle           = 50;
TomConfig.period                 = 100;

// init TOM
IfxGtm_Tom_Pwm_init(&_tomDriver, &TomConfig);


I have checked the register, which shows the clock selection for TOM, and the value is correct (2 = IfxGtm_Tom_Ch_ClkSrc_cmuFxclk2, should be CmuClk1/256).
The PWM output frequency is as if the clock selection was just CmuClk1/1 aka 256 times too fast.

Has anyone managed to run the TOM with divided FXCLK as the clock source?
Has anyone had similar problems?

Thank you!