cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP135A Needs An LSE? (meta-st-stm32mp)

ChrisRCAL
Associate II

So coincidental enough all the projects I have done before required a RTC /w LSE. I am now working on a project that does not need a LSE, and I am finding that TF-A keeps throwing a panic because of this. The protos we had fortunately had the circuit DNL, so adding an LSE clock fixed the problem. 

Is there a way to disable this? or at least use the LSI? I tried configuring it to use the LSI but still same panic. 
//Error Message

NOTICE: Early console setup
PANIC at PC : 0x2ffe6b5b

Exception mode=0x00000016 at: 0x2ffe6b5b



Thank you for any help. 


1 ACCEPTED SOLUTION

Accepted Solutions
OlivierK
ST Employee

Hello @ChrisRCAL 

 

Thank you for this, we have identify an issue in the OSTL DV6.1. A patch is available to deactivate the external oscillator when not available and prevent panic, but its frequency needs to be set to 0 in the DT. The following patch will be implemented in the next DV. Let us know if it fixes your issue.

 

 

stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v25.08.27/sources/ostl-linux/tf-a-stm32mp-v2.10.13-stm32mp-r2-r0/tf-a-stm32mp-v2.10.13-stm32mp-r2/drivers/st/clk/clk-stm32mp2.c

 

diff --git a/drivers/st/clk/clk-stm32mp2.c b/drivers/st/clk/clk-stm32mp2.c

index 9c93db5..6552161 100644

---    a/drivers/st/clk/clk-stm32mp2.c

+++ b/drivers/st/clk/clk-stm32mp2.c

@@ -846,6 +846,10 @@

 {

  struct clk_oscillator_data *osc_data = clk_oscillator_get_data(priv, id);

+ if (osc_data->frequency == 0UL) {

+ return true;

+ }

+

  return _clk_stm32_gate_is_enabled(priv, osc_data->gate_id); }

 


In order 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.

View solution in original post

2 REPLIES 2
OlivierK
ST Employee

Hello @ChrisRCAL 

 

Thank you for this, we have identify an issue in the OSTL DV6.1. A patch is available to deactivate the external oscillator when not available and prevent panic, but its frequency needs to be set to 0 in the DT. The following patch will be implemented in the next DV. Let us know if it fixes your issue.

 

 

stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v25.08.27/sources/ostl-linux/tf-a-stm32mp-v2.10.13-stm32mp-r2-r0/tf-a-stm32mp-v2.10.13-stm32mp-r2/drivers/st/clk/clk-stm32mp2.c

 

diff --git a/drivers/st/clk/clk-stm32mp2.c b/drivers/st/clk/clk-stm32mp2.c

index 9c93db5..6552161 100644

---    a/drivers/st/clk/clk-stm32mp2.c

+++ b/drivers/st/clk/clk-stm32mp2.c

@@ -846,6 +846,10 @@

 {

  struct clk_oscillator_data *osc_data = clk_oscillator_get_data(priv, id);

+ if (osc_data->frequency == 0UL) {

+ return true;

+ }

+

  return _clk_stm32_gate_is_enabled(priv, osc_data->gate_id); }

 


In order 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.

Took me a bit to get back to this topic, sorry for the delay. 

This did fix the issue - 

Step-by-step for anyone else like me.

1. Enable LSE in the Cube.
2. 

clk_lse: clk-lse {
clock-frequency = <32768>;
 
/* USER CODE BEGIN clk_lse */
clock-frequency = <0>;
/* USER CODE END clk_lse */
};

3. Patch it, as stated above. I had to change mine to stm32mp1 not mp2, since it was for the stm32mp135a.