High resolution timer

How can i acces the high resolution timer? I want to generate a configurable frequency square wave with maximum 2MHhz

Sorry for the lack of information, I meant if there is any method to access the high resolution timers in arduino ide for the Portenta h7 which uses stm32h747XIH6.

You always can read the datasheet and interact with STM32 mcu directly with registers.
In the datasheet see the Timers chapter.

See this

I got 20 khz hrtimer to work in this post:
No output from hrtim module on portenta lite - Using Arduino / Programming Questions - Arduino Forum