I have a very strange problem. After stopping the Debug session, cannot download code to flash memory anymore, got error: "Flash Download failed - "Cortex-M4".
I have to restart Keil to be able to Download code to flash memory again. It happens every time after Debug session. If I try to start Debug session again, Keil will crash.
It worked before,the problems started when I created new user on my windows pc and deleted old one. i have tried to reinstall Keil uVission4, but it didn't solve the problem.
Where could be the problem?
Reinstalling seems to misunderstand the underlying issue.
Crashing is not the same as access to a target being locked out.
The debugger can connect with the target, perhaps you left it in a broken state, or it entered some low power state where such connectivity isn't possible.
Cycle the power on the target, and ponder what you're doing to lock out access or if there is something specific with your design/implementation.
Hard to gauge wtf you're doing and on what from the description.
Check you have current firmware and drivers for the debugger being used.
uV4 is obsolete consider using a more current version
Quote: "Crashing is not the same as access to a target being locked out."
I have never told it is. If after debug session I start another debug session, Keil crashes with message: "qVision 4 IDE has stopped working." If I want to download code to flash memory, I will get error as I described in the first post. So, I have to restart Keil after debug session. Power cycle of target doesn't help. It is software issue. I am experienced user of uVision and have never seen something like this before.
>>I am experienced user of uVision and have never seen something like this before.
So contact the support desk through the usual methods. This is a user-to-user forum, not a direct customer support venue.
"Check you have current firmware and drivers for the debugger being used."
You still haven't indicated any details of the target or the debug pod used. Third part vendors usually have more current firmware and driver than those shipping with Keil. If the loading/unload of the DLL is causing the system to crash the app you need to make sure the correct DLLs are being loaded, not the default ones.
Providing specific context might permit a more focused answer due to the specific interactions with specific components.
What version of Keil uV4 specifically? What Target? What Debug Pod? What version of firmware and drivers used by the pod?
I am using Uv4 4.73. Tried now with 5.23, the problem is the same. I am using jLink programmator, tried with few different devices, the same problem. Installed new jLink drivers, no difference. Target is LPC4337. Same target works ok with another PC. Again, everything work fine until I exit from debug mode, after that Keil crashes or is locked for further programming. Restarting Keil fix the problem until next exiting from debug session.
Tried now ULINK 2, everything is same.... How to debug the problem?
Hello Def,
What version of the Keil tools are you using? There have not been any reported issues in the latest versions.
What device are you using? Nordic Softdevice applications can have a "Error: Flash Download failed" message if not setup properly:
http://www.keil.com/support/docs/3824.htm
Check your "Connect and Reset options", see:
http://www.keil.com/support/man/docs/ulink2/ulink2_ctx_debug.htm
Finally, since it is failing at flash downloading, make sure "Reset and Run" is checked on this screen (otherwise you will have to manually power cycle the board before debugging):
www.keil.com/.../ulink2_su_flashdownloadcfg.htm
Also check you board to make sure all of the signals are brought out to the 20 pin connector. See
www2.keil.com/.../coresight-connectors
Also make sure that you don't have multiple Keil sessions open at the same time. If you accidentally leave one of the other sessions debugging your device, you will not be able to access it in another session.