[riot-notifications] [RIOT-OS/RIOT] boards/openmote-b: Fix flashing issues (#11833)

Yannic notifications at github.com
Fri Jul 12 22:34:00 CEST 2019


Tested 4 boards (that would usually lock up after flashing once) with `make BOARD=openmote-b PROGRAMMER=cc2538-bsl flash` and was successfully able to flash them multiple times. The whole process is also *much* quicker now that it's using hex.

I hadn't tried RIOT's `jlink` target before, so at first connecting the SEGGER J-Link and calling `make BOARD=openmote-b PROGRAMMER=jlink flash` resulted in a stuck console with this output:

```
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
```

I'm not quite sure what exactly is causing it to get stuck like that, but going through the process of calling `JLinkExe -device CC2538SF53` and loading the binary by hand I noticed that changing the setup values in `$(RIOTBOARD)/common/remote/dist/flash.sh` from
```
# 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
```
to
```
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
```
fixes the problem and allows multiple jlink flashes without issues.

I'm not quite sure what `r` and `g` 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:

```
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.
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11833#issuecomment-511024396
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190712/a6204660/attachment.html>


More information about the notifications mailing list