I have a very strange problem.
After stopping the Debug session, cannot download code to flash
got error: "Flash Download failed - "Cortex-M4".
I have to restart Keil to be able to Download code to flash memory
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
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
Hard to gauge wtf you're doing and on what from the
Check you have current firmware and drivers for the debugger being
uV4 is obsolete consider using a more current version
Quote: "Crashing is not the same as access to a target being
I have never told it is. If after debug session I start another
debug session, Keil crashes with message: "qVision 4 IDE has stopped
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
>>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
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 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
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
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:
Check your "Connect and Reset options", see:
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):
Also check you board to make sure all of the signals are brought
out to the 20 pin connector. See
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
View all questions in Keil forum