Hi,
if you can see that old version of your project is running after disconnection of PE or after power-on - are you sure that you didn't select RAM target in Debug Configurations by mistake?
There are two typical use-cases how to configure it:
1. You want to load new code to flash. In this case, it's necessary to enable "Load executable" and also "Load symbols" to see the source code when debugging. Do not select "Attach to Running Target" here:
lukaszadrapa_0-1610987599078.png
2. You want to do a "hot attach" only to debug code which is already programmed in flash and which is running (you are not going to program the flash again). In this case, disable "Load executable" and enable "Attach to Running Target":
lukaszadrapa_1-1610987729053.png
You can get a message that the debugger can't read some registers or memory because the device is already running (real-time access is not supported by this debugger). Just stop the execution to see all resources.
Note: Source level debug of a running target is only possible if the sources of the project to be attached exactly match the binary code running on the target.
Regards,
Lukas