<p>Tested 4 boards (that would usually lock up after flashing once) with <code>make BOARD=openmote-b PROGRAMMER=cc2538-bsl flash</code> and was successfully able to flash them multiple times. The whole process is also <em>much</em> quicker now that it's using hex.</p>
<p>I hadn't tried RIOT's <code>jlink</code> target before, so at first connecting the SEGGER J-Link and calling <code>make BOARD=openmote-b PROGRAMMER=jlink flash</code> resulted in a stuck console with this output:</p>
<pre><code>Type "connect" to establish a target connection, '?' for help
Selecting 1000 kHz as target interface speed
Target connection not established yet but required for command.
Please specify target interface:
  J) JTAG (Default)
  S) SWD
  T) cJTAG
</code></pre>
<p>I'm not quite sure what exactly is causing it to get stuck like that, but going through the process of calling <code>JLinkExe -device CC2538SF53</code> and loading the binary by hand I noticed that changing the setup values in <code>$(RIOTBOARD)/common/remote/dist/flash.sh</code> from</p>
<pre><code># setup JLink command file
echo "speed 1000" > $BINDIR/burn.seg
echo "loadbin $BINFILE $FLASHADDR" >> $BINDIR/burn.seg
echo "r" >> $BINDIR/burn.seg
echo "g" >> $BINDIR/burn.seg
echo "exit" >> $BINDIR/burn.seg
</code></pre>
<p>to</p>
<pre><code>echo "speed 1000" > $BINDIR/burn.seg
echo "loadbin $BINFILE $FLASHADDR" >> $BINDIR/burn.seg
echo "" >> $BINDIR/burn.seg
echo "" >> $BINDIR/burn.seg
echo "exit" >> $BINDIR/burn.seg
</code></pre>
<p>fixes the problem and allows multiple jlink flashes without issues.</p>
<p>I'm not quite sure what <code>r</code> and <code>g</code> are supposed to be for, but at least for me replacing them with newlines only makes sense, as the two inputs required after loading the binary both have default values:</p>
<pre><code>J-Link>loadbin /path/to/binary/hello-world.hex 200000
Target connection not established yet but required for command.
Please specify target interface:
  J) JTAG (Default)
  S) SWD
  T) cJTAG
TIF>
Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
JTAGConf>
Device "CC2538SF53" selected.
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11833?email_source=notifications&email_token=ABE7WYEETBBEZXU5VQMXVCLP7DTDRA5CNFSM4ICJY4W2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ2Z2DA#issuecomment-511024396">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYCNK2QQA5LVUNVZARLP7DTDRANCNFSM4ICJY4WQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYHZZHB24UT54OJNNU3P7DTDRA5CNFSM4ICJY4W2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ2Z2DA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11833?email_source=notifications\u0026email_token=ABE7WYEETBBEZXU5VQMXVCLP7DTDRA5CNFSM4ICJY4W2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ2Z2DA#issuecomment-511024396",
"url": "https://github.com/RIOT-OS/RIOT/pull/11833?email_source=notifications\u0026email_token=ABE7WYEETBBEZXU5VQMXVCLP7DTDRA5CNFSM4ICJY4W2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ2Z2DA#issuecomment-511024396",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>