Skip to content

Commit d9b0b1a

Browse files
authored
Miscellaneous improvements (#112)
1 parent 7981511 commit d9b0b1a

33 files changed

+184
-69
lines changed

content/building/build-esp32.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# How to Build, Flash and Debug the ESP32 nanoCLR on Windows using Visual Code
22

3+
⚠️ NOTE about the need to build .NET **nanoFramework** firmware ⚠️
4+
5+
You only need to build it if you plan to debug the native code, add new targets or add new features at native level.
6+
If your goal is to code in C# you just have to flash your MCU with the appropriate firmware image.
7+
There are available ready to flash firmware images for several targets, please check the [Home](https://github.com/nanoframework/Home#firmware-for-reference-boards) repository.
8+
39
## About this document
410

5-
This document describes how to build the required images for .NET **nanoFramework** for ESP32 targets.
11+
This document describes how to build the required images for .NET **nanoFramework** firmware for ESP32 targets.
612
The build is based on CMake tool to ease the development in all major platforms.
713

814
## Using Dev Container
@@ -74,17 +80,17 @@ After cloning the repo, you need to setup the build environment. You can use the
7480

7581
![idf tools location](../../images/building/esp32/install-esp-idf-tools-location.png)
7682

77-
-**Step 5**: At the options screen, know that you don't have to install all the tools there. Follow the recomended option to be able to build .NET nanoFramework. Also note that you may want to install the toolchains only for the chip serie(s) that you're planning to build for.
83+
-**Step 5**: At the options screen, know that you don't have to install all the tools there. Follow the recommended option to be able to build .NET nanoFramework. Also note that you may want to install the toolchains only for the chip serie(s) that you're planning to build for.
7884

7985
![options](../../images/building/esp32/install-esp-idf-tools-options.png)
8086

8187
-**Step 6**: The install step may prompt you for permission on installing drivers and launch secondary installers. And be aware that it can take a while to complete...
8288

83-
-**Step 7**: After the installer completes, open a command prompt at the IDF repository location with elevated permisssion and execute the script `install`. This will *hopefully* install all the requirements and prerequisites.
89+
-**Step 7**: After the installer completes, open a command prompt at the IDF repository location with elevated permission and execute the script `install`. This will *hopefully* install all the requirements and prerequisites.
8490

85-
-**Step 8**: Now execute the script `export`. This will *hopefully* update the path environement variable of your machine. You can check the success of the operation by opening another cmd prompt and print the content of the path variable.
91+
-**Step 8**: Now execute the script `export`. This will *hopefully* update the path environment variable of your machine. You can check the success of the operation by opening another cmd prompt and print the content of the path variable.
8692

87-
-**Step 9**: Calling the above scripts it's not 100% guaranteed to effectivelly install everything and updates the path. This can be because of permission issues, updating the path variable and others. Here's the image of the path on a machine where the update was succesfull so you can compare it.
93+
-**Step 9**: Calling the above scripts it's not 100% guaranteed to effectively install everything and updates the path. This can be because of permission issues, updating the path variable and others. Here's the image of the path on a machine where the update was successful so you can compare it.
8894

8995
![updated path](../../images/building/esp32/install-esp-idf-tools-path.png)
9096

content/building/build-in-visual-studio.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Building .NET **nanoFramework** in Visual Studio
22

3+
⚠️ NOTE about the need to build .NET **nanoFramework** firmware ⚠️
4+
5+
You only need to build it if you plan to debug the native code, add new targets or add new features at native level.
6+
If your goal is to code in C# you just have to flash your MCU with the appropriate firmware image.
7+
There are available ready to flash firmware images for several targets, please check the [Home](https://github.com/nanoframework/Home#firmware-for-reference-boards) repository.
8+
39
## Developing firmware for the nanoframework using Visual Studio 2019 community edition
410

511
[(See below for VS2017)](#developing-firmware-for-the-nanoframework-using-visual-studio-2017-community-edition)

content/building/build-instructions.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Building .NET **nanoFramework**
1+
# Building .NET **nanoFramework** firmware
22

33
.NET **nanoFramework** build system is based in CMake. Please read the instructions specific to each target series.
44

@@ -7,9 +7,15 @@
77
- [NXP](build-nxp.md)
88
- [Using Dev Container](using-dev-container.md)
99

10+
⚠️ NOTE about the need to build .NET **nanoFramework** firmware ⚠️
11+
12+
You only need to build it if you plan to debug the native code, add new targets or add new features at native level.
13+
If your goal is to code in C# you just have to flash your MCU with the appropriate firmware image.
14+
There are available ready to flash firmware images for several targets, please check the [Home](https://github.com/nanoframework/Home#firmware-for-reference-boards) repository.
15+
1016
## About this document
1117

12-
This document describes how to build the required images for .NET **nanoFramework** to be flashed in a SoC or MCU.
18+
This document describes how to build the required images for .NET **nanoFramework** firmware to be flashed in a SoC or MCU.
1319
The build is based on CMake tool to ease the development in all major platforms.
1420

1521
## Using Dev Container
@@ -36,8 +42,8 @@ If you are using VS Code as your development platform we suggest that you use th
3642

3743
In case you specify an RTOS and you want its source to be downloaded from the official repository, you'll need:
3844

39-
- For FreeRTOS a SVN client. [Tortoise SVN](https://tortoisesvn.net/downloads) seems to be a popular choice for Windows machines.
40-
- For ChibiOS a Git client. [GitHub Desktop](https://desktop.github.com/) seems to be a popular choice for Windows machines.
45+
- For ChibiOS a SVN client. [Tortoise SVN](https://tortoisesvn.net/downloads) seems to be a popular choice for Windows machines.
46+
- For all the other repositories a Git client. [Fork](https://git-fork.com/) it's a great visual git client packed with a lot of features or [GitHub Desktop](https://desktop.github.com/) seems to be a popular choice for Windows machines.
4147

4248
## Preparation
4349

@@ -48,11 +54,11 @@ In case you need to clean up or start a fresh build all you have to do is simply
4854

4955
As a suggestion we recommend that you create a directory named *build* in the repository root and run CMake from there.
5056

51-
## Build a .NET **nanoFramework** image
57+
## Build a .NET **nanoFramework** firmware image
5258

5359
The build script accepts the a number of parameters (some of them are mandatory). Please check the details about each parameter [here](cmake-tools-cmake-variants.md#content-explained).
5460

55-
_Note 1: The RTOS currently supported (except for ESP32 target) is ChibiOS. If no source path is specified the source files will be downloaded from nanoFramework GitHub fork._
61+
_Note 1: The RTOSes currently supported (except for ESP32 target) are ChibiOS and FreeRTOS. If no source path is specified the source files will be downloaded from nanoFramework GitHub fork._
5662
_Note 2: the very first build will take more or less time depending on the download speed of the Internet connection of the machine were the build is running. This is because the source code of the RTOS of your choice will be downloaded from its repository. On the subsequent builds this won't happen._
5763

5864
You can specify any generator that is supported in the platform where you are building.
@@ -87,12 +93,12 @@ cmake \
8793
-DCHIBIOS_BOARD=ST_NUCLEO144_F746ZG \
8894
-DTARGET_SERIES=STM32F7xx \
8995
-DNF_FEATURE_DEBUGGER=TRUE \
90-
-DAPI_Windows.Devices.Gpio=ON \
96+
-DAPI_System.Device.Gpio=ON \
9197
-DNF_FEATURE_RTC=ON \
9298
-G "NMake Makefiles" ../
9399
```
94100

95-
This will call CMake (on your *build* directory that is assumed to be under the repository root) specifying the location of the toolchain install, specifying that ChibiOS sources to be used are located in the designated path (mind the forward slash and no ending slash), that the target board is named ST_NUCLEO144_F746ZG, that STM32F7xx is the series name that it belongs to, debugger feature is to be included, Windows.Devices.Gpio API is to be included, RTC is used and that the build files suitable for NMake are to be generated.
101+
This will call CMake (on your *build* directory that is assumed to be under the repository root) specifying the location of the toolchain install, specifying that ChibiOS sources to be used are located in the designated path (mind the forward slash and no ending slash), that the target board is named ST_NUCLEO144_F746ZG, that STM32F7xx is the series name that it belongs to, debugger feature is to be included, System.Device.Gpio API is to be included, RTC is used and that the build files suitable for NMake are to be generated.
96102

97103
After successful completion you'll have the build files ready to be used in the target build tool.
98104

@@ -106,9 +112,9 @@ Follows a brief explanation on the files you might want to tweak.
106112
- launch.json (inside .vscode folder) here you can set up your launch configurations, such as gdb path or OpenOCD configuration. We've made available Gists with launch.json for several of the reference targets. Grab yours from [here](https://gist.github.com/nfbot). :warning: Remember to update paths and other preferences according to your setup and machine configuration. :wink:
107113
- cmake-variants.json (at the repository root) here you can add several build flavors. You can even add variants to each one. Check the documentation extension [here](https://vector-of-bool.github.io/docs/vscode-cmake-tools/variants.html#). We've made available Gists with cmake-variants.json for each of the reference targets. Grab yours from [here](https://gist.github.com/nfbot). :warning: Remember to update paths and other preferences according to your setup and machine configuration. :wink:
108114

109-
To launch the build in VS Code check the status bar at the bottom. Select the build flavor and then click the build button (or hit F7).
115+
To launch the build in VS Code check the status bar at the bottom. Select the build flavour and then click the build button (or hit <kbd>F7</kbd>).
110116

111-
## .NET **nanoFramework** build deliverables
117+
## .NET **nanoFramework** firmware build deliverables
112118

113119
After a successful build you can find the .NET **nanoFramework** image files in the *build* directory. Those are:
114120

content/building/build-nxp.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# How to Build, Flash and Debug the NXP nanoBooter and nanoCLR on Windows using Visual Studio Code
22

3+
⚠️ NOTE about the need to build .NET **nanoFramework** firmware ⚠️
4+
5+
You only need to build it if you plan to debug the native code, add new targets or add new features at native level.
6+
If your goal is to code in C# you just have to flash your MCU with the appropriate firmware image.
7+
There are available ready to flash firmware images for several targets, please check the [Home](https://github.com/nanoframework/Home#firmware-for-reference-boards) repository.
8+
39
## About this document
410

5-
This document describes how to build the required images for .NET **nanoFramework** for NXP targets.
11+
This document describes how to build the required images for .NET **nanoFramework** firmware for NXP targets.
612
The build is based on CMake tool to ease the development in all major platforms.
713

814
## Using Dev Container
@@ -42,7 +48,7 @@ To simplify: this guide we will put all our tools and source in easily accessibl
4248

4349
1. Run the PowerShell script that's on the `install-scripts` folder that will download and install all the required tools.
4450
`.\install-stm32-tools.ps1 -Path 'C:\nftools'`
45-
For best results, run in an elevated command prompt, otherwise setting system environnement variables will fail.
51+
For best results, run in an elevated command prompt, otherwise setting system environment variables will fail.
4652
1. Review and adjust several JSON files to match your environment (as documented below)
4753
1. Restart Visual Studio Code (due to json changes)
4854

content/building/build-stm32.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# How to Build, Flash and Debug the STM32 nanoBooter and nanoCLR on Windows using Visual Studio Code
22

3+
⚠️ NOTE about the need to build .NET **nanoFramework** firmware ⚠️
4+
5+
You only need to build it if you plan to debug the native code, add new targets or add new features at native level.
6+
If your goal is to code in C# you just have to flash your MCU with the appropriate firmware image.
7+
There are available ready to flash firmware images for several targets, please check the [Home](https://github.com/nanoframework/Home#firmware-for-reference-boards) repository.
8+
39
## About this document
410

5-
This document describes how to build the required images for .NET **nanoFramework** for STM32 targets.
11+
This document describes how to build the required images for .NET **nanoFramework** firmware for STM32 targets.
612
The build is based on CMake tool to ease the development in all major platforms.
713

814
## Using Dev Container
@@ -41,7 +47,7 @@ To simplify: this guide we will put all our tools and source in easily accessibl
4147

4248
1. Run the PowerShell script that's on the `install-scripts` folder that will download and install all the required tools.
4349
`.\install-nf-tools.ps1 -TargetSeries STM32 -Path 'C:\nftools'`
44-
For best results, run in an elevated command prompt, otherwise setting system environnement variables will fail.
50+
For best results, run in an elevated command prompt, otherwise setting system environment variables will fail.
4551
1. Review and adjust several JSON files to match your environment (as documented below)
4652
1. Restart Visual Studio Code (due to json changes)
4753

content/building/build-win32.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Building .NET nanoFramework - WIN32
22

3+
⚠️ NOTE about the need to build .NET **nanoFramework** firmware ⚠️
4+
5+
You only need to build it if you plan to debug the native code, add new targets or add new features at native level.
6+
If your goal is to code in C# you just have to flash your MCU with the appropriate firmware image.
7+
There are available ready to flash firmware images for several targets, please check the [Home](https://github.com/nanoframework/Home#firmware-for-reference-boards) repository.
8+
39
The WIN32 version meant to be used for high level debugging, feature testing and Unit Testing for other projects.
410
It's a VC++ solution which can be build using Visual Studio.
511

content/building/cmake/ninja-build.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Using Ninja to build .NET **nanoFramework**
1+
# Using Ninja to build .NET **nanoFramework** firmware
22

33
## Inside VS Code using CMake Tools
44

@@ -10,7 +10,7 @@ To setup the CMake tools to build using Ninja you have to follow the following s
1010
4. Find a line for `"cmake.configureSettings"`. This is were the full path to the Nina executable should be set. Mind the forward slashes.
1111
If you don't have one just add a block like this: `"cmake.configureSettings": { "CMAKE_MAKE_PROGRAM": "E:/ninja/ninja.exe" },`
1212

13-
And that is it! Hit F7 or click the build configuration options for CMake Tools at the bottom toolbar.
13+
And that is it! Hit <kbd>F7</kbd> or click the build configuration options for CMake Tools at the bottom toolbar.
1414

1515
## Performance comparison
1616

content/building/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Building .NET **nanoFramework**
22

3-
* [Building .NET **nanoFramework**](build-instructions.md)
3+
* [Building .NET **nanoFramework** firmware](build-instructions.md)
44
* [Build using local source for RTOS](rtos-source-for-build.md)
55
* [CMake variants for CMake tools](cmake-tools-cmake-variants.md)
66
* [Building in Visual Studio](build-in-visual-studio.md)
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
# Building .NET **nanoFramework** with local RTOS source vs RTOS source from repository
1+
# Building .NET **nanoFramework** firmware with local RTOS source vs RTOS source from repository
22

3-
When building .NET **nanoFramework** for a CMSIS target (currently only ChibiOS is supported) the developer has two options: either using a local path for the RTOS source code or downloading it from the official repository.
3+
When building .NET **nanoFramework** firmware the developer has two options: either using a local path for the RTOS source code or downloading it from the official repository.
44
This document aims to give you an brief overview of the differences between these two so you can choose the option that best fits your use scenario.
55

66
## Source from official repository
77

8-
When running CMake, if the parameter `-DCHIBIOS_SOURCE` is not not specified CMake will connect to **nanoFrameworks** [ChibiOS mirror](https://github.com/nanoframework/ChibiOS) on GitHub and will clone the source from there. The time for this operation to complete will mostly depend on the speed of your internet connection.
8+
When running CMake, if the parameter `-DRTOS_SOURCE_FOLDER` is not not specified CMake will connect to the respective official repository and will clone the source from there. The time for this operation to complete will mostly depend on the speed of your internet connection.
99

10-
ChibiOS will be cached within the build directory so the full download won't happen again unless the build directory is cleared. A check for any changes in the repo is made whenever a build is run. If there are any, the changes will be downloaded and merged.
10+
The RTOS will be cached within the build directory so the full download won't happen again unless the build directory is cleared. A check for any changes in the upstream repository it's performed whenever a build is run. If there are any, the changes will be downloaded and merged.
1111

12-
This option is good for automated builds or when you don't have (or don't want) the repo cloned to your local storage device.
12+
This option it's great for automated builds or when you don't have (or don't want) the repo cloned to your local storage device.
1313

1414
Another advantage is that you don't have to manage the updates to the local clone yourself.
1515

1616
An obvious disadvantage is that if the build folder is cleaned (required when switching between target boards) the 'cached' repo will be gone and a full download will occur when the project is next built.
1717

1818
## Source from local clone
1919

20-
When running CMake, if the parameter `-DCHIBIOS_SOURCE="....."` is specified a local clone located at the designated path will be used when the build occurs.
21-
The only _timing penalty_ is the one necessary for CMake to copy the contents of the local ChibiOS repo to the build cache folder. This is a one time operation and it won't happen again unless the build folder is cleaned up.
20+
When running CMake, if the parameter `-DRTOS_SOURCE_FOLDER="....."` is specified, a local clone located at the designated path will be used when the build occurs.
21+
The only _timing penalty_ is the one necessary for CMake to copy the contents of the local RTOS repo to the build cache folder. This is a one time operation and it won't happen again unless the build folder is cleaned up.
2222

23-
This option is good when you have a local clone of the repo and you don't want to increase the build time with checks on the repo and downloading it or wish to target a different branch (such as `master`).
23+
This option is preferable when you have a local clone of the repo and you don't want to increase the build time with checks on the repo and downloading it or wish to target a different branch.
2424

25-
The downside is that you have to manage the update process for the ChibiOS repo yourself.
25+
The downside is that you have to manage the update process for the RTOS repo yourself.
2626

27-
Another important aspect to consider is the branch **to _manually_ checkout**. Not doing this is synonym of using the 'master' branch that contains the development files and is not a stable version, which is probably not what you want to use.
28-
So, make sure that you checkout the branch matching the currently supported stable version. In doubt ask in the Discord channel.
27+
Another important aspect to consider is the branch or tag that you have to **to _manually_ checkout**. Not doing this is synonym of using the default branch that contains the development files and is not a stable version, which is probably not what you want to use.
28+
So, make sure that you checkout the branch or tag matching the currently supported stable version. In doubt ask in the Discord channel.
2929

3030
Also here, if the build folder is cleaned the 'cached' repo will be gone.

0 commit comments

Comments
 (0)