2022-01-03 12:38 PM
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:
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:
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
2022-01-03 12:48 PM
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"
2022-01-03 01:36 PM
I've tried to look for the configuration "none" in Ac6, but I've found nothing on it.
The only options I've found are:
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!
2022-01-03 02:19 PM
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.
2022-01-04 10:11 AM
> 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:
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?
It should be "HotPlug" for Mode, but any indication if/what to put in Reset mode?
Thanks again!
2022-01-04 11:46 AM
> 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.
2022-01-25 11:07 AM
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.
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