Can't restart debugger without reloading code

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

mlang
Posts: 1
Joined: Fri Sep 21, 2018 2:12 pm

Re: Can't restart debugger without reloading code

Postby mlang » Fri Sep 21, 2018 2:19 pm

I'm having this problem myself now with TIM4 configured as the HAL timebase generated by cubeMX. Program runs fine in debug mode but if powered on normally the program crashes. The fix provided by dirkvermaak works for me but i'm not sure why as I assumed that the peripheral registers would have been reset after powering up. Do you have any update on this Issue? Board is STM32F103 Nucleo. Thanks.

lrbarber
Posts: 1
Joined: Mon Oct 22, 2018 6:17 pm

Re: Can't restart debugger without reloading code

Postby lrbarber » Mon Oct 22, 2018 6:24 pm

I was running fine and then developed this exact problem - so I knew it wasn't related to boot pins on the hardware. It developed after I started initializing additional peripherals. I solved it by simply adding a call to HAL_DeInit() as the first line in main() - right before the the call to HAL_Init().

nvkokorin
Posts: 1
Joined: Tue Oct 23, 2018 8:27 am

Re: Can't restart debugger without reloading code

Postby nvkokorin » Tue Oct 23, 2018 8:35 am

Hi, just comment the load command in the Target Software Startup Script
For example:

# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers
# 2=32 bit, 1=16 bit and 0=8 bit parallelism mode
monitor flash set_parallelism_mode 2

# Reset to known state
monitor reset

# Load the program executable
#load <<<<<<<<<<<<<<<<<<<<<<<<< comment here

# Enable Debug connection in low power modes (DBGMCU->CR)
set *0xE0042004 = (*0xE0042004) | 0x7
# Set a breakpoint at main().
tbreak main

# Run to the breakpoint.
continue

Also, you can create a copy of existing script and use it for debugging without reloading code.
I hope this help you

dirkvermaak
Posts: 11
Joined: Mon Dec 11, 2017 11:22 am
Location: United Kingdom
Contact:

Re: Can't restart debugger without reloading code

Postby dirkvermaak » Tue Oct 23, 2018 10:06 am

BTW this is listed as fixed in the latest release of Atollic.
Andibee Ltd.
Loughborough
Leicestershire
LE11 3SJ

dirkvermaak@andibee.co.uk

Designing with STM32 since 2007

DD4DA
Posts: 40
Joined: Thu Jan 11, 2018 10:06 pm

Re: Can't restart debugger without reloading code

Postby DD4DA » Fri Oct 26, 2018 10:22 pm

The issue sounds similar as i response in realtion with the j-link Debugger. The first start and upload are successfully and works until the first breakpoint reaches. The Debugger immediately aborts with the error message:

Exception condition detected on fd 644
Remote communication error. Target disconnected.: No error.
Quit


A restart of Debugging with the f5 (visual-Studio key Schema), starts the Flash erase twice and is unable to stop at any breakpoint.
I had replaced the segger j-link Tools without any success. Seggers j-Scope and TrueStudio 9.01 works pretty nice.

I had switched back to 9.01.

Mattias Norlander
Posts: 264
Joined: Fri Apr 29, 2016 10:01 am

Re: Can't restart debugger without reloading code

Postby Mattias Norlander » Tue Oct 30, 2018 1:10 pm

Hi all,

Would be interesting to hear from you if 9.1.0 fixes the restart issues you have or if we still have this problem on some devices?! Appreciate your feedback and creative solutions! :)

dirkvermaak
Posts: 11
Joined: Mon Dec 11, 2017 11:22 am
Location: United Kingdom
Contact:

Re: Can't restart debugger without reloading code

Postby dirkvermaak » Tue Oct 30, 2018 1:18 pm

So far we have found it fixes restarts at 0x8000000.

However, on our relocated code that is built and run at 0x8020000, it fails. In fact it takes you out of the debugger and back in to the C Editor perspective. The code is fine when it is run the first time and it's fine when booted with our bootloader.

When we debug at 0x8020000 we normally don't have a bootloader installed at 0x80000000.

Cheers,
Dirk
Andibee Ltd.
Loughborough
Leicestershire
LE11 3SJ

dirkvermaak@andibee.co.uk

Designing with STM32 since 2007

Mattias Norlander
Posts: 264
Joined: Fri Apr 29, 2016 10:01 am

Re: Can't restart debugger without reloading code

Postby Mattias Norlander » Tue Oct 30, 2018 1:42 pm

That is a fast response!

According to specification the MCU should start executing from 0x8000000 after a reset. Without a boot loader available at this memory address this use case will fail. Not sure what the desired behaviour would be. Maybe a more complex Reset button with a drop-down menu showing 6 different options (3 reset types) X (0x8000000 + user defined boot address) = 6 options.

dirkvermaak
Posts: 11
Joined: Mon Dec 11, 2017 11:22 am
Location: United Kingdom
Contact:

Re: Can't restart debugger without reloading code

Postby dirkvermaak » Tue Oct 30, 2018 2:39 pm

Yeh, I get that. I also realise that it's not a really common thing to do. Our boot loader is quite secure, in that it it doesn't just boot, but it checks the images to ensure integrity (length, MD5, versions etc.) before it will even attempt to boot an image. This makes it tricky to run our boot loader when we are constantly changing the application image. I guess we could just implement a really dumb boot loader for day to day work and then change to the production one for final testing.

I would be happy with options under the reset button, or even an option in the debugger set up so that it follows that behaviour every time?

BTW, keep up the good work.
Cheers,
Dirk
Andibee Ltd.
Loughborough
Leicestershire
LE11 3SJ

dirkvermaak@andibee.co.uk

Designing with STM32 since 2007

DD4DA
Posts: 40
Joined: Thu Jan 11, 2018 10:06 pm

Re: Can't restart debugger without reloading code

Postby DD4DA » Tue Oct 30, 2018 9:22 pm

Mattias Norlander wrote:Hi all,

Would be interesting to hear from you if 9.1.0 fixes the restart issues you have or if we still have this problem on some devices?! Appreciate your feedback and creative solutions! :)


Instead fixing the main issues, it got some more. It this the "Holiday gift" that Atollic talk's about a year ago? http://blog.atollic.com/early-holiday-gift-from-stmicroelectronics.

I would'nt have such one.

Does you expect that the customers will debug your IDE? To find "creative Solutions" is your Job, not us. True-Studio 9.1 is a worse and contains some old issues similar as 9.0.1. I

Can anyone explain me where the different are between AC6 SW4STM32 and Atollic TrueStudio 9.xx?

I can not find them actually and this time, i can't recomment to use them.


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 1 guest