STM32L4R7ZIT program download or program start problem
I am posting the support ticket here as well, because it took six weeks to get a first response to the original support ticket.
It is likely related to the issue reported in this posting:
@ST: please pick up case 00140083.
This is probably related to the issue I reported in case 00133376. You have closed that ticket so I must create a new one. STM32L4R7ZIT.
I have followed the recommendation in case 00133376 and applied the PEMPTY patches described here:
At first, it seemed that our custom init function (replacing HAL_Init() and SystemClock_Config()) had solved the original problem.
Then a colleague joined me in the project and started having debugging problems. We then applied the PEMPTY patches and it seemed that the problem had gone away.
However, after adding more code to the project, we now experience a slightly different problem:
We have a test program that writes a triangle on an LCD screen. We start the execution with the ST-Link v2 attached by clicking the RUN button in CubeIDE. It:
* compiles the project
* communicates with the target (dongle LED flashing) and LCD screen powered off
* the old code then restarts (which can be seen on the LCD screen counter text) and runs for less than a second
* communicates a second time with the target similar to just before and starts running the new code (without interruption)
* the RCC->CSR content at this point says "pin reset"
To the support ticket I attached a video clip that shows the behaviour.
It's the same with CubeIDE 1.6.1 with the PEMTPY patches, with CubeIDE 1.7.0 without and with the PEMPTY patches, and with ST-Link v2 firmware versions V2.J37.S7 and V2.J38.S7.
Once the dongle takes control of the target it should not release it until the new code is downloaded properly.
If connecting power to the board without the dongle attached, it starts running the code and after a few seconds it restarts. However, never more than once. We have not in any way configured or started a watchdog. Since I wrote the power and clock initialization code (after reverse-engineering HAL_Init() and SystemClock_Config()) I know exactly what is done by our code. Nevertheless, it seems very much like a watchdog timing out _once_ after the first reset (including power-on reset), but if this is the case the watchdog must be started by ST's system memory code or before the entry into the main function.
Best regards
Niclas