Measuring the HSE frequency of an STM32F2
Old question, but i will provide an answer for it, cause i was also looking for it.

STM2Fxx provides a handy way of outputting SYSTEM, HSI, HSE or PLL clock signal on specialized pins called MCO1 and MCO2. Here is the example code of how to configure it

RCC-&gt;PLLCFGR     = (16&lt;&lt;0) | (200&lt;&lt; 6) | (2&lt;&lt;24);  //Set pll clock to 100MHz
RCC-&gt;CFGR       |= (7&lt;&lt;24) | (3&lt;&lt;21);              //MCO1 uses PLL output and devides it byt 7
RCC-&gt;CR         |= (1&lt;&lt;24);                        //Enables PLL
RCC-&gt;AHB1ENR    |= (1&lt;&lt;0);                         //Enables clock on GPIOA port
GPIOA-&gt;MODER    |= (2&lt;&lt;16);                        //Sets pin PA8 to alternating function which is by default MCO1 outoput.


The breakdown, configure your PLL clock before enabling it, configure MCO1 source and prescaler, enable PLL clock, enable clock on GPIOA and set pin PA8 to alternate function this will automatically make it output MCO1 clock signal due to default reset value of alternate function register since MCO1 function is 0.

Note: according to my datasheet, MCO1 can use HSI, HSE, or PLL as a source, however MCO2 can also output system clock which i use to profile my mcu.

This examples uses STM32F746NG microcontroller