Skip to main content
Associate II
November 19, 2023
Solved

System reset during kernel debug

  • November 19, 2023
  • 1 reply
  • 7172 views

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.

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

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.

1 reply

PatrickF
ST Employee
November 20, 2023

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 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent
mingmingAuthor
Associate II
November 20, 2023

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.

Erwan SZYMANSKI
ST Technical Moderator
November 21, 2023

@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.