Page 1 of 4

Can't restart debugger without reloading code

Posted: Mon Jun 27, 2016 1:35 pm
by dex749
Looking for a solution to the following problem: Can't restart debug without reloading code

Processor: STM32F429
Debugger: ST/LINK

Good: Fire off debugger, code is transferred to platform flash, code executes to main and pauses
Good: Breakpoints work, singlestepping, etc.. work fine
Good: Terminate and relaunch works fine
Bad: Restart fails (debugger locks and is unresponsive)

Is there something that is needed (hardware and/or configuration) that the 'Restart' feature is expecting? I don't really like having to re-flash code to the platform just to restart program execution from the beginning (with no code changes).

Any ideas or guidance? Thanks.

- Update - I found the

Posted: Wed Jun 29, 2016 7:17 pm
by dex749
- Update -

I found the problem. The root cause was that the device was configured to boot into system mode (via BOOT0/1 pins). This works fine when entering a fresh debugging session because firmware load and initial execution is under the control of the debug probe. However, when the restart button is clicked, execution path appears to be governed by the processor instead of the probe, allowing boot mode selection to lead to confusion. Ensuring that flash boot mode is selected while debugging solves the problem.

Thank you for sharing this

Posted: Wed Jun 29, 2016 10:17 pm
by Lawrence
Thank you for sharing this problem, its with people like you that this forum will grow and become good and lively.

Expect me to do the same.

Re: Can't restart debugger without reloading code

Posted: Sun Feb 25, 2018 2:25 pm
by bertrand
Hello,
I have similar problem, but despite information given in previous post I am not able to solve my problem.
When I enter in debug mode for the first time all work fine, but if I "restart", I fall in NVIC infinite routine after I enable it ( HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn) because the signal handler is called.
It's an initialisation issue but I don't find where.
It could be a code issue, but it works at the fisrt time and it is the portion automaticly supplied by CubeMX.
The onbly workaround is to reload the debugger.

Thanks for your advise.

BR
Bertrand

Re: Can't restart debugger without reloading code

Posted: Mon Feb 26, 2018 9:22 am
by Martxel
I have the same issue.

It's a project generated with CubeMX based on STM32H7 + FreeRTOS.

If I try to restart the debugging session, once the IRQ of TIMER1 is enabled in the HAL_Init (HAL_InitTick), it ends up in a loop.

The only workaround I've found is to leave and re-enter debug.

Re: Can't restart debugger without reloading code

Posted: Mon Feb 26, 2018 9:28 am
by bertrand
Ok, I am a new user of TrueStudio. I worked with openstm32 before. I had not this behaviour with openstm32. So, maybe it could be a configuration problem with Turestudio.
Bertrand

Re: - Update -I found the

Posted: Tue May 08, 2018 2:35 pm
by JeromeBryant
dex749 wrote:- Update -

I found the problem. The root cause was that the device was configured to boot into system mode (via BOOT0/1 pins). This works fine when entering a fresh debugging session because firmware load and initial execution is under the control of the debug probe. However, when the restart button is clicked, execution path appears to be governed by the processor instead of the probe, allowing boot mode selection to lead to confusion. Ensuring that flash boot mode is selected while debugging solves the problem.


yes, that is what will solve the problem

Re: Can't restart debugger without reloading code

Posted: Tue May 08, 2018 6:20 pm
by dirkvermaak
I have long had this problem, but I don't quite understand the answer. Do you mean on the chip itself via the Boot Pins? (our chips are all pulled to boot this way), or do you mean a debugger setting somewhere and if so could you point me to it. It's a really annoying problem and I would love to fix it.

Re: Can't restart debugger without reloading code

Posted: Fri May 18, 2018 2:14 pm
by MRomano
good morning,

I have the same problem, I use a Discovery kit with STM32F407VG CPU.
I have a system sw generated with Stm32CUBEMX.
The pin BOOT0 is connected to gnd, when I use the "Restart" function button the debug cursor returns to the first instruction of the main () function. By sending the application in run, it remains locked in a loop in the TIM1_UP_TIM10_IRQHandler function, and does not proceed with normal program execution.
To restore normal execution I have to end the debug session, reload the program and return to run again.

You can suggest some solution to my problem.

Thank you
Romano M.

Re: Can't restart debugger without reloading code

Posted: Fri May 18, 2018 5:19 pm
by dirkvermaak
Exactly the problem we have, and we have used numerous development boards and our own designs. It happens on all of them. I have scoured the settings etc. but because it doesn't run the startup code again things seem to go badly. HELP! ANYONE?