Skip to content

Commit b2f9498

Browse files
authored
Release v1.0.6 (#6)
1 parent 542a984 commit b2f9498

File tree

111 files changed

+5417
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+5417
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,3 +328,6 @@ ASALocalRun/
328328

329329
# MFractors (Xamarin productivity tool) working folder
330330
.mfractor/
331+
332+
#SoundCloud
333+
*.sonarqube/

README.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/master/CONTRIBUTING.md) [![Build Status](https://dev.azure.com/nanoframework/nano-firmware-flasher/_apis/build/status/nanoframework.nanoFirmwareFlasher?branchName=develop)](https://dev.azure.com/nanoframework/nano-firmware-flasher/_build/latest?definitionId=45&branchName=develop) [![NuGet](https://img.shields.io/nuget/v/nanoFirmwareFlasher.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFirmwareFlasher/) [![Discord](https://img.shields.io/discord/478725473862549535.svg?logo=discord&logoColor=white&label=Discord&color=7289DA)](https://discord.gg/gCyBu8T)
2+
3+
![nanoFramework logo](https://github.com/nanoframework/Home/blob/master/resources/logo/nanoFramework-repo-logo.png)
4+
5+
-----
6+
7+
### Welcome to the **nanoFramework** nano firmware flasher tool repository!
8+
9+
This repo contains the nano firmware flasher tool.
10+
It's a [.NET Core CLI Global Tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) that allows flashing a **nanoFramework** target with nanoBooter, nanoCLR, managed application or backup files.
11+
Is part of **nanoFramework** toolbox, along with other various tools that are required in **nanoFramework** development, usage or repository management.
12+
13+
It makes use of several 3rd party tools:
14+
15+
- Espressif esptool.
16+
You can find the esptool and licensing information on the repository [here](http://github.com/espressif/esptool).
17+
- ST DfuSe USB.
18+
You can find the source, licensing information and documentation [here](https://www.st.com/en/development-tools/stsw-stm32080.html).
19+
- ST-LINK Utility.
20+
You can find the source, licensing information and documentation [here](https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link004.html).
21+
22+
## Install **nanoFramework** Firmware Flasher
23+
24+
Perform a one-time install of the **nanoFramework** Firmware Flasher tool using the following .NET Core CLI command:
25+
26+
```console
27+
dotnet tool install -g nanoFirmwareFlasher
28+
```
29+
30+
In case you're installing a pre-release version of the tool you have to specify the version number and the **nanoFramework** Azure DevOps NuGet feed as the source. Like this:
31+
32+
```console
33+
dotnet tool install -g nanoFirmwareFlasher --version 9.9.9-preview.100 --add-source https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json
34+
```
35+
36+
After a successful installation a message is displayed showing the command that's to be used to call the tool along with the version installed. Similar to the following example:
37+
38+
```console
39+
You can invoke the tool using the following command: nanoff
40+
Tool 'nanofirmwareflasher' (version '9.9.9-preview.100') was successfully installed.
41+
```
42+
43+
To update **nanoFramework** Firmware Flasher tool use the following .NET Core CLI command:
44+
45+
```console
46+
dotnet tool update -g nanoFirmwareFlasher
47+
```
48+
49+
## Usage
50+
51+
Once the tool is installed, you can call it by using its command `nanoff`, which is a short version of the name to ease typing.
52+
53+
```console
54+
nanoff [command] [args]
55+
```
56+
57+
The tool includes help for all available commands. You can see a list of all available ones by entering:
58+
59+
```console
60+
nanoff --help
61+
```
62+
63+
### Update the firmware of an ESP32 target
64+
65+
To update the firmware of an ESP32 target connected to COM31, to the latest available development version.
66+
67+
```console
68+
nanoff --update --platform esp32 --serialport COM31
69+
```
70+
71+
### Update the firmware of an ESP32 target along with a managed application
72+
73+
To update the firmware of an ESP32 target connected to COM31, to the latest available development version.
74+
You have to specify the path to the managed application.
75+
This example uses the binary format file that was saved on a previous backup operation.
76+
77+
```console
78+
nanoff --update --platform esp32 --serialport COM31 --deployment "c:\eps32-backups\my_awesome_app.bin"
79+
```
80+
81+
### Update the firmware of a specific STM32 target
82+
83+
To update the firmware of the NETDUINO3_WIFI target to the latest available stable version.
84+
85+
```console
86+
nanoff --update --target NETDUINO3_WIFI --stable
87+
```
88+
89+
### Update the firmware of a ST_STM32F769I_DISCOVERY along with a managed application
90+
91+
To update the firmware of the ST_STM32F769I_DISCOVERY target to the latest available preview version along with a managed application.
92+
You have to specify the path to the managed application.
93+
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 0x08000000, mind the hexadecimal format).
94+
95+
```console
96+
nanoff --update --target ST_STM32F769I_DISCOVERY --binfile "c:\dev\my awesome app\bin\debug\my_awesome_app.bin" --address 0x08000000
97+
```
98+
99+
### List all STM32 devices available with JTAG connection
100+
101+
This useful to list all STM32 devices that are connected through JTAG.
102+
103+
```console
104+
nanoff --listjtag
105+
```
106+
107+
### List all STM32 devices available with DFU connection
108+
109+
This useful to list all STM32 devices that are connected through DFU.
110+
111+
```console
112+
nanoff --listdfu
113+
```
114+
115+
### Tool output verbosity
116+
117+
The tool output verbosity can be set through the `v|verbosity` option.
118+
119+
This is convenient, for example, if this tool is being used in a automated process where the minimum output is desired to ease processing the return result of the execution. It can be set to:
120+
121+
- q[uiet]
122+
- m[inimal]
123+
- n[ormal]
124+
- d[etailed]
125+
- diag[nostic]
126+
127+
```console
128+
nanoff -v q
129+
```
130+
131+
## Exit codes
132+
133+
The exit codes can be checked in [this source file](https://github.com/nanoframework/nanoFirmwareFlasher/blob/develop/source/nanoFirmwareFlasher/ExitCodes.cs).
134+
135+
## Feedback and documentation
136+
137+
To provide feedback, report issues and finding out how to contribute please refer to the [Home repo](https://github.com/nanoframework/Home).
138+
139+
Join our Discord community [here](https://discord.gg/gCyBu8T).
140+
141+
## Credits
142+
143+
The list of contributors to this project can be found at [CONTRIBUTORS](https://github.com/nanoframework/Home/blob/master/CONTRIBUTORS.md).
144+
145+
## License
146+
147+
The **nanoFramework** ESP32 firmware flasher tool is licensed under the [MIT license](https://opensource.org/licenses/MIT).
148+
149+
## Code of Conduct
150+
151+
This project has adopted the code of conduct defined by the [Contributor Covenant](https://github.com/nanoframework/.github/blob/master/CODE_OF_CONDUCT.md)
152+
to clarify expected behavior in our community.

azure-pipelines.yml

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
trigger:
2+
branches:
3+
include: ["master", "develop", "release*", "refs/tags/*" ]
4+
paths:
5+
exclude: [ "doc", "*.md", ".gitignore" ]
6+
7+
pr:
8+
branches:
9+
include: ["master", "develop", "release*"]
10+
autoCancel: true
11+
12+
# add nf-tools repo to resources (for Azure Pipelines templates)
13+
resources:
14+
repositories:
15+
- repository: templates
16+
type: github
17+
name: nanoframework/nf-tools
18+
endpoint: nanoframework
19+
20+
jobs:
21+
22+
##############################
23+
- job: Get_Build_Options
24+
pool:
25+
vmImage: 'VS2017-Win2016'
26+
27+
steps:
28+
- checkout: self
29+
30+
# build tool
31+
- job: Build_tool
32+
33+
pool:
34+
vmImage: 'VS2017-Win2016'
35+
36+
variables:
37+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
38+
buildPlatform: 'Any CPU'
39+
buildConfiguration: 'Release'
40+
solution: 'source\nanoFirmwareFlasher.sln'
41+
42+
steps:
43+
44+
# need this here in order to persist GitHub credentials
45+
- checkout: self
46+
persistCredentials: true
47+
48+
- script: |
49+
git config --global user.email "[email protected]"
50+
git config --global user.name "nfbot"
51+
displayName: Setup git identity
52+
53+
- task: NuGetToolInstaller@0
54+
inputs:
55+
versionSpec: '4.9.3'
56+
displayName: 'Install specifc version of NuGet'
57+
58+
- task: DotNetCoreInstaller@0
59+
inputs:
60+
packageType: sdk
61+
version: 2.1.500
62+
displayName: Install .NET Core SDK
63+
64+
- task: DotNetCoreCLI@2
65+
inputs:
66+
command: restore
67+
verbosityRestore: minimal # detailed, normal, minimal
68+
projects: source\nanoFirmwareFlasher.sln
69+
feedsToUse: config
70+
nugetConfigPath: source/NuGet.Config
71+
workingDirectory: source
72+
displayName: Restore NuGet packages
73+
74+
- script: dotnet build -c $(BuildConfiguration) /p:PublicRelease=true --no-restore /t:build,pack"
75+
workingDirectory: source
76+
displayName: Build NuGet package
77+
78+
- script: dotnet build -c $(BuildConfiguration) /p:PublicRelease=true /p:PackGlobalTool=true --no-restore /t:build,pack"
79+
workingDirectory: source
80+
displayName: Build .NET Core Tool NuGet package
81+
82+
- task: PowerShell@2
83+
inputs:
84+
targetType: 'inline'
85+
script: |
86+
$MyNuGetVersion = $env:NBGV_NuGetPackageVersion -replace "\-g$env:NBGV_GitCommitIdShort", ""
87+
88+
# replace preview with alpha if this is a PR build
89+
if($env:Build_Reason -eq 'PullRequest')
90+
{
91+
$MyNuGetVersion = $MyNuGetVersion -replace "preview", "alpha"
92+
}
93+
94+
Write-Host "NuGet build number is $MyNuGetVersion"
95+
96+
Write-Host "$("##vso[task.setvariable variable=MY_NUGET_VERSION]")$MyNuGetVersion"
97+
condition: succeeded()
98+
displayName: Get NuGet build number
99+
100+
# update could build number (only possible if this is not a PR from a fork)
101+
- task: PowerShell@2
102+
inputs:
103+
targetType: 'inline'
104+
script: Write-Host "$("##vso[build.updatebuildnumber]")$env:NBGV_NuGetPackageVersion"
105+
condition: and( succeeded(), ne(variables['system.pullrequest.isfork'], true) )
106+
displayName: Update cloud build number
107+
108+
- powershell: |
109+
# get subject and commit message for commit
110+
$commitMessage = git log --format='%B' -1
111+
112+
# need to flatten message by removing new lines
113+
$commitMessage = $commitMessage -replace "`r`n", " "
114+
115+
if($commitMessage -like "***PUBLISH_RELEASE***")
116+
{
117+
# set variable
118+
Write-Host "$("##vso[task.setvariable variable=RELEASE_DRAFT]")false"
119+
Write-Host "Release draft: FALSE"
120+
}
121+
else
122+
{
123+
# set variable
124+
Write-Host "$("##vso[task.setvariable variable=RELEASE_DRAFT]")true"
125+
Write-Host "Release draft: TRUE"
126+
}
127+
128+
displayName: set release draft var
129+
130+
- task: CopyFiles@1
131+
inputs:
132+
sourceFolder: $(Build.SourcesDirectory)
133+
Contents: |
134+
**\*.nupkg
135+
TargetFolder: '$(Build.ArtifactStagingDirectory)'
136+
flattenFolders: true
137+
condition: succeeded()
138+
displayName: Collecting deployable artifacts
139+
140+
# publish artifacts (only possible if this is not a PR originated on a fork)
141+
- task: PublishBuildArtifacts@1
142+
inputs:
143+
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
144+
ArtifactName: deployables
145+
ArtifactType: Container
146+
condition: and( succeeded(), ne(variables['system.pullrequest.isfork'], true) )
147+
displayName: Publish deployables artifacts
148+
149+
# push NuGet packages to AzureArtifacts feed (always happens except on PR builds)
150+
- task: NuGetCommand@2
151+
inputs:
152+
command: push
153+
nuGetFeedType: external
154+
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
155+
publishFeedCredentials: 'AzureArtifacts'
156+
condition: succeeded()
157+
continueOnError: true
158+
displayName: Push NuGet packages to AzureArtifacts
159+
160+
# push NuGet class lib package to NuGet (happens on tag builds for any branch)
161+
- task: NuGetCommand@2
162+
inputs:
163+
command: push
164+
nuGetFeedType: external
165+
allowPackageConflicts: true
166+
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
167+
publishFeedCredentials: 'NuGet'
168+
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') )
169+
continueOnError: true
170+
displayName: Push NuGet packages to NuGet
171+
172+
# create or update GitHub release
173+
- task: GitHubReleasePublish@1
174+
inputs:
175+
githubEndpoint: 'nanoFramework'
176+
githubOwner: 'nanoframework'
177+
githubRepositoryName: 'nanoFirmwareFlasher '
178+
githubTag: v$(MY_NUGET_VERSION)
179+
githubReleaseTitle: 'nano firmware flasher v$(MY_NUGET_VERSION)'
180+
githubReleaseNotes: 'add description here'
181+
githubTargetCommitsh: $(Build.SourceVersion)
182+
githubReleaseDraft: $(RELEASE_DRAFT)
183+
githubReleasePrerelease: true
184+
githubReuseDraftOnly: true
185+
githubReuseRelease: true
186+
githubEditRelease: true
187+
githubDeleteEmptyTag: true
188+
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
189+
condition: and( succeeded(), not( startsWith(variables['Build.SourceBranch'], 'refs/pull') ), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
190+
displayName: Create/Update GitHub release
191+
192+
# create or update GitHub release ON tags from release or master branches
193+
- task: GitHubReleasePublish@1
194+
inputs:
195+
githubEndpoint: 'nanoFramework'
196+
githubOwner: 'nanoframework'
197+
githubRepositoryName: 'nanoFirmwareFlasher '
198+
githubTag: v$(MY_NUGET_VERSION)
199+
githubReleaseTitle: 'nano firmware flasher v$(MY_NUGET_VERSION)'
200+
githubReleaseNotes: 'add description here'
201+
githubTargetCommitsh: $(Build.SourceVersion)
202+
githubReleaseDraft: $(RELEASE_DRAFT)
203+
githubReleasePrerelease: true
204+
githubReuseDraftOnly: false
205+
githubReuseRelease: true
206+
githubEditRelease: true
207+
githubDeleteEmptyTag: true
208+
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
209+
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), contains(variables['Build.SourceBranch'], 'preview') )
210+
displayName: Create/Update GitHub PREVIEW release
211+
212+
# create or update GitHub release ON tags from release or master branches
213+
- task: GitHubReleasePublish@1
214+
inputs:
215+
githubEndpoint: 'nanoFramework'
216+
githubOwner: 'nanoframework'
217+
githubRepositoryName: 'nanoFirmwareFlasher '
218+
githubTag: v$(MY_NUGET_VERSION)
219+
githubReleaseTitle: 'nano firmware flasher v$(MY_NUGET_VERSION)'
220+
githubReleaseNotes: 'add description here'
221+
githubTargetCommitsh: $(Build.SourceVersion)
222+
githubReleaseDraft: false
223+
githubReleasePrerelease: false
224+
githubReuseDraftOnly: false
225+
githubReuseRelease: false
226+
githubEditRelease: false
227+
githubDeleteEmptyTag: true
228+
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/$(nugetPackageName).$(MY_NUGET_VERSION).nupkg'
229+
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), not(contains(variables['Build.SourceBranch'], 'preview') ) )
230+
displayName: Create/Update GitHub stable release

source/NuGet.Config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="NuGet" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
<add key="MyGet nanoFramework dev" value="https://www.myget.org/F/nanoframework-dev/api/v3/index.json" protocolVersion="3" />
6+
</packageSources>
7+
</configuration>

0 commit comments

Comments
 (0)