Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion nanoFirmwareFlasher/StmJtagDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;

namespace nanoFramework.Tools.FirmwareFlasher
{
Expand Down Expand Up @@ -100,6 +101,9 @@ public ExitCodes FlashHexFiles(IList<string> files)
return ExitCodes.E5003;
}

// need a couple of seconds before issuing next command
Thread.Sleep(2000);

// try to connect to device with RESET
var cliOutput = RunSTM32ProgrammerCLI($"-c port=SWD sn={DeviceId} mode=NORMAL");

Expand Down Expand Up @@ -229,8 +233,11 @@ public ExitCodes FlashBinFiles(IList<string> files, IList<string> addresses)
}
}

// need a couple of seconds before issuing next command
Thread.Sleep(2000);

// try to connect to device with RESET
var cliOutput = RunSTM32ProgrammerCLI($"-c port=SWD sn={DeviceId} mode=UR");
var cliOutput = RunSTM32ProgrammerCLI($"-c port=SWD sn={DeviceId} mode=NORMAL");

if (!cliOutput.Contains("Connected via SWD."))
{
Expand Down