Hi @PMaq,
Sorry for the late reply.
I can help you optimize the GPIO switching. However, this will not replace or come close to switching the pin through HW. You can strip the RTD function to just switching the pin through registers:
IP_SIUL2->MSCR[29] ^= SIUL2_MSCR_OBE_MASK;
Using Pit_Ip_ProcessCommonInterrupt also didn't help much as the delay from 10MHz->10kHz was just too wide a gap.
The reason I pointed you to the community post was to explain the process when PIT enters interrupt, it does not only go through the callback, but also through the interrupt process from RTD, meaning it is significantly slower.
May I ask if there is a way to lower the priorities of the FreeRTOS by a step so I could make this task as the highest priority?
You can lower the interrupt priority for the interrupt controller inside the configuration container:

May I also confirm with you if I wanted to have a have a 10MHz interrupt running on my 30MHz PIT clock, then I just need to set the period to "3" when I start the PIT - Pit_Ip_StartChannel(1, 0, 3)
Yes, however, the PIT may not be able to process the interrupt with a period of 3.
Lastly, may I ask if you have any quick reference links to check what peripherals use what clocks? especially within an RTOS environment? Thanks!
You can refer to S32K3XX's reference manual. Chapter 24.6 shows peripheral clocking. For example, PIT uses AIPS_SLOW_CLK:
One last thing to consider is that if you are toggling your pin inside the PIT callback, this will result in an output square-wave frequency that is half the interrupt frequency.
Best regards,
Julián