From afccf8e9189111798a85b4b0f921129af0ddf05f Mon Sep 17 00:00:00 2001 From: nfbot Date: Fri, 10 Jul 2020 11:14:36 +0000 Subject: [PATCH 01/14] Set version to '1.16.0-preview.{height}' --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 2f17c2b5..cd2bc313 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.15.0-preview.{height}", + "version": "1.16.0-preview.{height}", "assemblyVersion": { "precision": "revision" }, From 4e0b0c3891d5441d8ccf39707be57b1c6cab8932 Mon Sep 17 00:00:00 2001 From: josesimoes Date: Mon, 13 Jul 2020 14:10:13 +0100 Subject: [PATCH 02/14] Work CD-CI - Update location of build artifacts. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6b226850..d1ae229b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -223,7 +223,7 @@ jobs: condition: succeeded() displayName: Collecting deployable artifacts inputs: - sourceFolder: $(Build.SourcesDirectory) + sourceFolder: $(Agent.BuildDirectory) Contents: | **\*.nupkg TargetFolder: '$(Build.ArtifactStagingDirectory)' From 6a7c744a738fa95c8376e19685420e077c8b0085 Mon Sep 17 00:00:00 2001 From: josesimoes Date: Wed, 26 Aug 2020 17:07:02 +0100 Subject: [PATCH 03/14] Work CD-CI - Update condition to check for PR build. ***NO_CI*** --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d1ae229b..d5206aa3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -180,7 +180,7 @@ jobs: $MyNuGetVersion = $env:NBGV_NuGetPackageVersion -replace "\-g$env:NBGV_GitCommitIdShort", "" # replace preview with alpha if this is a PR build - if($env:Build_Reason -eq 'PullRequest') + if($env:System_PullRequest_PullRequestId -ne '') { $MyNuGetVersion = $MyNuGetVersion -replace "preview", "alpha" } @@ -251,7 +251,7 @@ jobs: # push NuGet class lib package to NuGet (happens on tag builds for any branch) - task: NuGetCommand@2 - condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') ) + condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], '') ) displayName: Push NuGet packages to NuGet continueOnError: true inputs: @@ -263,7 +263,7 @@ jobs: # create or update GitHub release ON tags from release or master branches - task: GitHubReleasePublish@1 - condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) ) + condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) ) displayName: Create/Update GitHub PREVIEW release inputs: githubEndpoint: 'nanoFramework' From 5d445c5582e3728c108fcbde4cdc3bd1a59ed084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 24 Sep 2020 01:05:08 +0100 Subject: [PATCH 04/14] Update and rename LICENSE to LICENSE.md ***NO_CI*** --- LICENSE => LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename LICENSE => LICENSE.md (95%) diff --git a/LICENSE b/LICENSE.md similarity index 95% rename from LICENSE rename to LICENSE.md index 2f8bd981..94286c94 100644 --- a/LICENSE +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 nanoFramework +Copyright (c) .NET Foundation and Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 7a5979f2e7090c89d6f9cc72f4ce555ea73d11ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 24 Sep 2020 01:10:03 +0100 Subject: [PATCH 05/14] Update README.md ***NO_CI*** --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c238d7b7..6036c7b7 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ The list of contributors to this project can be found at [CONTRIBUTORS](https:// ## License -The **nanoFramework** firmware flasher tool is licensed under the [MIT license](https://opensource.org/licenses/MIT). +The **nanoFramework** firmware flasher tool is licensed under the [MIT license](LICENSE.md). ## Code of Conduct From d64059882744060f73657f7116ae8a557e0ed34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 24 Sep 2020 01:12:44 +0100 Subject: [PATCH 06/14] Update README.md ***NO_CI*** --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6036c7b7..457b286d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![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/nanoFirmwareFlasher/_apis/build/status/nanoframework.nanoFirmwareFlasher?branchName=develop)](https://dev.azure.com/nanoframework/nanoFirmwareFlasher/_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) +[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![#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/nanoFirmwareFlasher/_apis/build/status/nanoframework.nanoFirmwareFlasher?branchName=develop)](https://dev.azure.com/nanoframework/nanoFirmwareFlasher/_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) ![nanoFramework logo](https://github.com/nanoframework/Home/blob/master/resources/logo/nanoFramework-repo-logo.png) From f8c87eb47282781db3b59fc163a18a55604734b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 24 Sep 2020 01:13:07 +0100 Subject: [PATCH 07/14] Rename LICENSE.md to LICENSE ***NO_CI*** --- LICENSE.md => LICENSE | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE.md => LICENSE (100%) diff --git a/LICENSE.md b/LICENSE similarity index 100% rename from LICENSE.md rename to LICENSE From 3d19a54fe54e92ab8a322aa8dc5b09b57cf7cd18 Mon Sep 17 00:00:00 2001 From: josesimoes Date: Fri, 25 Sep 2020 17:01:43 +0100 Subject: [PATCH 08/14] Update copyright headers ***NO_CI*** --- nanoFirmwareFlasher/BintrayPackageInfo.cs | 2 +- nanoFirmwareFlasher/CC13x26x2Device.cs | 2 +- nanoFirmwareFlasher/CC13x26x2Firmware.cs | 2 +- nanoFirmwareFlasher/CC13x26x2Operations.cs | 2 +- nanoFirmwareFlasher/Esp32Firmware.cs | 2 +- nanoFirmwareFlasher/Esp32Operations.cs | 2 +- nanoFirmwareFlasher/EspTool.cs | 2 +- .../Exceptions/CantConnectToJtagDeviceException.cs | 2 +- nanoFirmwareFlasher/Exceptions/CantOpenDfuDeviceException.cs | 2 +- nanoFirmwareFlasher/Exceptions/DfuFileDoesNotExistException.cs | 2 +- nanoFirmwareFlasher/Exceptions/DfuOperationFailedException.cs | 2 +- nanoFirmwareFlasher/Exceptions/EraseEsp32FlashException.cs | 2 +- nanoFirmwareFlasher/Exceptions/EspToolExecutionException.cs | 2 +- nanoFirmwareFlasher/Exceptions/ReadEsp32FlashException.cs | 2 +- nanoFirmwareFlasher/Exceptions/StLinkCliExecutionException.cs | 2 +- nanoFirmwareFlasher/Exceptions/UniflashCliExecutionException.cs | 2 +- nanoFirmwareFlasher/Exceptions/WriteEsp32FlashException.cs | 2 +- nanoFirmwareFlasher/ExitCodes.cs | 2 +- nanoFirmwareFlasher/Extensions/AttributeExtensions.cs | 2 +- nanoFirmwareFlasher/Extensions/CommandLineExtensions.cs | 2 +- nanoFirmwareFlasher/FirmwarePackage.cs | 2 +- nanoFirmwareFlasher/Options.cs | 2 +- nanoFirmwareFlasher/Program.cs | 2 +- nanoFirmwareFlasher/Stm32Firmware.cs | 2 +- nanoFirmwareFlasher/Stm32Operations.cs | 2 +- nanoFirmwareFlasher/StmDfuDevice.cs | 2 +- nanoFirmwareFlasher/StmJtagDevice.cs | 2 +- nanoFirmwareFlasher/nanoFirmwareFlasher.csproj | 2 +- nanoFirmwareFlasher/update_esptool.ps1 | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/nanoFirmwareFlasher/BintrayPackageInfo.cs b/nanoFirmwareFlasher/BintrayPackageInfo.cs index 3075d7e4..d30a16d0 100644 --- a/nanoFirmwareFlasher/BintrayPackageInfo.cs +++ b/nanoFirmwareFlasher/BintrayPackageInfo.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/CC13x26x2Device.cs b/nanoFirmwareFlasher/CC13x26x2Device.cs index e429ab65..0077d47c 100644 --- a/nanoFirmwareFlasher/CC13x26x2Device.cs +++ b/nanoFirmwareFlasher/CC13x26x2Device.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/CC13x26x2Firmware.cs b/nanoFirmwareFlasher/CC13x26x2Firmware.cs index b897b0e2..7ad67dab 100644 --- a/nanoFirmwareFlasher/CC13x26x2Firmware.cs +++ b/nanoFirmwareFlasher/CC13x26x2Firmware.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/CC13x26x2Operations.cs b/nanoFirmwareFlasher/CC13x26x2Operations.cs index 4f1ee3c9..ea69992f 100644 --- a/nanoFirmwareFlasher/CC13x26x2Operations.cs +++ b/nanoFirmwareFlasher/CC13x26x2Operations.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Esp32Firmware.cs b/nanoFirmwareFlasher/Esp32Firmware.cs index e5adde8d..6775f2ca 100644 --- a/nanoFirmwareFlasher/Esp32Firmware.cs +++ b/nanoFirmwareFlasher/Esp32Firmware.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Esp32Operations.cs b/nanoFirmwareFlasher/Esp32Operations.cs index 8edca633..8e5137b7 100644 --- a/nanoFirmwareFlasher/Esp32Operations.cs +++ b/nanoFirmwareFlasher/Esp32Operations.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/EspTool.cs b/nanoFirmwareFlasher/EspTool.cs index ec26b6dc..b423b6fb 100644 --- a/nanoFirmwareFlasher/EspTool.cs +++ b/nanoFirmwareFlasher/EspTool.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Exceptions/CantConnectToJtagDeviceException.cs b/nanoFirmwareFlasher/Exceptions/CantConnectToJtagDeviceException.cs index 53f0f432..29c40049 100644 --- a/nanoFirmwareFlasher/Exceptions/CantConnectToJtagDeviceException.cs +++ b/nanoFirmwareFlasher/Exceptions/CantConnectToJtagDeviceException.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Exceptions/CantOpenDfuDeviceException.cs b/nanoFirmwareFlasher/Exceptions/CantOpenDfuDeviceException.cs index fd296931..24dcd59e 100644 --- a/nanoFirmwareFlasher/Exceptions/CantOpenDfuDeviceException.cs +++ b/nanoFirmwareFlasher/Exceptions/CantOpenDfuDeviceException.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Exceptions/DfuFileDoesNotExistException.cs b/nanoFirmwareFlasher/Exceptions/DfuFileDoesNotExistException.cs index 5303e701..7968dd70 100644 --- a/nanoFirmwareFlasher/Exceptions/DfuFileDoesNotExistException.cs +++ b/nanoFirmwareFlasher/Exceptions/DfuFileDoesNotExistException.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Exceptions/DfuOperationFailedException.cs b/nanoFirmwareFlasher/Exceptions/DfuOperationFailedException.cs index 63be5676..cef4c993 100644 --- a/nanoFirmwareFlasher/Exceptions/DfuOperationFailedException.cs +++ b/nanoFirmwareFlasher/Exceptions/DfuOperationFailedException.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Exceptions/EraseEsp32FlashException.cs b/nanoFirmwareFlasher/Exceptions/EraseEsp32FlashException.cs index 0e45018a..ddb4c640 100644 --- a/nanoFirmwareFlasher/Exceptions/EraseEsp32FlashException.cs +++ b/nanoFirmwareFlasher/Exceptions/EraseEsp32FlashException.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Exceptions/EspToolExecutionException.cs b/nanoFirmwareFlasher/Exceptions/EspToolExecutionException.cs index edbd17ba..5da9ab89 100644 --- a/nanoFirmwareFlasher/Exceptions/EspToolExecutionException.cs +++ b/nanoFirmwareFlasher/Exceptions/EspToolExecutionException.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Exceptions/ReadEsp32FlashException.cs b/nanoFirmwareFlasher/Exceptions/ReadEsp32FlashException.cs index 7b72a455..b3a2b6c7 100644 --- a/nanoFirmwareFlasher/Exceptions/ReadEsp32FlashException.cs +++ b/nanoFirmwareFlasher/Exceptions/ReadEsp32FlashException.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Exceptions/StLinkCliExecutionException.cs b/nanoFirmwareFlasher/Exceptions/StLinkCliExecutionException.cs index 5bf11cf6..fb57a22c 100644 --- a/nanoFirmwareFlasher/Exceptions/StLinkCliExecutionException.cs +++ b/nanoFirmwareFlasher/Exceptions/StLinkCliExecutionException.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Exceptions/UniflashCliExecutionException.cs b/nanoFirmwareFlasher/Exceptions/UniflashCliExecutionException.cs index 5a5ad058..e55f5dca 100644 --- a/nanoFirmwareFlasher/Exceptions/UniflashCliExecutionException.cs +++ b/nanoFirmwareFlasher/Exceptions/UniflashCliExecutionException.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Exceptions/WriteEsp32FlashException.cs b/nanoFirmwareFlasher/Exceptions/WriteEsp32FlashException.cs index d2892ac8..d3f27b27 100644 --- a/nanoFirmwareFlasher/Exceptions/WriteEsp32FlashException.cs +++ b/nanoFirmwareFlasher/Exceptions/WriteEsp32FlashException.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/ExitCodes.cs b/nanoFirmwareFlasher/ExitCodes.cs index 54e997c3..a5b9e6c6 100644 --- a/nanoFirmwareFlasher/ExitCodes.cs +++ b/nanoFirmwareFlasher/ExitCodes.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Extensions/AttributeExtensions.cs b/nanoFirmwareFlasher/Extensions/AttributeExtensions.cs index b6f5402b..85474547 100644 --- a/nanoFirmwareFlasher/Extensions/AttributeExtensions.cs +++ b/nanoFirmwareFlasher/Extensions/AttributeExtensions.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Extensions/CommandLineExtensions.cs b/nanoFirmwareFlasher/Extensions/CommandLineExtensions.cs index 11a6c3ef..f140261a 100644 --- a/nanoFirmwareFlasher/Extensions/CommandLineExtensions.cs +++ b/nanoFirmwareFlasher/Extensions/CommandLineExtensions.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/FirmwarePackage.cs b/nanoFirmwareFlasher/FirmwarePackage.cs index 3dae74af..79c2500a 100644 --- a/nanoFirmwareFlasher/FirmwarePackage.cs +++ b/nanoFirmwareFlasher/FirmwarePackage.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Options.cs b/nanoFirmwareFlasher/Options.cs index e787f2c1..9fbcaf0f 100644 --- a/nanoFirmwareFlasher/Options.cs +++ b/nanoFirmwareFlasher/Options.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Program.cs b/nanoFirmwareFlasher/Program.cs index c22bf78d..cded4973 100644 --- a/nanoFirmwareFlasher/Program.cs +++ b/nanoFirmwareFlasher/Program.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Stm32Firmware.cs b/nanoFirmwareFlasher/Stm32Firmware.cs index 61d5e133..7a723caa 100644 --- a/nanoFirmwareFlasher/Stm32Firmware.cs +++ b/nanoFirmwareFlasher/Stm32Firmware.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/Stm32Operations.cs b/nanoFirmwareFlasher/Stm32Operations.cs index 2fd57532..abaa7ce9 100644 --- a/nanoFirmwareFlasher/Stm32Operations.cs +++ b/nanoFirmwareFlasher/Stm32Operations.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/StmDfuDevice.cs b/nanoFirmwareFlasher/StmDfuDevice.cs index 2499a9e6..daefce5c 100644 --- a/nanoFirmwareFlasher/StmDfuDevice.cs +++ b/nanoFirmwareFlasher/StmDfuDevice.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2019 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/StmJtagDevice.cs b/nanoFirmwareFlasher/StmJtagDevice.cs index 5575a20a..4275dc7e 100644 --- a/nanoFirmwareFlasher/StmJtagDevice.cs +++ b/nanoFirmwareFlasher/StmJtagDevice.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // diff --git a/nanoFirmwareFlasher/nanoFirmwareFlasher.csproj b/nanoFirmwareFlasher/nanoFirmwareFlasher.csproj index 0ff36aff..7dba33e1 100644 --- a/nanoFirmwareFlasher/nanoFirmwareFlasher.csproj +++ b/nanoFirmwareFlasher/nanoFirmwareFlasher.csproj @@ -10,7 +10,7 @@ nanoFramework.Tools.FirmwareFlasher nanoFramework project contributors nanoFramework Firmware Flasher - Copyright (c) 2019 nanoFramework project contributors + Copyright (c) .NET Foundation and Contributors nanoFramework git https://github.com/nanoframework/nanoFirmwareFlasher diff --git a/nanoFirmwareFlasher/update_esptool.ps1 b/nanoFirmwareFlasher/update_esptool.ps1 index d0d251c0..bfc60009 100644 --- a/nanoFirmwareFlasher/update_esptool.ps1 +++ b/nanoFirmwareFlasher/update_esptool.ps1 @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 The nanoFramework project contributors +# Copyright (c) .NET Foundation and Contributors # See LICENSE file in the project root for full license information. # From 6cbedd0505e0177bc9172bd76cd841b2847ca73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 25 Sep 2020 18:47:45 +0100 Subject: [PATCH 09/14] Update README.md ***NO_CI*** --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 457b286d..e7354672 100644 --- a/README.md +++ b/README.md @@ -186,5 +186,9 @@ The **nanoFramework** firmware flasher tool is licensed under the [MIT license]( ## Code of Conduct -This project has adopted the code of conduct defined by the [Contributor Covenant](https://github.com/nanoframework/.github/blob/master/CODE_OF_CONDUCT.md) -to clarify expected behavior in our community. +This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. +For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct). + +### .NET Foundation + +This project is supported by the [.NET Foundation](https://dotnetfoundation.org). From b0d12e5186ee23e70b673d6cf64158dc1f923811 Mon Sep 17 00:00:00 2001 From: Lord Asdi <42315126+LordAsdi@users.noreply.github.com> Date: Wed, 25 Nov 2020 20:19:19 +0100 Subject: [PATCH 10/14] Updated dead links in README.md (#42) ***NO_CI*** --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7354672..0fed9a74 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ nanoff -v q ## Exit codes -The exit codes can be checked in [this source file](https://github.com/nanoframework/nanoFirmwareFlasher/blob/develop/source/nanoFirmwareFlasher/ExitCodes.cs). +The exit codes can be checked in [this source file](https://github.com/nanoframework/nanoFirmwareFlasher/blob/develop/nanoFirmwareFlasher/ExitCodes.cs). ## Feedback and documentation @@ -182,7 +182,7 @@ The list of contributors to this project can be found at [CONTRIBUTORS](https:// ## License -The **nanoFramework** firmware flasher tool is licensed under the [MIT license](LICENSE.md). +The **nanoFramework** firmware flasher tool is licensed under the [MIT license](LICENSE). ## Code of Conduct From 72f7edfd0886da1e1c47279d9b0887c566a21305 Mon Sep 17 00:00:00 2001 From: josesimoes Date: Thu, 3 Dec 2020 08:08:45 +0000 Subject: [PATCH 11/14] Default verbosity is now detailed - Considering that 99% of use case are developers in CLI, it doesn't make sense to force them to have add this option. When using it in automation scenarious the option to use quiet output can be specified. ***NO_CI*** --- nanoFirmwareFlasher/Options.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanoFirmwareFlasher/Options.cs b/nanoFirmwareFlasher/Options.cs index 9fbcaf0f..a0ab882c 100644 --- a/nanoFirmwareFlasher/Options.cs +++ b/nanoFirmwareFlasher/Options.cs @@ -142,7 +142,7 @@ public class Options 'v', "verbosity", Required = false, - Default = "n", + Default = "d", HelpText = "Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command; see specific command page to determine if this option is available.")] public string Verbosity { get; set; } From ac132927aba075dc8dce3eaaf7890cf2a997fc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 3 Dec 2020 09:12:15 +0000 Subject: [PATCH 12/14] Add cache folder (#43) --- nanoFirmwareFlasher/FirmwarePackage.cs | 275 ++++++++++++++++++------- version.json | 2 +- 2 files changed, 201 insertions(+), 76 deletions(-) diff --git a/nanoFirmwareFlasher/FirmwarePackage.cs b/nanoFirmwareFlasher/FirmwarePackage.cs index 79c2500a..aa7185f4 100644 --- a/nanoFirmwareFlasher/FirmwarePackage.cs +++ b/nanoFirmwareFlasher/FirmwarePackage.cs @@ -7,8 +7,10 @@ using System; using System.IO; using System.IO.Compression; +using System.Linq; using System.Net; using System.Net.Http; +using System.Text.RegularExpressions; namespace nanoFramework.Tools.FirmwareFlasher { @@ -64,132 +66,243 @@ protected FirmwarePackage(string targetName, string fwVersion, bool stable) /// a dictionary which keys are the start addresses and the values are the complete filenames (the bin files) protected async System.Threading.Tasks.Task DownloadAndExtractAsync() { + string fwFileName = null; + // reference targets var repoName = _stable ? _refTargetsStableRepo : _refTargetsDevRepo; string requestUri = $"{_bintrayApiPackages}/{repoName}/{_targetName}"; - if (Verbosity >= VerbosityLevel.Normal) + // flag to signal if the work-flow step was successful + bool stepSuccesful = false; + + // flag to skip download if the fw package exists and it's recent + bool skipDownload = false; + + // setup download folder + // set download path + LocationPath = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), + ".nanoFramework"); + + try { - Console.Write($"Trying to find {_targetName} in {(_stable ? "stable" : "developement")} repository..."); + // create home directory + Directory.CreateDirectory(LocationPath); + + // add readme file + File.WriteAllText( + Path.Combine( + LocationPath, + "README.txt"), + _readmeContent); + + // set location path to target folder + LocationPath = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), + ".nanoFramework", + _targetName); } + catch + { + Console.WriteLine(""); - HttpResponseMessage response = await _bintrayClient.GetAsync(requestUri); + return ExitCodes.E9006; + } - if (response.StatusCode == HttpStatusCode.NotFound) + var fwFiles = Directory.EnumerateFiles(LocationPath, $"{_targetName}-*.zip").OrderByDescending(f => f).ToList(); + + if (fwFiles.Any()) { - if (Verbosity >= VerbosityLevel.Normal) + // get file creation date (from the 1st one) + if ((DateTime.UtcNow - File.GetLastWriteTimeUtc(fwFiles.First())).TotalHours < 4) { - Console.WriteLine(""); - Console.Write($"Trying to find {_targetName} in community targets repository..."); + // fw package has less than 4 hours + // skip download + skipDownload = true; } + } + + if (!skipDownload) + { + // try to perform request + try + { + if (Verbosity >= VerbosityLevel.Normal) + { + Console.Write($"Trying to find {_targetName} in {(_stable ? "stable" : "developement")} repository..."); + } - // try with community targets - requestUri = $"{_bintrayApiPackages}/{_communityTargetsepo}/{_targetName}"; - repoName = _communityTargetsepo; + HttpResponseMessage response = await _bintrayClient.GetAsync(requestUri); - response = await _bintrayClient.GetAsync(requestUri); + if (response.StatusCode == HttpStatusCode.NotFound) + { + if (Verbosity >= VerbosityLevel.Normal) + { + Console.WriteLine(""); + Console.Write($"Trying to find {_targetName} in community targets repository..."); + } + + // try with community targets + requestUri = $"{_bintrayApiPackages}/{_communityTargetsepo}/{_targetName}"; + repoName = _communityTargetsepo; + + response = await _bintrayClient.GetAsync(requestUri); + + if (response.StatusCode == HttpStatusCode.NotFound) + { + if (Verbosity >= VerbosityLevel.Normal) + { + Console.WriteLine(""); + } + + // can't find this target + return ExitCodes.E9005; + } + } - if (response.StatusCode == HttpStatusCode.NotFound) - { if (Verbosity >= VerbosityLevel.Normal) { - Console.WriteLine(""); + Console.WriteLine($"OK"); } - // can't find this target - return ExitCodes.E9005; - } - } + // read and parse response + string responseBody = await response.Content.ReadAsStringAsync(); + BintrayPackageInfo packageInfo = JsonConvert.DeserializeObject(responseBody); - if (Verbosity >= VerbosityLevel.Normal) - { - Console.WriteLine($"OK"); + // if no specific version was requested, use latest available + if (string.IsNullOrEmpty(_fwVersion)) + { + _fwVersion = packageInfo.LatestVersion; + } - Console.Write($"Downloading firmware package..."); + // set exposed property + Version = _fwVersion; + + stepSuccesful = true; + } + catch + { + // exception with download, assuming it's something with network connection or Bintray API + } } - // read and parse response - string responseBody = await response.Content.ReadAsStringAsync(); - BintrayPackageInfo packageInfo = JsonConvert.DeserializeObject(responseBody); + // cleanup any fw file in the folder + var filesToDelete = Directory.EnumerateFiles(LocationPath, "*.bin").ToList(); + filesToDelete.AddRange(Directory.EnumerateFiles(LocationPath, "*.hex").ToList()); + filesToDelete.AddRange(Directory.EnumerateFiles(LocationPath, "*.s19").ToList()); + filesToDelete.AddRange(Directory.EnumerateFiles(LocationPath, "*.dfu").ToList()); - // if no specific version was requested, use latest available - if (string.IsNullOrEmpty(_fwVersion)) + foreach (var file in filesToDelete) { - _fwVersion = packageInfo.LatestVersion; + File.Delete(file); } - // set exposed property - Version = _fwVersion; - - // setup download folder - try + // check for file existence or download one + if (stepSuccesful && + !skipDownload) { - // set download path - LocationPath = Path.Combine( - Path.GetTempPath(), - Guid.NewGuid().ToString()); + // reset flag + stepSuccesful = false; - // create directory - Directory.CreateDirectory(LocationPath); + fwFileName = $"{_targetName}-{_fwVersion}.zip"; - if (Verbosity >= VerbosityLevel.Normal) + // check if we already have the file + if (!File.Exists( + Path.Combine( + LocationPath, + fwFileName))) { - Console.WriteLine("OK"); + if (Verbosity >= VerbosityLevel.Normal) + { + Console.Write($"Downloading firmware package..."); + } + + try + { + // setup and perform download request + requestUri = $"https://dl.bintray.com/nfbot/{repoName}/{fwFileName}"; + + using (var fwFileResponse = await _bintrayClient.GetAsync(requestUri)) + { + if (fwFileResponse.IsSuccessStatusCode) + { + using (var readStream = await fwFileResponse.Content.ReadAsStreamAsync()) + { + using (var fileStream = new FileStream( + Path.Combine(LocationPath, fwFileName), + FileMode.Create, FileAccess.Write)) + { + await readStream.CopyToAsync(fileStream); + } + } + } + else + { + return ExitCodes.E9007; + } + } + + if (Verbosity >= VerbosityLevel.Normal) + { + Console.WriteLine("OK"); + } + + stepSuccesful = true; + } + catch + { + // exception with download, assuming it's something with network connection or Bintray API + } } else { - Console.WriteLine(""); + // file already exists + stepSuccesful = true; } - - if (Verbosity >= VerbosityLevel.Detailed) - { - Console.WriteLine($"Download location is {LocationPath}"); - } - - // add readme file - File.WriteAllText( - Path.Combine( - LocationPath, - "README.txt"), - _readmeContent); } - catch + + if (!stepSuccesful) { - Console.WriteLine(""); + // couldn't download the fw file + // check if there is one available + fwFiles = Directory.EnumerateFiles(LocationPath, $"{_targetName}-*.zip").OrderByDescending(f => f).ToList(); - return ExitCodes.E9006; - } + if (fwFiles.Any()) + { + // take the 1st one + fwFileName = fwFiles.First(); - // setup and perform download request - string fwFileName = $"{_targetName}-{_fwVersion}.zip"; - requestUri = $"https://dl.bintray.com/nfbot/{repoName}/{fwFileName}"; + // get the version form the file name + var pattern = @"(\d+\.\d+\.\d+)(\.\d+|-.+)(?=\.zip)"; + var match = Regex.Matches(fwFileName, pattern, RegexOptions.IgnoreCase); - using (var fwFileResponse = await _bintrayClient.GetAsync(requestUri)) - { - if (fwFileResponse.IsSuccessStatusCode) - { - using (var readStream = await fwFileResponse.Content.ReadAsStreamAsync()) + // set property + Version = match[0].Value; + + if (Verbosity >= VerbosityLevel.Normal) { - using (var fileStream = new FileStream( - Path.Combine(LocationPath, fwFileName), - FileMode.Create, FileAccess.Write)) - { - await readStream.CopyToAsync(fileStream); - } + Console.WriteLine("Using cached firmware package"); } } else { + // no fw file available + + if (Verbosity >= VerbosityLevel.Normal) + { + Console.WriteLine("Failure to download package and couldn't find one in the cache."); + } + return ExitCodes.E9007; } } - Console.WriteLine($"Updating to {_fwVersion}"); + // got here, must have a file! // unzip the firmware if (Verbosity >= VerbosityLevel.Detailed) { - Console.Write($"Extracting {fwFileName}..."); + Console.Write($"Extracting {Path.GetFileName(fwFileName)}..."); } ZipFile.ExtractToDirectory( @@ -198,9 +311,21 @@ protected async System.Threading.Tasks.Task DownloadAndExtractAsync() if (Verbosity >= VerbosityLevel.Detailed) { - Console.WriteLine(""); + Console.WriteLine("OK"); } + // be nice to the user and delete any fw packages other than the last one + var allFwFiles = Directory.EnumerateFiles(LocationPath, "*.zip").OrderByDescending(f => f).ToList(); + if (allFwFiles.Count > 1) + { + foreach (var file in allFwFiles.Skip(1)) + { + File.Delete(file); + } + } + + Console.WriteLine($"Updating to {Version}"); + return ExitCodes.OK; } diff --git a/version.json b/version.json index cd2bc313..3fa120eb 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.16.0-preview.{height}", + "version": "1.16.1-preview.{height}", "assemblyVersion": { "precision": "revision" }, From abb81dcdf4ecf3983cc12e9699eb9fb041bd5aec Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 13 Mar 2021 22:58:19 +0000 Subject: [PATCH 13/14] Fix ST devices that cannot handle DFU packages (#44) --- nanoFirmwareFlasher/Program.cs | 9 +++++++-- nanoFirmwareFlasher/Stm32Firmware.cs | 7 ++----- nanoFirmwareFlasher/Stm32Operations.cs | 12 ++++++++++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/nanoFirmwareFlasher/Program.cs b/nanoFirmwareFlasher/Program.cs index cded4973..e5fc240d 100644 --- a/nanoFirmwareFlasher/Program.cs +++ b/nanoFirmwareFlasher/Program.cs @@ -473,7 +473,10 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o) return; } - if (!string.IsNullOrEmpty(o.DfuFile)) + var connectedStDfuDevices = StmDfuDevice.ListDfuDevices(); + var connectedStJtagDevices = StmJtagDevice.ListDevices(); + + if (!string.IsNullOrEmpty(o.DfuFile) && connectedStDfuDevices.Count != 0) { // there is a DFU file argument, so follow DFU path var dfuDevice = new StmDfuDevice(o.DfuDeviceId); @@ -522,7 +525,9 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o) } else if ( o.BinFile.Any() && - o.HexFile.Any()) + o.HexFile.Any() && + connectedStJtagDevices.Count != 0 + ) { // this has to be a JTAG connected device diff --git a/nanoFirmwareFlasher/Stm32Firmware.cs b/nanoFirmwareFlasher/Stm32Firmware.cs index 7a723caa..63ec6cf4 100644 --- a/nanoFirmwareFlasher/Stm32Firmware.cs +++ b/nanoFirmwareFlasher/Stm32Firmware.cs @@ -40,11 +40,8 @@ public Stm32Firmware(string targetName, string fwVersion, bool stable) { DfuPackage = dfuFile.FirstOrDefault(); } - else - { - nanoBooterFile = Directory.EnumerateFiles(LocationPath, "nanoBooter.hex").FirstOrDefault(); - nanoCLRFile = Directory.EnumerateFiles(LocationPath, "nanoCLR.hex").FirstOrDefault(); - } + nanoBooterFile = Directory.EnumerateFiles(LocationPath, "nanoBooter.hex").FirstOrDefault(); + nanoCLRFile = Directory.EnumerateFiles(LocationPath, "nanoCLR.hex").FirstOrDefault(); } return executionResult; diff --git a/nanoFirmwareFlasher/Stm32Operations.cs b/nanoFirmwareFlasher/Stm32Operations.cs index abaa7ce9..38b94334 100644 --- a/nanoFirmwareFlasher/Stm32Operations.cs +++ b/nanoFirmwareFlasher/Stm32Operations.cs @@ -85,8 +85,11 @@ internal static async System.Threading.Tasks.Task UpdateFirmwareAsync } } + var connectedStDfuDevices = StmDfuDevice.ListDfuDevices(); + var connectedStJtagDevices = StmJtagDevice.ListDevices(); + // need DFU or JTAG device - if (firmware.HasDfuPackage) + if (firmware.HasDfuPackage && connectedStDfuDevices.Count !=0) { // DFU package dfuDevice = new StmDfuDevice(dfuDeviceId); @@ -120,7 +123,7 @@ internal static async System.Threading.Tasks.Task UpdateFirmwareAsync return ExitCodes.E1003; } } - else + else if (connectedStJtagDevices.Count != 0) { // JATG device jtagDevice = new StmJtagDevice(jtagId); @@ -162,6 +165,11 @@ internal static async System.Threading.Tasks.Task UpdateFirmwareAsync return programResult; } + else + { + // no device was found to update. + return ExitCodes.E7000; + } } internal static ExitCodes ResetMcu( From d98d6a31b709b91905266a5acccb115daba01fd3 Mon Sep 17 00:00:00 2001 From: nfbot Date: Sat, 13 Mar 2021 23:16:24 +0000 Subject: [PATCH 14/14] Set version to '1.16.1' --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 3fa120eb..1b242364 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.16.1-preview.{height}", + "version": "1.16.1", "assemblyVersion": { "precision": "revision" },