Every time I modify the code and click download for the first time, it throws an error (a popup prompts "The flash loader program reported an error", and the debug log shows "Processor did not stop on hardware reset").
However, if I do nothing after the error and simply click download again, it successfully flashes the code and enters normal debugging.
Could anyone explain what causes this? How should I configure IAR or the debugger settings to avoid this issue? Thanks!