Skip to main content
Graduate
January 11, 2024
Solved

STM32L452Re breaks on SystemClock_Config();

  • January 11, 2024
  • 3 replies
  • 2769 views

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!

This topic has been closed for replies.
Best answer by gbm

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.

 

3 replies

gbm
gbmAnswer
Principal
January 11, 2024

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.

 

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
TDK
Super User
January 11, 2024

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""."
mƎALLEm
Technical Moderator
January 11, 2024

Hello,

From UM1724:

SofLit_0-1704985792957.png

 

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