cancel
Showing results for 
Search instead for 
Did you mean: 

How do I avoid triggering a reset when connecting my STLink v2.1 to my STM32F439ZI / STM32F429ZI?

FDe G.11
Associate II

I have a board mounted on a phisical system, so debugging and/or staying connected on the board while running is not a feasible option.

What I'd like to do is:

  1. Connect to the board with an STLink (JTAG)
  2. Load the software (Ac6 - Eclipse IDE)
  3. Restart the system and run the program
  4. Connect to the board once the system has concluded (no moving parts)
  5. Create a memory dump of the RAM with STM32CubeProgrammer

At the moment, the step I'm having trouble is the 4th.

When I connect the STLink, the board resets itself, effectively deleting everything present on the RAM banks and restarting the program from the beginning.

What I'd like to know is:

  • what parameters and/or configurations should I modify to stop the board from resetting itself once connected to the STLink?
  • Would this prevent the Ac6 (Eclipse) IDE from being able to overwrite the program?

I have different time histories I need to load, and sadly there's not enough RAM to simply upload ALL the data necessary to function (I used conditional compilation to select only the time history i need)

The amount of data i need to "download" is around 40Kb. The boards are two, almost identical except for the main chip (F429 vs F439)

I don't expect to receive a complete/direct answer, but if someone has suggestions and/or indications on which manual/forum posts to look, that'd be bloody helpful

6 REPLIES 6
TDK
Guru

You can attach the debugger without resetting the chip to inspect memory/peripherals/whatever. These are for STM32CubeIDE, probably similar for other Eclipse based systems.

To debug your program without downloading it:

Go to Debug Configurations... -> Startup -> select load image -> Edit... -> uncheck Download

To debug without resetting the device:

Go to Debug Configurations... -> Debugger -> in Reset Behavior, select "None"

If you feel a post has answered your question, please click "Accept as Solution".

0693W00000HqS3jQAF.pngI've tried to look for the configuration "none" in Ac6, but I've found nothing on it.

The only options I've found are:

  • Connect under Reset
  • Hardware Reset
  • Software system reset

I've tried to google for the same config in the STM32CubeIDE, and I've found this post.

The only configuration missing is "none", where in Eclipse I have Hardware reset.

Might be it? Or is it a completely different configuration?

At least I was on the right track, I tried fiddling with these configs before, but probably never tried that one.

For the moment being, TYVM, really appreciated!

Can you connect with STM32CubeProgrammer? It does not reset by default. If you know where the array/data is, you don't need a debugger.

> The only configuration missing is "none", where in Eclipse I have Hardware reset.

Might be it? Or is it a completely different configuration?

None and Hardware Reset are different. None does not reset while the other pulls NRST low.

If you feel a post has answered your question, please click "Accept as Solution".
FDe G.11
Associate II

> Can you connect with STM32CubeProgrammer? It does not reset by default. If you know where the array/data is, you don't need a debugger.

Yes, I had already tested the memory dump with CubeProgrammer and it works, and unlike Ac6/Eclipse I don't have to launch exclusively in debug mode to access the RAM banks.

TL;DR: Problem is, when phisically connecting the STLink cable to the board, something triggers a reset & restart

The data I want to collect can change address based on the loaded Time History, so I solved that problem by putting all desired data in a struct and placing two dummy uint8_t [8] variables array with a predetermined sequence at the start & end of the struct (that's why I'm opting to do a complete memory dump). After i look for start & end sequence, and I have all my data between these two blocks without having to write down the memory address every time.

What i do is:

  • Load the program in Run mode.
  • Turn off the boards
  • turn on boards and main motor (separate entity, boards are powered with sliprings)
  • Make acquisitions on main load cells

The part I'd like to add is connect to the boards and also download On-Board data to cross-reference the load cell acquisitions.

The problem is, when I phisically connect the STLink, something triggers a board resets (and main program loaded on the board starts from zero). Small note, we use a 20pin to 10pin converter, but that shouldn't influence the outcome (or that's where we are wrong?)

However i start the board (run mode, debug mode) or wherether the program halts or not once i connect the STLink is not relevant: what I aim to is to just avoid resetting the board to do the memdump, while retaining the ability to load different programs with Ac6/Eclipse

PS any indications on which setting to use with CubeProgrammer?

0693W00000HqYnsQAF.jpg0693W00000HqYndQAF.jpgIt should be "HotPlug" for Mode, but any indication if/what to put in Reset mode?

Thanks again!

TDK
Guru

> Problem is, when phisically connecting the STLink cable to the board, something triggers a reset & restart

If the board resets at the point at which you physically connect the debug cable, then none of those settings are relevant here will fix this issue. None of them will change that behavior as those settings control what happens after you hit "Connect" or when you launch the debug configuration.

With SWD, you need to ensure the debugger is powered before connecting it and that the firmware is up to date. With JTAG, unsure.

If you feel a post has answered your question, please click "Accept as Solution".

Thanks for the tips

I was finally able to get my hands on our custom PCB blueprints, and I noticed that we actually had a capacitor missing.

0693W00000JNIU6QAP.png 

Thing is: we don't have a switch button for the manual reset (it's not needed), but the line that connects to NRST from STLink is lacking the protection capacitor that (correct me if I'm wrong) protects the MCU from parasitic current/undesired resets.

Would that explain the sudden resets when the STLink is connected?

Now if that is the source of the problem, placing the capacitor would fix the issue. Sadly, it's more complicated than that, so as a workaround:

What would happen if I just do not connect the NRST wire from the STLink, and connect all the others? Would that undermine/risk of damaging the MCU/board, is the NRST necessary for standard communications (even if a reset is not needed) or the NRST signal is only used for reprogramming/restarting/resetting the board?

As a reminder, I do not have any need to freeze or stop the program running, the data i extract are static once the program is completed.

I just need to avoid a reset when connecting to the MCU

Thanks again for all the support, it has been unvaluable