cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f2 MCO switching off

Boris Hoz
Associate II
Posted on November 01, 2017 at 09:33

Hi,

I am migrating from stm32f103 to stm32f205.

stm32f103 allows switching MCO on by HAL_RCC_MCOConfig(RCC_MCO, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1) and off MCO by HAL_RCC_MCOConfig(RCC_MCO, RCC_MCO1SOURCE_NOCLOCK, RCC_MCODIV_1).

However stm32f205 doesn't support RCC_MCO1SOURCE_NOCLOCK.

Is there a way to switch stm32f205 MCO on/off?

Thanks for assistance.

Boris.

#stm32f2-mco-switching-off
2 REPLIES 2
Imen.D
ST Employee
Posted on November 01, 2017 at 12:20

Hello,

The MCO1 pin is configured in alternate function mode, mapped in PA8. 

To disable it, you can 

configure the pin in 

input floating mode (reset state). 

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on November 01, 2017 at 12:56

 ,

 ,

Hi Imen,

Thank you for attention to the problem.

As I understand the possible solution is:

void SetMCO( uint32_t mode) {

 , , , GPIO_InitTypeDef GPIO_InitStruct,

 , , , GPIO_InitStruct.Pin = GPIO_PIN_8,

 , , , GPIO_InitStruct.Mode = mode,

 , , , GPIO_InitStruct.Pull = GPIO_NOPULL,

 , , , GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW,

 , , , GPIO_InitStruct.Alternate = GPIO_AF0_MCO,

 , , , HAL_GPIO_Init(GPIOA, &,GPIO_InitStruct),

}

void MCO_On() {

 , , , SetMCO( GPIO_MODE_AF_PP),

}

void MCO_Off() {

 , , , SetMCO( GPIO_MODE_INPUT),

}

Is it right?

Regards, Boris.

01.11.2017 14:21, Imen D �?¿�?¸Ñˆ�?µÑ‚:

>,

STMicroelectronics Community

<,https://community.st.com/?et=watches.email.thread>,

>,

Re: stm32f2 MCO switching off

reply from Imen D

<,https://community.st.com/people/DAHMEN.IMEN?et=watches.email.thread>,

in /STM32 MCUs Forum/ - View the full discussion

<,https://community.st.com/message/173769-re-stm32f2-mco-switching-off?commentID=173769&,et=watches.email.thread ♯ comment-173769>,

>,