Skip to content

Commit 4d1788e

Browse files
authored
Add support for J-Link and Silabs GG11 (#140)
***NO_CI***
1 parent ea0f01a commit 4d1788e

File tree

18 files changed

+1130
-27
lines changed

18 files changed

+1130
-27
lines changed

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ It makes use of several 3rd party tools:
1919
You can find the source, licensing information and documentation [here](https://www.st.com/en/development-tools/stm32cubeprog.html).
2020
- Texas Instruments Uniflash
2121
You can find the Uniflash tool and licensing information [here](http://www.ti.com/tool/download/UNIFLASH).
22+
- SEGGER J-Link
23+
You can find the J-Link, licensing information and documentation [here](https://www.segger.com/downloads/jlink/).
2224

2325
## Install .NET **nanoFramework** Firmware Flasher
2426

@@ -85,6 +87,14 @@ The tool includes help for all available commands. You can see a list of all ava
8587
nanoff --help
8688
```
8789

90+
List of usage examples per platform:
91+
92+
- [ESP32](#esp32-usage-examples)
93+
- [STM32](#stm32-usage-examples)
94+
- [TI CC13x2](#ti-cc13x2-usage-examples)
95+
- [Silabs Giant Gecko](#silabs-giant-gecko-usage-examples)
96+
- [Common options](#common-options)
97+
8898
## ESP32 usage examples
8999

90100
There are multiple ESP32 images available, some are build specifically for a target. Please check out the [list](https://github.com/nanoframework/nf-interpreter#firmware-for-reference-boards). You will need as well to know the COM port used by your device. Find [how to do this here](#finding-the-device-com-port-on-windows). Alternatively, you can as well list the available COM ports. If you list them first without the device to flash and then plugging the device, the additional port which will show up is the one for the device to flash. This method works for all OS:
@@ -242,6 +252,55 @@ To install the XDS110 USB drivers.
242252
nanoff --installxdsdrivers
243253
```
244254

255+
## Silabs Giant Gecko usage examples
256+
257+
### Update the firmware of a specific Silabs target
258+
259+
To update the firmware of the SL_STK3701A target to the latest version.
260+
261+
```console
262+
nanoff --update --target SL_STK3701A
263+
```
264+
265+
### Update the firmware of a Silabs target from a local file
266+
267+
To update the firmware of a Silabs target with a local firmware file (for example from a build).
268+
This file has to be a binary file with a valid Booter and CLR from a build. No checks or validations are performed on the file(s) content.
269+
270+
```console
271+
nanoff --update --platform gg11 --binaryfile "C:\nf-interpreter\build\nanobooter-nanoclr.bin"
272+
```
273+
274+
### Deploy a managed application to a SL_STK3701A target
275+
276+
To deploy a managed application to a SL_STK3701A target, which has the deployment region at 0x000EE000 flash address and reset the MCU after flashing it.
277+
278+
>Note: The binary file with the deployment image can be found on the Release or Debug folder of a Visual Studio project after a successful build. This file contains everything that's required to deploy a managed application to a target (meaning application executable and all referenced libraries and assemblies).
279+
280+
```console
281+
nanoff --target ST_STM32F769I_DISCOVERY --deploy --image "E:\GitHub\nf-Samples\samples\Blinky\Blinky\bin\Debug\Blinky.bin" --address 0x000EE000 --reset
282+
```
283+
284+
### Update the firmware of a SL_STK3701A along with a managed application
285+
286+
To update the firmware of the SL_STK3701A target to the latest available version, using a J-Link connection, along with a managed application.
287+
You have to specify the path to the managed application.
288+
This example uses the binary format file that is generated by Visual Studio when building any nanoFramework C# application. Because it's a binary file you have to specify too the flash address of the deployment region (here 0x000EE000, mind the hexadecimal format).
289+
290+
```console
291+
nanoff --update --target SL_STK3701A --jtag --binfile "c:\dev\my awesome app\bin\debug\my_awesome_app.bin" --address 0x000EE000
292+
```
293+
294+
### List all Silabs devices available with J-Link connection
295+
296+
This useful to list all Silabs devices that are connected through J-Link.
297+
298+
```console
299+
nanoff --listjlink
300+
```
301+
302+
## Common options
303+
245304
### Pre-check if target fits connected device
246305

247306
The tool tries to make a best effort sanity check on whether the requested target fits the connected target.

lib/jlink/JLink.exe

358 KB
Binary file not shown.

lib/jlinkCmds/erase_gg11.jlink

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
speed auto
2+
USB
3+
erase 0x0000000 0x001FF000
4+
Exit

lib/jlinkCmds/list_probes.jlink

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
speed auto
2+
ShowEmuList USB
3+
Exit
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
speed auto
2+
USB
3+
Connect
4+
Exit

lib/jlinkLinux/JLinkExe

421 KB
Binary file not shown.

lib/jlinkMac/JLinkExe

395 KB
Binary file not shown.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// Copyright (c) .NET Foundation and Contributors
3+
// See LICENSE file in the project root for full license information.
4+
//
5+
6+
using System;
7+
using System.Runtime.Serialization;
8+
9+
namespace nanoFramework.Tools.FirmwareFlasher
10+
{
11+
/// <summary>
12+
/// Couldn't open the specified J-Link device.
13+
/// </summary>
14+
[Serializable]
15+
internal class CantConnectToJLinkDeviceException : Exception
16+
{
17+
public CantConnectToJLinkDeviceException()
18+
{
19+
}
20+
21+
public CantConnectToJLinkDeviceException(string message) : base(message)
22+
{
23+
}
24+
25+
public CantConnectToJLinkDeviceException(string message, Exception innerException) : base(message, innerException)
26+
{
27+
}
28+
29+
protected CantConnectToJLinkDeviceException(SerializationInfo info, StreamingContext context) : base(info, context)
30+
{
31+
}
32+
}
33+
}

nanoFirmwareFlasher/ExitCodes.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ public enum ExitCodes
149149
E5007 = 5007,
150150

151151
/// <summary>
152-
/// Can't program BIN file without specifying an address
152+
/// Invalid address specified. Hexadecimal (0x0000F000) format required.
153153
/// </summary>
154-
[Display(Name = "Can't program BIN file without specifying an address.")]
154+
[Display(Name = "Invalid address specified. Hexadecimal (0x0000F000) format required.")]
155155
E5008 = 5008,
156156

157157
/// <summary>
@@ -192,6 +192,22 @@ public enum ExitCodes
192192
[Display(Name = "Unsupported device.")]
193193
E7000 = 7000,
194194

195+
///////////////////
196+
// J-Link Errors //
197+
///////////////////
198+
199+
/// <summary>
200+
/// Error executing J-Link CLI command.
201+
/// </summary>
202+
[Display(Name = "Error executing J-Link CLI command.")]
203+
E8000 = 8000,
204+
205+
/// <summary>
206+
/// No JTAG device found
207+
/// </summary>
208+
[Display(Name = "No J-Link device found. Make sure it's connected.")]
209+
E8001 = 8001,
210+
195211
////////////////////////////////
196212
// Application general Errors //
197213
////////////////////////////////

0 commit comments

Comments
 (0)