cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L452Re breaks on SystemClock_Config();

khaylup
Associate

Hi,

I am attempting to send AT commands via USART1 to an ESP8266-01 connected to my STM32L452RE Nucleo board. I am trying to initialize an HSE with the following settings:

pinout.jpg

And the following clock configuration:

 

clk.jpg

My problem is that the code is stopping in the  SystemClock_Config() function call in main.c, specifically here:

break.jpg

To troubleshoot this problem, I've tried:

  • Connecting the ESP01 to USART 2 and 3
  • Driving the boot0 pin to low (Putting a Jumper from pins 7-8)

Additionally i've tried the LSE in crystal mode, as well as LSE and HSE in bypass modes. I have also tried using the HSI, and the commands sent to my ESP-01 are not sent at all. (Note the commands are called from the function ESP_Server_Init() in main.c)

I'm relatively new into the world of embedded programming, so any help would be appreciated regarding my clock configuration to send the commands to my USART. My source code and ioc are attached.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
gbm
Lead II

AFAIK, on Nucleo-64 boards with STM32L series MCUs, by default there is no connection to HSE, so HSE cannot work at all.

You have 3 options:

1. Use MSI - its accurate enough for UART communication.

2. Use MSI synchronized to LSE (LSE scillator is usually present on STM32L4 boards.

3. Change the board configuration by resoldering the bridges, so that 8 MHz clock is routed from ST-Link to the MCU.

 

View solution in original post

3 REPLIES 3
gbm
Lead II

AFAIK, on Nucleo-64 boards with STM32L series MCUs, by default there is no connection to HSE, so HSE cannot work at all.

You have 3 options:

1. Use MSI - its accurate enough for UART communication.

2. Use MSI synchronized to LSE (LSE scillator is usually present on STM32L4 boards.

3. Change the board configuration by resoldering the bridges, so that 8 MHz clock is routed from ST-Link to the MCU.

 

TDK
Guru

The user manual goes into detail about the various HSE options available. See "6.7.1 OSC clock supply"

https://www.st.com/resource/en/user_manual/um1724-stm32-nucleo64-boards-mb1136-stmicroelectronics.pdf

If you feel a post has answered your question, please click "Accept as Solution".
SofLit
ST Employee

Hello,

From UM1724:

SofLit_0-1704985792957.png

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.