cancel
Showing results for 
Search instead for 
Did you mean: 

HSE is not working on STM32F411E-Discovery

Duc_Tran
Visitor

I’ve just started learning STM32 and I’m currently using the STM32F411E-Discovery board. I loaded the default code provided by the Board Selector in STM32CubeIDE and was trying to get a simple LED blink working. It works fine when using the internal HSI clock, but it doesn’t seem to work when I switch to the external HSE clock. The only different is:
HSI:

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLM = 16;
RCC_OscInitStruct.PLL.PLLN = 336;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
RCC_OscInitStruct.PLL.PLLQ = 7;


HSE:

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 8;
RCC_OscInitStruct.PLL.PLLN = 336;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
RCC_OscInitStruct.PLL.PLLQ = 7;


 

1 REPLY 1

Welcome to the forum.

 


@Duc_Tran wrote:

it doesn’t seem to work when I switch to the external HSE clock.  


What do you mean by, "doesn’t seem to work"? Please describe the symptoms you see.

Have you used the debugger to see what's happening?

 

Does that board have a crystal for HSE, or is it clocked  from the ST-Link?

Details should be in the User Manual ...

 

I've edited you post to apply the proper source code formatting - please see How to insert source code for future reference.

See also: How to write your question to maximize your chances to find a solution.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.