AN4989 Rev 3
89/118
AN4989
Debug through hardware exploration
117
Figure 68. MCO Multiplexer in STM32CubeMX Clock Configuration Pane
The divider allows to output a signal frequency compatible with output capabilities.
8.2.2 HAL_RCC_MCOConfig
Independantly of the fact that STM32CubeMX is used or not, MCO configuration is done
using the hal_rcc or LL function:
stm32XXxx_hal_rcc.c/ stm32XXxx_hal_rcc.h
void HAL_RCC_MCOConfig( uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t
RCC_MCODiv)
Examples based on LL drivers are available in STM32Cube libraries (refer to
STM32CubeProjectList.html) which configure the GPIO and the related registers depending
on source and divider.
They also configure the selected GPIO accordingly:
/* Configure the MCO1 pin in alternate function mode */
GPIO_InitStruct.Pin = MCO1_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Alternate = GPIO_AF0_MCO;
HAL_GPIO_Init(MCO1_GPIO_PORT, &GPIO_InitStruct);
Caution:
The setting of GPIO speed (OSPEED) must be carefully set.
OSPEED setting and maximum output frequency value are described in the datasheet of
the related MCU in chapter
I/O port characteristics.
Max Frequency values are given for a typical load of 50 pF or 10 pF.
If the measure is performed with an oscilloscope, the load of the probe circuitry must be
taken into account.
Содержание STM32 Series
Страница 46: ...Connecting to the board AN4989 46 118 AN4989 Rev 3 Figure 30 Keil hotplug step2 ...
Страница 91: ...AN4989 Rev 3 91 118 AN4989 Debug through hardware exploration 117 Figure 69 STM32F4 F7 dual MCO capabilities ...
Страница 103: ...AN4989 Rev 3 103 118 AN4989 Managing DBGMCU registers 117 Figure 78 Generator Options debug MCU in STM32CubeIDE ...