cancel
Showing results for 
Search instead for 
Did you mean: 

System reset during kernel debug

mingming
Associate II

Using MP135F-DK board.

Setup the environment and rebuild kernel.

After I use openocd and gdb success connect to linux system, try to debug linux kernel, then run some simple gdb command like "bt" or do nothing, then system get reset.

I did not get much useful info from console (minicom).

if I don't pause system and let gdb "continue", then no reset.

Is it because watchdog ? how to disable it.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @mingming ,

OTP (equivalent to option bytes on STM32) could only define if Watchdog is started by HW after reset or start by SW.
Once set to be started by HW, you can't revert OTP settings.
By default on our boards, it is start by SW, so you should simply disable it in Device Tree as told by @Erwan SZYMANSKI .

Regards.

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

16 REPLIES 16
PatrickF
ST Employee

Hi @mingming ,

yes, it is likely a watchdog. Once started, you cannot disabled it, but you could decide to froze it when Cortex-A7 is stopped by debugger.

Please have a look to DBGMCU_APB4FZ.IWDG2

PatrickF_0-1700465655003.png

or DBGMCU_APB5FZ.IWDG1

PatrickF_1-1700465687763.png

Regards.

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.

Hello Patrick,

Do you mean I should write IWDG1 and IWDG2 register when I pause CPU by GDB ?

Is there a way I can disable watchdog permanently.
like jumper?

Or bootloader configureation to disable it at boot time?

Regards.

Hi,

I mean you should try to use debugger to write in the DBGMCU registers I mention in order to setup HW to freeze watchdogs during debug phases.

 

Otherwise, watchdog could be permanently disabled (i.e not started) in the device tree:

https://wiki.st.com/stm32mpu/wiki/Watchdog_overview#Kernel_configuration
https://wiki.st.com/stm32mpu/wiki/IWDG_device_tree_configuration#DT_configuration_-28board_level-29

 

Regards.

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.

hi,

More help needed. I'm not familiar with this part.

I try to disable watchdog from kernel config

[] Watchdog Timer Support  --->

Then rebuild, copy uImage to SD card, then system continues reset

------------------------------------
[ OK ] Reached target Preparation for Network.
Starting Network Configuration...
E/TC:0 Panic 'Watchdog' at ?:0
NOTICE: CPU: STM32MP135F Rev.Y
NOTICE: Model: STMicroelectronics STM32MP135F-DK Discovery Board

-------------------------------------

I think this kernel config is just "enable/disable watch dog feed", it's not "enable/disable watchdog"

Then I open stm32mp131.dtsi, try to disable it from device tree, it shows iwdg2 was disabled.

-------------------------------------------

iwdg2: watchdog@5a002000 {
compatible = "st,stm32mp1-iwdg";
reg = <0x5a002000 0x400>;
clocks = <&rcc IWDG2>, <&scmi_clk CK_SCMI_LSI>;
clock-names = "pclk", "lsi";
status = "disabled";
};

------------------------------------------

 

quite confused,

if iwdg2 is "disabled" then why system reset after I remove watchdog support?

should I modify loader code to disable it ?

Hello @mingming ,
You well disabled iwdg in Linux kernel device trees, but I think you forgot to do it in other components such as OP-TEE, U-Boot and TF-A. It will be mandatory to do it in each component that declare it as active, or you will go to system reset as watchdogs will wait for their "ping".

Kind regards,
Erwan.

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.

Hello @Erwan SZYMANSKI Hello @PatrickF 

I got some info from here https://www.st.com/resource/en/datasheet/stm32mp135c.pdf :

mingming_0-1700562476177.png

it's seems like "option bytes" could disable it. 

As the experience from other controller, once we disabled it from option bytes, then it can not abled by SW.

But I don't know which SW can used to set option bytes. Need your help.

I'm first time use STM product.

Hi @mingming ,

OTP (equivalent to option bytes on STM32) could only define if Watchdog is started by HW after reset or start by SW.
Once set to be started by HW, you can't revert OTP settings.
By default on our boards, it is start by SW, so you should simply disable it in Device Tree as told by @Erwan SZYMANSKI .

Regards.

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.

@PatrickF 

Is there document for "disable iwdg in OP-TEE, U-Boot and TF-A" ?

@mingming ,
This article guide you to compile and deploy other BSP component than Linux Kernel : https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package#Developing_software_running_on_Arm_Cortex-A7

This is the same way than for your Linux kernel, you have device trees to modify on iwdg nodes, some "disabled" to add. You will find easily as it is very similar than for Linux. 
Take the time to well read the wiki to cross compile, deploy everything in the FIP, and then deploy the FIP on the target.

Kind regards,
Erwan.

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.