diff --git a/.gitmodules b/.gitmodules
index 72726db3..4078391d 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
[submodule "nf-interpreter"]
- path = nf-interpreter
+ path = source/native/nf-interpreter
url = https://github.com/nanoframework/nf-interpreter
diff --git a/README.md b/README.md
index 2ba6145b..66ff55f6 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,9 @@ This repo contains **nanoFramework** metadata processor tool.
It's a console app that performs various tasks when running a build of a C# project, like parsing the PE file generated by Roslyn, generating the PDBX files, generate the stubs for native code.
Is part of **nanoFramework** toolbox, along with other various tools that are required in **nanoFramework** development, usage or repository management.
+Version 2.0 is a C# application adapted from the original work of [Oleg Rakhmatulin](@OlegRa).
+Version 1.0 was a Visual C++ application adapted from .NETMF toolbox.
+
## Feedback and documentation
To provide feedback, report issues and finding out how to contribute please refer to the [Home repo](https://github.com/nanoframework/Home).
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 3605056a..8b6406b6 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -115,9 +115,9 @@ jobs:
- task: NuGetCommand@2
inputs:
command: 'custom'
- arguments: 'pack source\Tools.MetaDataProcessor\package.nuspec -Version $(NBGV_NuGetPackageVersion)'
+ arguments: 'pack source\MetadataProcessor.Console\package.nuspec -Version $(NBGV_NuGetPackageVersion)'
condition: succeeded()
- displayName: Pack NuGet with MDP tool
+ displayName: Pack NuGet for MDP tool
- task: CopyFiles@1
inputs:
@@ -145,6 +145,7 @@ jobs:
nuGetFeedType: external
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
publishFeedCredentials: 'AzureArtifacts'
+ continueOnError: true
condition: succeeded()
displayName: Push NuGet packages to Azure Artifacts
diff --git a/nf-interpreter b/nf-interpreter
deleted file mode 160000
index 73389fad..00000000
--- a/nf-interpreter
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 73389fad32cba0175ccc666f76c6d02c211d594b
diff --git a/source/MetadataProcessor.Console/FodyWeavers.xml b/source/MetadataProcessor.Console/FodyWeavers.xml
new file mode 100644
index 00000000..0ed55b76
--- /dev/null
+++ b/source/MetadataProcessor.Console/FodyWeavers.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ CommandLine
+ nanoFramework.Tools.MetadataProcessor*
+ Mono.*
+
+
+
diff --git a/source/MetadataProcessor.Console/FodyWeavers.xsd b/source/MetadataProcessor.Console/FodyWeavers.xsd
new file mode 100644
index 00000000..44a53744
--- /dev/null
+++ b/source/MetadataProcessor.Console/FodyWeavers.xsd
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+ A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks
+
+
+
+
+ A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.
+
+
+
+
+ A list of unmanaged 32 bit assembly names to include, delimited with line breaks.
+
+
+
+
+ A list of unmanaged 64 bit assembly names to include, delimited with line breaks.
+
+
+
+
+ The order of preloaded assemblies, delimited with line breaks.
+
+
+
+
+
+ This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.
+
+
+
+
+ Controls if .pdbs for reference assemblies are also embedded.
+
+
+
+
+ Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.
+
+
+
+
+ As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.
+
+
+
+
+ Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.
+
+
+
+
+ Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.
+
+
+
+
+ A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |
+
+
+
+
+ A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.
+
+
+
+
+ A list of unmanaged 32 bit assembly names to include, delimited with |.
+
+
+
+
+ A list of unmanaged 64 bit assembly names to include, delimited with |.
+
+
+
+
+ The order of preloaded assemblies, delimited with |.
+
+
+
+
+
+
+
+ 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
+
+
+
+
+ A comma-separated list of error codes that can be safely ignored in assembly verification.
+
+
+
+
+ 'false' to turn off automatic generation of the XML Schema file.
+
+
+
+
+
\ No newline at end of file
diff --git a/source/MetadataProcessor.Console/MetadataProcessor.Console.csproj b/source/MetadataProcessor.Console/MetadataProcessor.Console.csproj
new file mode 100644
index 00000000..c8333759
--- /dev/null
+++ b/source/MetadataProcessor.Console/MetadataProcessor.Console.csproj
@@ -0,0 +1,88 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {A9E02E14-7321-4B12-8AB5-9A0408ED8FD0}
+ Exe
+ nanoFramework.Tools.MetadataProcessor.Console
+ nanoFramework.Tools.MetadataProcessor
+ v4.6.1
+
+
+
+
+
+ true
+ full
+ false
+ bin\Debug
+ DEBUG;
+ prompt
+ 4
+ true
+
+
+ full
+ true
+ bin\Release
+ prompt
+ 4
+ true
+
+
+
+ ..\packages\CommandLineParser.2.6.0\lib\net461\CommandLine.dll
+
+
+ ..\packages\Costura.Fody.3.3.3\lib\net40\Costura.dll
+
+
+ ..\packages\Mono.Cecil.0.11.1\lib\net40\Mono.Cecil.dll
+
+
+ ..\packages\Mono.Cecil.0.11.1\lib\net40\Mono.Cecil.Mdb.dll
+
+
+ ..\packages\Mono.Cecil.0.11.1\lib\net40\Mono.Cecil.Pdb.dll
+
+
+ ..\packages\Mono.Cecil.0.11.1\lib\net40\Mono.Cecil.Rocks.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Designer
+
+
+
+
+ {e32f7d15-2499-440c-8026-4d5ee1c5ec3a}
+ MetadataProcessor.Core
+ True
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/MetadataProcessor.Console/Options.cs b/source/MetadataProcessor.Console/Options.cs
new file mode 100644
index 00000000..34d76397
--- /dev/null
+++ b/source/MetadataProcessor.Console/Options.cs
@@ -0,0 +1,38 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using CommandLine;
+using System.Collections.Generic;
+
+namespace nanoFramework.Tools.MetadataProcessor.Console
+{
+ public class Options
+ {
+
+ [Option(
+ "parse",
+ Required = false,
+ Default = null,
+ HelpText = "Analyses .NET assembly.")]
+ public string Parse { get; set; }
+
+ [Option(
+ "compile",
+ Required = false,
+ Default = null,
+ HelpText = "Compiles an assembly into nanoCLR format.")]
+ public string Compile { get; set; }
+
+ [Option(
+ "loadhints",
+ Separator = ' ',
+ Required = false,
+ HelpText = "Loads one (or more) assembly file(s) as a dependency(ies).")]
+ public IEnumerable LoadHints { get; set; }
+
+
+ }
+}
diff --git a/source/MetadataProcessor.Console/Program.cs b/source/MetadataProcessor.Console/Program.cs
new file mode 100644
index 00000000..2a100270
--- /dev/null
+++ b/source/MetadataProcessor.Console/Program.cs
@@ -0,0 +1,172 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using CommandLine;
+using CommandLine.Text;
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Xml;
+
+namespace nanoFramework.Tools.MetadataProcessor.Console
+{
+ internal static class MainClass
+ {
+ private sealed class MetadataProcessor
+ {
+ private readonly IDictionary _loadHints =
+ new Dictionary(StringComparer.Ordinal);
+
+ private AssemblyDefinition _assemblyDefinition;
+
+ public void Parse(string fileName)
+ {
+ try
+ {
+ _assemblyDefinition = AssemblyDefinition.ReadAssembly(fileName,
+ new ReaderParameters { AssemblyResolver = new LoadHintsAssemblyResolver(_loadHints)});
+ }
+ catch (Exception)
+ {
+ System.Console.Error.WriteLine(
+ "Unable to parse input assembly file '{0}' - check if path and file exists.", fileName);
+ Environment.Exit(1);
+ }
+ }
+
+ public void Compile(string fileName)
+ {
+ try
+ {
+ var builder = new nanoAssemblyBuilder(_assemblyDefinition);
+
+ using (var stream = File.Open(fileName, FileMode.Create, FileAccess.ReadWrite))
+ using (var writer = new BinaryWriter(stream))
+ {
+ builder.Write(GetBinaryWriter(writer));
+ }
+
+ using (var writer = XmlWriter.Create(Path.ChangeExtension(fileName, "pdbx")))
+ {
+ builder.Write(writer);
+ }
+ }
+ catch (Exception)
+ {
+ System.Console.Error.WriteLine(
+ "Unable to compile output assembly file '{0}' - check parse command results.", fileName);
+ throw;
+ }
+ }
+
+ private nanoBinaryWriter GetBinaryWriter(BinaryWriter writer)
+ {
+ return nanoBinaryWriter.CreateLittleEndianBinaryWriter(writer);
+ }
+
+ public void AddLoadHint(
+ string assemblyName,
+ string assemblyFileName)
+ {
+ _loadHints[assemblyName] = assemblyFileName;
+ }
+ }
+
+ public static void Main(string[] args)
+ {
+ // grab the assembly version
+ var informationalVersionAttribute = Attribute.GetCustomAttribute(
+ Assembly.GetEntryAssembly(),
+ typeof(AssemblyInformationalVersionAttribute))
+ as AssemblyInformationalVersionAttribute;
+
+ // build header information
+ var headerInfo = $"nanoFramework MetadataProcessor Utility v{informationalVersionAttribute.InformationalVersion}";
+ var copyrightInfo = new CopyrightInfo(true, $"nanoFramework project contributors", 2019);
+
+ // output header to console
+ System.Console.WriteLine($"nanoFramework MetadataProcessor Utility v{informationalVersionAttribute.InformationalVersion}");
+ System.Console.WriteLine("Copyright (c) 2019 nanoFramework project contributors");
+ System.Console.WriteLine();
+ System.Console.WriteLine("For documentation, report issues and support visit our GitHub repo: www.github.com\\nanoFramework");
+ System.Console.WriteLine();
+ System.Console.WriteLine();
+
+ // check for empty argument collection
+ if (!args.Any())
+ {
+ // no argument provided, show help text and usage examples
+
+ // because of short-comings in CommandLine parsing
+ // need to customize the output to provide a consistent output
+ var parser = new Parser(config => config.HelpWriter = null);
+ var result = parser.ParseArguments(new string[] { "", "" });
+
+ var helpText = new HelpText(
+ new HeadingInfo(headerInfo),
+ copyrightInfo)
+ .AddPreOptionsLine("No command was provided.")
+ .AddPreOptionsLine("")
+ .AddPreOptionsLine(HelpText.RenderUsageText(result))
+ .AddPreOptionsLine("")
+ .AddOptions(result);
+
+ System.Console.WriteLine(helpText.ToString());
+
+ return;
+ }
+
+ var parsedArguments = Parser.Default.ParseArguments(args);
+
+ parsedArguments
+ .WithParsed(opts => RunOptionsAndReturnExitCode(opts))
+ .WithNotParsed(errors => HandleErrors(errors));
+ }
+
+ static void RunOptionsAndReturnExitCode(Options o)
+ {
+ var md = new MetadataProcessor();
+
+ // arguments have to be processed in this order, otherwise the parsing will fail
+
+ // load hints
+ if (o.LoadHints.Any())
+ {
+ // load hints should be provided in the format: AssemblyName FilePath
+ // like in --loadhints mscorlib e:\folder\where\the\assembly\is\mscorlib.dll
+ // the LoadHints argument already provides the assembly details separated
+
+ int hintCount = 0;
+
+ do
+ {
+ md.AddLoadHint(o.LoadHints.ElementAt(hintCount++), o.LoadHints.ElementAt(hintCount++));
+ }
+ while (hintCount < o.LoadHints.Count());
+ }
+
+ // parse assembly
+ if (!string.IsNullOrEmpty(o.Parse))
+ {
+ md.Parse(o.Parse);
+ }
+
+ // compile PE
+ if (!string.IsNullOrEmpty(o.Compile))
+ {
+ md.Compile(o.Compile);
+ }
+ }
+
+ static void HandleErrors(IEnumerable errors)
+ {
+ // empty on purpose
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Console/Properties/AssemblyInfo.cs b/source/MetadataProcessor.Console/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..bbae2c0a
--- /dev/null
+++ b/source/MetadataProcessor.Console/Properties/AssemblyInfo.cs
@@ -0,0 +1,12 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle ("nanoFramework.MetadataProcessor.Console")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("nanoFramework project contributors")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("Copyright (c) 2019 The nanoFramework project contributors")]
diff --git a/source/MetadataProcessor.Console/app.config b/source/MetadataProcessor.Console/app.config
new file mode 100644
index 00000000..3dbff35f
--- /dev/null
+++ b/source/MetadataProcessor.Console/app.config
@@ -0,0 +1,3 @@
+
+
+
diff --git a/source/Tools.MetaDataProcessor/nanoFramework.Tools.MetaDataProcessor.targets b/source/MetadataProcessor.Console/nanoFramework.Tools.MetaDataProcessor.targets
similarity index 100%
rename from source/Tools.MetaDataProcessor/nanoFramework.Tools.MetaDataProcessor.targets
rename to source/MetadataProcessor.Console/nanoFramework.Tools.MetaDataProcessor.targets
diff --git a/source/MetadataProcessor.Console/package.nuspec b/source/MetadataProcessor.Console/package.nuspec
new file mode 100644
index 00000000..92ce174a
--- /dev/null
+++ b/source/MetadataProcessor.Console/package.nuspec
@@ -0,0 +1,30 @@
+
+
+
+ nanoFramework.Tools.MetadataProcessor
+ nanoFramework.Tools.MetadataProcessor
+ $version$
+ nanoFramework project contributors
+ nanoFramework project contributors
+
+ Metadata Processor tool to be used internally by the VS nanoFramework extension.
+
+
+
+
+ Metadata Processor tool to be used internally by the VS nanoFramework extension.
+
+ https://github.com/nanoframework/metadata-processor
+ https://secure.gravatar.com/avatar/97d0e092247f0716db6d4b47b7d1d1ad
+ false
+ https://github.com/nanoframework/metadata-processor/LICENSE
+ Copyright (c) 2019 The nanoFramework project contributors
+
+
+ nanoFramework, nano Framework, NETNF, NETMF, Micro Framework, .net
+
+
+
+
+
+
diff --git a/source/MetadataProcessor.Console/packages.config b/source/MetadataProcessor.Console/packages.config
new file mode 100644
index 00000000..6cd53721
--- /dev/null
+++ b/source/MetadataProcessor.Console/packages.config
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/MetadataProcessor.Core/Endianness/nanoBinaryWriter.cs b/source/MetadataProcessor.Core/Endianness/nanoBinaryWriter.cs
new file mode 100644
index 00000000..05d2ee10
--- /dev/null
+++ b/source/MetadataProcessor.Core/Endianness/nanoBinaryWriter.cs
@@ -0,0 +1,383 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Binary writer for .NET nanoFramework assemblies emitting. Supports different endianness.
+ ///
+ public abstract class nanoBinaryWriter
+ {
+ ///
+ /// Specialized big endian version of class.
+ ///
+ private sealed class BigEndianBinaryWriter : nanoBinaryWriter
+ {
+ ///
+ /// Emulates C++ union using explicit fields layout (with same zero offset)
+ ///
+ [StructLayout(LayoutKind.Explicit)]
+ private struct BytesMappingHelper
+ {
+ [FieldOffset(0)]
+ public ushort uint16Value;
+
+ [FieldOffset(0)]
+ public uint uint32Value;
+
+ [FieldOffset(0)]
+ public ulong uint64Value;
+
+ [FieldOffset(0)]
+ public float singleValue;
+
+ [FieldOffset(0)]
+ public double doubleValue;
+
+ [FieldOffset(0)]
+ public unsafe fixed byte bytes[8];
+ }
+
+ private BytesMappingHelper _helper;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// Base binary writer for operating on stream.
+ public BigEndianBinaryWriter(
+ BinaryWriter baseWriter)
+ : base(baseWriter)
+ {
+ }
+
+ ///
+ public override unsafe void WriteUInt16(ushort value)
+ {
+ _helper.uint16Value = value;
+ fixed (byte* pBytes = _helper.bytes)
+ {
+ _baseWriter.Write(pBytes[1]);
+ _baseWriter.Write(pBytes[0]);
+ }
+ }
+
+ ///
+ public override unsafe void WriteUInt32(uint value)
+ {
+ _helper.uint32Value = value;
+ fixed (byte* pBytes = _helper.bytes)
+ {
+ _baseWriter.Write(pBytes[3]);
+ _baseWriter.Write(pBytes[2]);
+ _baseWriter.Write(pBytes[1]);
+ _baseWriter.Write(pBytes[0]);
+ }
+ }
+
+ ///
+ public override unsafe void WriteUInt64(ulong value)
+ {
+ _helper.uint64Value = value;
+ fixed (byte* pBytes = _helper.bytes)
+ {
+ _baseWriter.Write(pBytes[7]);
+ _baseWriter.Write(pBytes[6]);
+ _baseWriter.Write(pBytes[5]);
+ _baseWriter.Write(pBytes[4]);
+ _baseWriter.Write(pBytes[3]);
+ _baseWriter.Write(pBytes[2]);
+ _baseWriter.Write(pBytes[1]);
+ _baseWriter.Write(pBytes[0]);
+ }
+ }
+
+ ///
+ public override unsafe void WriteSingle(float value)
+ {
+ _helper.singleValue = value;
+ fixed (byte* pBytes = _helper.bytes)
+ {
+ _baseWriter.Write(pBytes[3]);
+ _baseWriter.Write(pBytes[2]);
+ _baseWriter.Write(pBytes[1]);
+ _baseWriter.Write(pBytes[0]);
+ }
+ }
+
+ ///
+ public override unsafe void WriteDouble(double value)
+ {
+ _helper.doubleValue = value;
+ fixed (byte* pBytes = _helper.bytes)
+ {
+ _baseWriter.Write(pBytes[7]);
+ _baseWriter.Write(pBytes[6]);
+ _baseWriter.Write(pBytes[5]);
+ _baseWriter.Write(pBytes[4]);
+ _baseWriter.Write(pBytes[3]);
+ _baseWriter.Write(pBytes[2]);
+ _baseWriter.Write(pBytes[1]);
+ _baseWriter.Write(pBytes[0]);
+ }
+ }
+
+ ///
+ public override nanoBinaryWriter GetMemoryBasedClone(
+ MemoryStream stream)
+ {
+ return new BigEndianBinaryWriter(new BinaryWriter(stream));
+ }
+ }
+
+ ///
+ /// Specialized little endian version of class.
+ ///
+ private sealed class LittleEndianBinaryWriter : nanoBinaryWriter
+ {
+ ///
+ /// Creates new instance of object.
+ ///
+ /// Base binary writer for operating on stream.
+ public LittleEndianBinaryWriter(
+ BinaryWriter baseWriter)
+ : base(baseWriter)
+ {
+ }
+
+ ///
+ public override void WriteUInt16(ushort value)
+ {
+ _baseWriter.Write(value);
+ }
+
+ ///
+ public override void WriteUInt32(uint value)
+ {
+ _baseWriter.Write(value);
+ }
+
+ ///
+ public override void WriteUInt64(ulong value)
+ {
+ _baseWriter.Write(value);
+ }
+
+ ///
+ public override void WriteSingle(float value)
+ {
+ _baseWriter.Write(value);
+ }
+
+ ///
+ public override void WriteDouble(double value)
+ {
+ _baseWriter.Write(value);
+ }
+
+ ///
+ public override nanoBinaryWriter GetMemoryBasedClone(
+ MemoryStream stream)
+ {
+ return new LittleEndianBinaryWriter(new BinaryWriter(stream));
+ }
+ }
+
+ ///
+ /// Base binary writer instance for performing basic operation on underlying byte stream.
+ /// By design is always little endian regardless of platform.
+ ///
+ private readonly BinaryWriter _baseWriter;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// Base binary writer for operating on stream.
+ protected nanoBinaryWriter(
+ BinaryWriter baseWriter)
+ {
+ _baseWriter = baseWriter;
+ }
+
+ ///
+ /// Factory mathod for creating little endian version of class.
+ ///
+ /// Base binary writer for operating on stream.
+ ///
+ /// Instance of which writes bytes in little endian.
+ ///
+ public static nanoBinaryWriter CreateLittleEndianBinaryWriter(
+ BinaryWriter baseWriter)
+ {
+ return new LittleEndianBinaryWriter(baseWriter);
+ }
+
+ ///
+ /// Factory mathod for creating big endian version of class.
+ ///
+ /// Base binary writer for operating on stream.
+ ///
+ /// Instance of which writes bytes in big endian.
+ ///
+ public static nanoBinaryWriter CreateBigEndianBinaryWriter(
+ BinaryWriter baseWriter)
+ {
+ return new BigEndianBinaryWriter(baseWriter);
+ }
+
+ ///
+ /// Write single unsigned byte into underying stream.
+ ///
+ /// Unsigned byte value for writing.
+ public void WriteByte(byte value)
+ {
+ _baseWriter.Write(value);
+ }
+
+ ///
+ /// Write single signed byte into underying stream.
+ ///
+ /// Signed byte value for writing.
+ public void WriteSByte(sbyte value)
+ {
+ _baseWriter.Write(value);
+ }
+
+ ///
+ /// Write version information into underying stream.
+ ///
+ /// Version information value for writing.
+ public void WriteVersion(Version value)
+ {
+ WriteUInt16((ushort)value.Major);
+ WriteUInt16((ushort)value.Minor);
+ WriteUInt16((ushort)value.Build);
+ WriteUInt16((ushort)value.Revision);
+ }
+
+ ///
+ /// Write raw string value (in UTF-8 encoding) into underying stream.
+ ///
+ /// String value for writing.
+ public void WriteString(string value)
+ {
+ _baseWriter.Write(Encoding.UTF8.GetBytes(value));
+ WriteByte(0);
+ }
+
+ ///
+ /// Write raw bytes array into underying stream.
+ ///
+ /// Raw bytes array for writing.
+ public void WriteBytes(byte[] value)
+ {
+ _baseWriter.Write(value);
+ }
+
+ ///
+ /// Write single signed word into underying stream.
+ ///
+ /// Signed word value for writing.
+ public void WriteInt16(short value)
+ {
+ WriteUInt16((ushort)value);
+ }
+
+ ///
+ /// Write single signed double word into underying stream.
+ ///
+ /// Signed double word value for writing.
+ public void WriteInt32(int value)
+ {
+ WriteUInt32((uint)value);
+ }
+
+ ///
+ /// Write single signed quad word into underying stream.
+ ///
+ /// Signed quad word value for writing.
+ public void WriteInt64(long value)
+ {
+ WriteUInt64((ulong)value);
+ }
+
+ ///
+ /// Write metadata token in packed format (variable length).
+ ///
+ /// Metadata tocken in .NET Mico Framework format.
+ public void WriteMetadataToken(uint value)
+ {
+ if (value <= 0x7F)
+ {
+ WriteByte((byte) value);
+ }
+ else if (value <= 0x3FFF)
+ {
+ WriteByte((byte)(value >> 8 | 0x80));
+ WriteByte((byte)value);
+ }
+ else
+ {
+ WriteByte((byte)(value >> 24 | 0xC0));
+ WriteByte((byte)(value >> 16));
+ WriteByte((byte)(value >> 8));
+ WriteByte((byte)value);
+ }
+ }
+
+ ///
+ /// Write single unsigned word into underying stream.
+ ///
+ /// Unsigned word value for writing.
+ public abstract void WriteUInt16(ushort value);
+
+ ///
+ /// Write single signed double word into underying stream.
+ ///
+ /// Unsigned double word value for writing.
+ public abstract void WriteUInt32(uint value);
+
+ ///
+ /// Write single signed quad word into underying stream.
+ ///
+ /// Unsigned quad word value for writing.
+ public abstract void WriteUInt64(ulong value);
+
+ ///
+ /// Write single floating point value (4 bytes) into underying stream.
+ ///
+ /// Floating point value for writing.
+ public abstract void WriteSingle(float value);
+
+ ///
+ /// Write single floating point value (8 bytes) into underying stream.
+ ///
+ /// Floating point value for writing.
+ public abstract void WriteDouble(double value);
+
+ ///
+ /// Creates new instance of object with same endiannes
+ /// as current instance but based on new base stream .
+ ///
+ /// Base binary writer for operating on stream for new writer.
+ /// New instance of object with same endiannes.
+ public abstract nanoBinaryWriter GetMemoryBasedClone(MemoryStream stream);
+
+ ///
+ /// Gets base stream for this binary writer object (used for changing stream position).
+ ///
+ public Stream BaseStream { get { return _baseWriter.BaseStream; } }
+
+ ///
+ /// Returns true in case of this binary writer is write data in big endian format.
+ ///
+ public bool IsBigEndian { get { return (this is BigEndianBinaryWriter); } }
+ }
+}
diff --git a/source/MetadataProcessor.Core/InanoTable.cs b/source/MetadataProcessor.Core/InanoTable.cs
new file mode 100644
index 00000000..b4141367
--- /dev/null
+++ b/source/MetadataProcessor.Core/InanoTable.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Common interface for all metadata tables in .NET nanoFramework assembly.
+ ///
+ public interface InanoTable
+ {
+ ///
+ /// Writes metadata table from memory representation into output stream.
+ ///
+ /// Binary writer with correct endianness.
+ void Write(
+ nanoBinaryWriter writer);
+ }
+}
\ No newline at end of file
diff --git a/source/MetadataProcessor.Core/MetadataProcessor.Core.csproj b/source/MetadataProcessor.Core/MetadataProcessor.Core.csproj
new file mode 100644
index 00000000..0d6cd659
--- /dev/null
+++ b/source/MetadataProcessor.Core/MetadataProcessor.Core.csproj
@@ -0,0 +1,100 @@
+
+
+
+ Debug
+ AnyCPU
+ {E32F7D15-2499-440C-8026-4D5EE1C5EC3A}
+ Library
+ nanoFramework.Tools.MetadataProcessor.Core
+ nanoFramework.Tools.MetadataProcessor.Core
+ v4.6.1
+
+
+
+
+
+ true
+ full
+ false
+ bin\Debug
+ DEBUG;
+ prompt
+ 4
+ false
+ true
+
+
+ full
+ true
+ bin\Release
+ prompt
+ 4
+ false
+ true
+
+
+
+ ..\packages\Mono.Cecil.0.11.1\lib\net40\Mono.Cecil.dll
+
+
+ ..\packages\Mono.Cecil.0.11.1\lib\net40\Mono.Cecil.Mdb.dll
+
+
+ ..\packages\Mono.Cecil.0.11.1\lib\net40\Mono.Cecil.Pdb.dll
+
+
+ ..\packages\Mono.Cecil.0.11.1\lib\net40\Mono.Cecil.Rocks.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
\ No newline at end of file
diff --git a/source/MetadataProcessor.Core/Mono.Cecil/CodeWriter.cs b/source/MetadataProcessor.Core/Mono.Cecil/CodeWriter.cs
new file mode 100644
index 00000000..cb63a734
--- /dev/null
+++ b/source/MetadataProcessor.Core/Mono.Cecil/CodeWriter.cs
@@ -0,0 +1,518 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using Mono.Cecil.Cil;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+
+ ///
+ /// Encapsulates logic related for writing correct byte code and calculating stack size.
+ ///
+ ///
+ /// This class initially copy-pasted from Mono.Cecil codebase but changed a lot.
+ ///
+ internal sealed class CodeWriter
+ {
+ ///
+ /// Original method body information in Mono.Cecil format.
+ ///
+ private readonly MethodBody _body;
+
+ ///
+ /// Binary writer for writing byte code in correct endianess.
+ ///
+ private readonly nanoBinaryWriter _writer;
+
+ ///
+ /// String literals table (used for obtaining string literal ID).
+ ///
+ private readonly nanoStringTable _stringTable;
+
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ private readonly nanoTablesContext _context;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// Original method body in Mono.Cecil format.
+ /// Binary writer for writing byte code in correct endianess.
+ /// String references table (for obtaining string ID).
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public CodeWriter(
+ MethodDefinition method,
+ nanoBinaryWriter writer,
+ nanoStringTable stringTable,
+ nanoTablesContext context)
+ {
+ _stringTable = stringTable;
+
+ _body = method.Body;
+ _context = context;
+ _writer = writer;
+ }
+
+ ///
+ /// Writes method body into binary writer originally passed into constructor.
+ ///
+ public void WriteMethodBody()
+ {
+ foreach (var instruction in _body.Instructions)
+ {
+ WriteOpCode(instruction.OpCode);
+ WriteOperand(instruction);
+ }
+
+ WriteExceptionsTable();
+ }
+
+ ///
+ /// Fixes instructions offsets according .NET nanoFramework operands sizes.
+ ///
+ /// Target method for fixing offsets
+ /// String table for populating strings from method.
+ public static IEnumerable> PreProcessMethod(
+ MethodDefinition methodDefinition,
+ nanoStringTable stringTable)
+ {
+ if (!methodDefinition.HasBody)
+ {
+ yield break;
+ }
+
+ var offset = 0;
+ var offsetChanged = true;
+ foreach (var instruction in methodDefinition.Body.Instructions)
+ {
+ if (offset != 0)
+ {
+ if (offsetChanged)
+ {
+ yield return new Tuple(
+ (uint)instruction.Offset, (uint)(instruction.Offset + offset));
+ offsetChanged = false;
+ }
+ instruction.Offset += offset;
+ }
+
+ switch (instruction.OpCode.OperandType)
+ {
+ case OperandType.InlineSwitch:
+ var targets = (Instruction[]) instruction.Operand;
+ offset -= 3; // One bye used instead of Int32
+ offset -= 2 * targets.Length; // each target use Int16 instead of Int32
+ offsetChanged = true;
+ break;
+ case OperandType.InlineString:
+ stringTable.GetOrCreateStringId((string) instruction.Operand, false);
+ offset -= 2;
+ offsetChanged = true;
+ break;
+ case OperandType.InlineMethod:
+ case OperandType.InlineField:
+ case OperandType.InlineType:
+ case OperandType.InlineBrTarget:
+ // In full .NET these instructions followed by double word operand
+ // but in .NET nanoFramework these instruction's operand are word
+ offset -= 2;
+ offsetChanged = true;
+ break;
+ }
+ }
+ }
+
+ ///
+ /// Calculates method stack size for passed method.
+ ///
+ /// Method body in Mono.Cecil format.
+ /// Maximal evaluated stack size for passed method body.
+ public static byte CalculateStackSize(
+ MethodBody methodBody)
+ {
+ if (methodBody == null)
+ {
+ return 0;
+ }
+
+ IDictionary offsets = new Dictionary();
+
+ var size = 0;
+ var maxSize = 0;
+ foreach (var instruction in methodBody.Instructions)
+ {
+ int correctedStackSize;
+ if (offsets.TryGetValue(instruction.Offset, out correctedStackSize))
+ {
+ size = correctedStackSize;
+ }
+
+ switch (instruction.OpCode.Code)
+ {
+ case Code.Throw:
+ case Code.Endfinally:
+ case Code.Endfilter:
+ case Code.Leave_S:
+ case Code.Br_S:
+ case Code.Leave:
+ size = 0;
+ continue;
+
+ case Code.Newobj:
+ {
+ var method = (MethodReference)instruction.Operand;
+ size -= method.Parameters.Count;
+ }
+ break;
+
+ case Code.Callvirt:
+ case Code.Call:
+ {
+ var method = (MethodReference)instruction.Operand;
+ if (method.HasThis)
+ {
+ --size;
+ }
+ size -= method.Parameters.Count;
+ if (method.ReturnType.FullName != "System.Void")
+ {
+ ++size;
+ }
+ }
+ break;
+ }
+
+ size = CorrectStackDepthByPushes(instruction, size);
+ size = CorrectStackDepthByPops(instruction, size);
+
+ if (instruction.OpCode.OperandType == OperandType.ShortInlineBrTarget ||
+ instruction.OpCode.OperandType == OperandType.InlineBrTarget)
+ {
+ int stackSize;
+ var target = (Instruction)instruction.Operand;
+ offsets.TryGetValue(target.Offset, out stackSize);
+ offsets[target.Offset] = Math.Max(stackSize, size);
+ }
+
+ maxSize = Math.Max(maxSize, size);
+ }
+
+ return (byte)maxSize;
+ }
+
+ private static int CorrectStackDepthByPushes(
+ Instruction instruction,
+ int size)
+ {
+ switch (instruction.OpCode.StackBehaviourPush)
+ {
+ case StackBehaviour.Push1:
+ case StackBehaviour.Pushi:
+ case StackBehaviour.Pushi8:
+ case StackBehaviour.Pushr4:
+ case StackBehaviour.Pushr8:
+ case StackBehaviour.Pushref:
+ ++size;
+ break;
+ case StackBehaviour.Push1_push1:
+ size += 2;
+ break;
+ }
+ return size;
+ }
+
+ private static int CorrectStackDepthByPops(
+ Instruction instruction,
+ int size)
+ {
+ switch (instruction.OpCode.StackBehaviourPop)
+ {
+ case StackBehaviour.Pop1:
+ case StackBehaviour.Popi:
+ case StackBehaviour.Popref:
+ --size;
+ break;
+ case StackBehaviour.Pop1_pop1:
+ case StackBehaviour.Popi_pop1:
+ case StackBehaviour.Popi_popi:
+ case StackBehaviour.Popi_popi8:
+ case StackBehaviour.Popi_popr4:
+ case StackBehaviour.Popi_popr8:
+ case StackBehaviour.Popref_pop1:
+ case StackBehaviour.Popref_popi:
+ size -= 2;
+ break;
+ case StackBehaviour.Popi_popi_popi:
+ case StackBehaviour.Popref_popi_popi:
+ case StackBehaviour.Popref_popi_popi8:
+ case StackBehaviour.Popref_popi_popr4:
+ case StackBehaviour.Popref_popi_popr8:
+ case StackBehaviour.Popref_popi_popref:
+ size -= 3;
+ break;
+ }
+ return size;
+ }
+
+ private void WriteExceptionsTable()
+ {
+ if (!_body.HasExceptionHandlers)
+ {
+ return;
+ }
+
+ foreach (var handler in _body.ExceptionHandlers
+ .OrderBy(item => item.HandlerStart.Offset))
+ {
+ switch (handler.HandlerType)
+ {
+ case ExceptionHandlerType.Catch:
+ _writer.WriteUInt16(0x0000);
+ _writer.WriteUInt16(GetTypeReferenceId(handler.CatchType, 0x8000));
+ break;
+ case ExceptionHandlerType.Fault:
+ _writer.WriteUInt16(0x0001);
+ _writer.WriteUInt16(0x0000);
+ break;
+ case ExceptionHandlerType.Finally:
+ _writer.WriteUInt16(0x0002);
+ _writer.WriteUInt16(0x0000);
+ break;
+ case ExceptionHandlerType.Filter:
+ _writer.WriteUInt16(0x0003);
+ _writer.WriteUInt16((ushort)handler.FilterStart.Offset);
+ break;
+ }
+
+ _writer.WriteUInt16((ushort)handler.TryStart.Offset);
+ _writer.WriteUInt16((ushort)handler.TryEnd.Offset);
+ _writer.WriteUInt16((ushort)handler.HandlerStart.Offset);
+ if (handler.HandlerEnd == null)
+ {
+ _writer.WriteUInt16((ushort)_body.Instructions.Last().Offset);
+ }
+ else
+ {
+ _writer.WriteUInt16((ushort)handler.HandlerEnd.Offset);
+ }
+ }
+
+ _writer.WriteByte((byte)_body.ExceptionHandlers.Count);
+ }
+
+ private void WriteOpCode (
+ OpCode opcode)
+ {
+ if (opcode.Size == 1)
+ {
+ _writer.WriteByte(opcode.Op2);
+ }
+ else
+ {
+ _writer.WriteByte(opcode.Op1);
+ _writer.WriteByte(opcode.Op2);
+ }
+ }
+
+ private void WriteOperand (
+ Instruction instruction)
+ {
+ var opcode = instruction.OpCode;
+ var operandType = opcode.OperandType;
+
+ if (operandType == OperandType.InlineNone)
+ {
+ return;
+ }
+
+ var operand = instruction.Operand;
+ if (operand == null)
+ {
+ throw new ArgumentException();
+ }
+
+ switch (operandType)
+ {
+ case OperandType.InlineSwitch:
+ {
+ var targets = (Instruction[]) operand;
+ _writer.WriteByte((byte)targets.Length);
+ var diff = instruction.Offset + opcode.Size + 2 * targets.Length + 1;
+ foreach (var item in targets)
+ {
+ _writer.WriteInt16((short)(GetTargetOffset(item) - diff));
+ }
+ break;
+ }
+ case OperandType.ShortInlineBrTarget:
+ {
+ var target = (Instruction) operand;
+ _writer.WriteSByte((sbyte)
+ (GetTargetOffset(target) - (instruction.Offset + opcode.Size + 1)));
+ break;
+ }
+ case OperandType.InlineBrTarget:
+ {
+ var target = (Instruction) operand;
+ _writer.WriteInt16((short)
+ (GetTargetOffset(target) - (instruction.Offset + opcode.Size + 2)));
+ break;
+ }
+ case OperandType.ShortInlineVar:
+ _writer.WriteByte((byte)GetVariableIndex((VariableDefinition)operand));
+ break;
+ case OperandType.ShortInlineArg:
+ _writer.WriteByte((byte)GetParameterIndex((ParameterDefinition)operand));
+ break;
+ case OperandType.InlineVar:
+ _writer.WriteInt16((short)GetVariableIndex((VariableDefinition)operand));
+ break;
+ case OperandType.InlineArg:
+ _writer.WriteInt16((short)GetParameterIndex((ParameterDefinition)operand));
+ break;
+ case OperandType.InlineSig:
+ // TODO: implement this properly after finding when such code is generated
+ //WriteMetadataToken (GetStandAloneSignature ((CallSite) operand));
+ break;
+ case OperandType.ShortInlineI:
+ if (opcode == OpCodes.Ldc_I4_S)
+ {
+ _writer.WriteSByte((sbyte)operand);
+ }
+ else
+ {
+ _writer.WriteByte((byte)operand);
+ }
+ break;
+ case OperandType.InlineI:
+ _writer.WriteInt32((int)operand);
+ break;
+ case OperandType.InlineI8:
+ _writer.WriteInt64((long)operand);
+ break;
+ case OperandType.ShortInlineR:
+ _writer.WriteSingle((float)operand);
+ break;
+ case OperandType.InlineR:
+ _writer.WriteDouble((double)operand);
+ break;
+ case OperandType.InlineString:
+ var stringReferenceId = _stringTable.GetOrCreateStringId((string) operand, false);
+ _writer.WriteUInt16(stringReferenceId);
+ break;
+ case OperandType.InlineMethod:
+ _writer.WriteUInt16(_context.GetMethodReferenceId((MethodReference)operand));
+ break;
+ case OperandType.InlineType:
+ _writer.WriteUInt16(GetTypeReferenceId((TypeReference)operand));
+ break;
+ case OperandType.InlineField:
+ _writer.WriteUInt16(GetFieldReferenceId((FieldReference)operand));
+ break;
+ case OperandType.InlineTok:
+ _writer.WriteUInt32(GetMetadataToken((IMetadataTokenProvider)operand));
+ break;
+ default:
+ throw new ArgumentException();
+ }
+ }
+
+ private uint GetMetadataToken(
+ IMetadataTokenProvider token)
+ {
+ ushort referenceId;
+ switch (token.MetadataToken.TokenType)
+ {
+ case TokenType.TypeRef:
+ _context.TypeReferencesTable.TryGetTypeReferenceId((TypeReference)token, out referenceId);
+ return (uint)0x01000000 | referenceId;
+ case TokenType.TypeDef:
+ _context.TypeDefinitionTable.TryGetTypeReferenceId((TypeDefinition)token, out referenceId);
+ return (uint)0x04000000 | referenceId;
+ case TokenType.TypeSpec:
+ _context.TypeSpecificationsTable.TryGetTypeReferenceId((TypeReference) token, out referenceId);
+ return (uint)0x08000000 | referenceId;
+ case TokenType.Field:
+ _context.FieldsTable.TryGetFieldReferenceId((FieldDefinition) token, false, out referenceId);
+ return (uint)0x05000000 | referenceId;
+ }
+ return 0U;
+ }
+
+ private ushort GetFieldReferenceId(
+ FieldReference fieldReference)
+ {
+ ushort referenceId;
+ if (_context.FieldReferencesTable.TryGetFieldReferenceId(fieldReference, out referenceId))
+ {
+ referenceId |= 0x8000; // External field reference
+ }
+ else
+ {
+ _context.FieldsTable.TryGetFieldReferenceId(fieldReference.Resolve(), false, out referenceId);
+ }
+ return referenceId;
+ }
+
+ private ushort GetTypeReferenceId(
+ TypeReference typeReference,
+ ushort typeReferenceMask = 0x4000)
+ {
+ ushort referenceId;
+ if (_context.TypeReferencesTable.TryGetTypeReferenceId(typeReference, out referenceId))
+ {
+ referenceId |= typeReferenceMask; // External type reference
+ }
+ else
+ {
+ if (!_context.TypeDefinitionTable.TryGetTypeReferenceId(typeReference.Resolve(), out referenceId))
+ {
+ return 0x8000;
+ }
+
+ }
+ return referenceId;
+ }
+
+ private int GetTargetOffset (
+ Instruction instruction)
+ {
+ if (instruction == null)
+ {
+ var last = _body.Instructions[_body.Instructions.Count - 1];
+ return last.Offset + last.GetSize ();
+ }
+
+ return instruction.Offset;
+ }
+
+ private static int GetVariableIndex (
+ VariableDefinition variable)
+ {
+ return variable.Index;
+ }
+
+ private int GetParameterIndex (
+ ParameterDefinition parameter)
+ {
+ if (_body.Method.HasThis) {
+ if (parameter == _body.ThisParameter)
+ return 0;
+
+ return parameter.Index + 1;
+ }
+
+ return parameter.Index;
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/MetadataProcessor.Core/Properties/AssemblyInfo.cs b/source/MetadataProcessor.Core/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..63eaadf5
--- /dev/null
+++ b/source/MetadataProcessor.Core/Properties/AssemblyInfo.cs
@@ -0,0 +1,11 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+[assembly: AssemblyTitle ("nanoFramework.MetadataProcessor.Core")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("nanoFramework project contributors")]
+[assembly: AssemblyProduct ("")]
+[assembly: AssemblyCopyright ("Copyright (c) 2019 The nanoFramework project contributors")]
diff --git a/source/MetadataProcessor.Core/Tables/ICustomStringSorter.cs b/source/MetadataProcessor.Core/Tables/ICustomStringSorter.cs
new file mode 100644
index 00000000..d2da7c92
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/ICustomStringSorter.cs
@@ -0,0 +1,24 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using System.Collections.Generic;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Helper class for sorting string literals before merging (solve strings order problem).
+ ///
+ public interface ICustomStringSorter
+ {
+ ///
+ /// Sorts input sequence according needed logic.
+ ///
+ /// Existing string listerals list.
+ /// Original string listerals list sorted according test pattern.
+ IEnumerable Sort(
+ ICollection strings);
+ }
+}
\ No newline at end of file
diff --git a/source/MetadataProcessor.Core/Tables/nanoAssemblyReferenceTable.cs b/source/MetadataProcessor.Core/Tables/nanoAssemblyReferenceTable.cs
new file mode 100644
index 00000000..285231c4
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoAssemblyReferenceTable.cs
@@ -0,0 +1,84 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing external assembly references list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoAssemblyReferenceTable :
+ nanoReferenceTableBase
+ {
+ ///
+ /// Helper class for comparing two instances of objects
+ /// using property as unique key for comparison.
+ ///
+ private sealed class AssemblyNameReferenceComparer : IEqualityComparer
+ {
+ ///
+ public bool Equals(AssemblyNameReference lhs, AssemblyNameReference rhs)
+ {
+ return string.Equals(lhs.FullName, rhs.FullName, StringComparison.Ordinal);
+ }
+
+ ///
+ public int GetHashCode(AssemblyNameReference item)
+ {
+ return item.FullName.GetHashCode();
+ }
+ }
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// List of assembly references in Mono.Cecil format.
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoAssemblyReferenceTable(
+ IEnumerable items,
+ nanoTablesContext context)
+ : base(items, new AssemblyNameReferenceComparer(), context)
+ {
+ }
+
+ ///
+ protected override void WriteSingleItem(
+ nanoBinaryWriter writer,
+ AssemblyNameReference item)
+ {
+ WriteStringReference(writer, item.Name);
+ writer.WriteUInt16(0); // padding
+
+ writer.WriteVersion(item.Version);
+ }
+
+ ///
+ protected override void AllocateSingleItemStrings(
+ AssemblyNameReference item)
+ {
+ GetOrCreateStringId(item.Name);
+ }
+
+ ///
+ /// Gets assembly reference ID by assembly name reference in Mono.Cecil format.
+ ///
+ /// Assembly name reference in Mono.Cecil format.
+ /// Refernce ID for passed item.
+ public ushort GetReferenceId(
+ AssemblyNameReference assemblyNameReference)
+ {
+ ushort referenceId;
+ TryGetIdByValue(assemblyNameReference, out referenceId);
+ return referenceId;
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoAttributesTable.cs b/source/MetadataProcessor.Core/Tables/nanoAttributesTable.cs
new file mode 100644
index 00000000..16353ee5
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoAttributesTable.cs
@@ -0,0 +1,96 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing attributes for types/methods/fields list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoAttributesTable : InanoTable
+ {
+ ///
+ /// List of custom attributes in Mono.Cecil format for all internal types.
+ ///
+ private readonly IEnumerable> _typesAttributes;
+
+ ///
+ /// List of custom attributes in Mono.Cecil format for all internal fields.
+ ///
+ ///
+ private readonly IEnumerable> _fieldsAttributes;
+
+ ///
+ /// List of custom attributes in Mono.Cecil format for all internal methods.
+ ///
+ private readonly IEnumerable> _methodsAttributes;
+
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ private readonly nanoTablesContext _context;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ ///
+ /// List of custom attributes in Mono.Cecil format for all internal types.
+ ///
+ ///
+ /// List of custom attributes in Mono.Cecil format for all internal fields.
+ ///
+ ///
+ /// List of custom attributes in Mono.Cecil format for all internal methods.
+ ///
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoAttributesTable(
+ IEnumerable> typesAttributes,
+ IEnumerable> fieldsAttributes,
+ IEnumerable> methodsAttributes,
+ nanoTablesContext context)
+ {
+ _typesAttributes = typesAttributes.ToList();
+ _fieldsAttributes = fieldsAttributes.ToList();
+ _methodsAttributes = methodsAttributes.ToList();
+
+ _context = context;
+ }
+
+ ///
+ public void Write(
+ nanoBinaryWriter writer)
+ {
+ WriteAttributes(writer, 0x0004, _typesAttributes);
+ WriteAttributes(writer, 0x0005, _fieldsAttributes);
+ WriteAttributes(writer, 0x0006, _methodsAttributes);
+ }
+
+ private void WriteAttributes(
+ nanoBinaryWriter writer,
+ ushort tableNumber,
+ IEnumerable> attributes)
+ {
+ foreach (var item in attributes)
+ {
+ var attribute = item.Item1;
+ var targetIdentifier = item.Item2;
+
+ writer.WriteUInt16(tableNumber);
+ writer.WriteUInt16(targetIdentifier);
+
+ writer.WriteUInt16(_context.GetMethodReferenceId(attribute.Constructor));
+ writer.WriteUInt16(_context.SignaturesTable.GetOrCreateSignatureId(attribute));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/MetadataProcessor.Core/Tables/nanoByteCodeTable.cs b/source/MetadataProcessor.Core/Tables/nanoByteCodeTable.cs
new file mode 100644
index 00000000..b659ff59
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoByteCodeTable.cs
@@ -0,0 +1,161 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+using System.IO;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing method bodies (byte code) list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoByteCodeTable : InanoTable
+ {
+ ///
+ /// Maps method bodies (in form of byte array) to method identifiers.
+ ///
+ private readonly IList _methods = new List();
+
+ ///
+ /// Maps method full names to method RVAs (offsets in resutling table).
+ ///
+ private readonly IDictionary _rvasByMethodNames =
+ new Dictionary(StringComparer.Ordinal);
+
+ ///
+ /// Temprorary string table for code generators used duing initial load.
+ ///
+ private readonly nanoStringTable _fakeStringTable = new nanoStringTable();
+
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ private readonly nanoTablesContext _context;
+
+ ///
+ /// Last available method RVA.
+ ///
+ private ushort _lastAvailableRva;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoByteCodeTable(
+ nanoTablesContext context)
+ {
+ _context = context;
+ }
+
+ ///
+ /// Next method identifier. Used for reproducing strange original MetadataProcessor behavior.
+ ///
+ public ushort NextMethodId { get { return (ushort)_methods.Count; } }
+
+ ///
+ /// Temprorary string table for code generators used duing initial load.
+ ///
+ public nanoStringTable FakeStringTable { get { return _fakeStringTable; } }
+
+ ///
+ /// Returns method reference ID (index in methods definitions table) for passed method definition.
+ ///
+ /// Method definition in Mono.Cecil format.
+ ///
+ /// New method reference ID (byte code also prepared for writing as part of process).
+ ///
+ public ushort GetMethodId(
+ MethodDefinition method)
+ {
+ var rva = method.HasBody ? _lastAvailableRva : (ushort)0xFFFF;
+ var id = (ushort)_methods.Count;
+
+ _context.NativeMethodsCrc.UpdateCrc(method);
+ var byteCode = CreateByteCode(method);
+
+ _methods.Add(method);
+ _lastAvailableRva += (ushort)byteCode.Length;
+
+ _rvasByMethodNames.Add(method.FullName, rva);
+ return id;
+ }
+
+ ///
+ /// Returns method RVA (offset in byte code table) for passed method reference.
+ ///
+ /// Method reference in Mono.Cecil format.
+ ///
+ /// Method RVA (method should be generated using before this call.
+ ///
+ public ushort GetMethodRva(
+ MethodReference method)
+ {
+ ushort rva;
+ return (_rvasByMethodNames.TryGetValue(method.FullName, out rva) ? rva : (ushort)0xFFFF);
+ }
+
+ ///
+ public void Write(
+ nanoBinaryWriter writer)
+ {
+ foreach (var method in _methods)
+ {
+ writer.WriteBytes(CreateByteCode(method, writer));
+ }
+ }
+
+ ///
+ /// Updates main string table with strings stored in temp string table before code generation.
+ ///
+ internal void UpdateStringTable()
+ {
+ _context.StringTable.MergeValues(_fakeStringTable);
+ }
+
+ private byte[] CreateByteCode(
+ MethodDefinition method)
+ {
+ if (!method.HasBody)
+ {
+ return new byte[0];
+ }
+
+ using (var stream = new MemoryStream())
+ using (var writer = new BinaryWriter(stream))
+ {
+ var codeWriter = new CodeWriter(
+ method, nanoBinaryWriter.CreateBigEndianBinaryWriter(writer),
+ _fakeStringTable, _context);
+ codeWriter.WriteMethodBody();
+ return stream.ToArray();
+ }
+ }
+
+ private byte[] CreateByteCode(
+ MethodDefinition method,
+ nanoBinaryWriter writer)
+ {
+ if (!method.HasBody)
+ {
+ return new byte[0];
+ }
+
+ using(var stream = new MemoryStream())
+ {
+ var codeWriter = new CodeWriter(
+ method, writer.GetMemoryBasedClone(stream),
+ _context.StringTable, _context);
+ codeWriter.WriteMethodBody();
+ return stream.ToArray();
+ }
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoEmptyTable.cs b/source/MetadataProcessor.Core/Tables/nanoEmptyTable.cs
new file mode 100644
index 00000000..fb441522
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoEmptyTable.cs
@@ -0,0 +1,36 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Default implementation of interface. Do nothing and
+ /// used for emulating temporary not supported metadata tables and for last fake table.
+ ///
+ public sealed class nanoEmptyTable : InanoTable
+ {
+ ///
+ /// Singleton pattern - single unique instance of object.
+ ///
+ private static readonly InanoTable _instance = new nanoEmptyTable();
+
+ ///
+ /// Singleton pattern - private constructor prevents direct instantiation.
+ ///
+ private nanoEmptyTable() { }
+
+ ///
+ public void Write(
+ nanoBinaryWriter writer)
+ {
+ }
+
+ ///
+ /// Singleton pattern - gets single unique instance of object.
+ ///
+ public static InanoTable Instance { get { return _instance; } }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoFieldDefinitionTable.cs b/source/MetadataProcessor.Core/Tables/nanoFieldDefinitionTable.cs
new file mode 100644
index 00000000..3d6baea0
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoFieldDefinitionTable.cs
@@ -0,0 +1,189 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing fields definitions list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoFieldDefinitionTable :
+ nanoReferenceTableBase
+ {
+ ///
+ /// Helper class for comparing two instances of objects
+ /// using property as unique key for comparison.
+ ///
+ private sealed class FieldDefinitionComparer : IEqualityComparer
+ {
+ ///
+ public bool Equals(FieldDefinition lhs, FieldDefinition rhs)
+ {
+ return string.Equals(lhs.FullName, rhs.FullName, StringComparison.Ordinal);
+ }
+
+ ///
+ public int GetHashCode(FieldDefinition that)
+ {
+ return that.FullName.GetHashCode();
+ }
+ }
+
+ ///
+ /// Maximal returned field reference id - used for emulating old MetadataProcessor behavior.
+ ///
+ private int _maxReferenceId;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// List of field definitions in Mono.Cecil format.
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoFieldDefinitionTable(
+ IEnumerable items,
+ nanoTablesContext context)
+ : base(items, new FieldDefinitionComparer(), context)
+ {
+ }
+
+ ///
+ /// Gets maximal returned field reference id - used for emulating old MetadataProcessor behavior.
+ ///
+ public ushort MaxFieldId { get { return (ushort)_maxReferenceId; } }
+
+ ///
+ protected override void WriteSingleItem(
+ nanoBinaryWriter writer,
+ FieldDefinition item)
+ {
+ WriteStringReference(writer, item.Name);
+ writer.WriteUInt16(_context.SignaturesTable.GetOrCreateSignatureId(item));
+
+ writer.WriteUInt16(_context.SignaturesTable.GetOrCreateSignatureId(item.InitialValue));
+ writer.WriteUInt16(GetFlags(item));
+ }
+
+ ///
+ /// Gets field reference identifier (if field is defined inside target assembly).
+ ///
+ /// Field definition in Mono.Cecil format.
+ /// If set to true we should track max ID value.
+ /// Field reference identifier for filling.
+ /// Returns true if item found, otherwise returns false.
+ public bool TryGetFieldReferenceId(
+ FieldDefinition field,
+ bool trackMaxReferenceId,
+ out ushort referenceId)
+ {
+ var found = TryGetIdByValue(field, out referenceId);
+ if (trackMaxReferenceId && found)
+ {
+ _maxReferenceId = Math.Max(_maxReferenceId, referenceId + 1);
+ }
+ return found;
+ }
+
+ private ushort GetFlags(
+ FieldDefinition field)
+ {
+ const ushort FD_Scope_Private = 0x0001; // Accessible only by the parent type.
+ const ushort FD_Scope_FamANDAssem = 0x0002; // Accessible by sub-types only in this Assembly.
+ const ushort FD_Scope_Assembly = 0x0003; // Accessibly by anyone in the Assembly.
+ const ushort FD_Scope_Family = 0x0004; // Accessible only by type and sub-types.
+ const ushort FD_Scope_FamORAssem = 0x0005; // Accessibly by sub-types anywhere, plus anyone in assembly.
+ const ushort FD_Scope_Public = 0x0006; // Accessibly by anyone who has visibility to this scope.
+
+ const ushort FD_NotSerialized = 0x0008; // Field does not have to be serialized when type is remoted.
+
+ const ushort FD_Static = 0x0010; // Defined on type, else per instance.
+ const ushort FD_InitOnly = 0x0020; // Field may only be initialized, not written to after init.
+ const ushort FD_Literal = 0x0040; // Value is compile time constant.
+
+ const ushort FD_SpecialName = 0x0100; // field is special. Name describes how.
+ const ushort FD_HasDefault = 0x0200; // Field has default.
+ const ushort FD_HasFieldRVA = 0x0400; // Field has RVA.
+
+ const ushort FD_NoReflection = 0x0800; // field does not allow reflection
+
+ const ushort FD_HasAttributes = 0x8000;
+
+ ushort flag = 0;
+
+ if (field.IsPrivate)
+ {
+ flag = FD_Scope_Private;
+ }
+ else if (field.IsFamilyAndAssembly)
+ {
+ flag = FD_Scope_FamANDAssem;
+ }
+ else if (field.IsFamilyOrAssembly)
+ {
+ flag = FD_Scope_FamORAssem;
+ }
+ else if (field.IsAssembly)
+ {
+ flag = FD_Scope_Assembly;
+ }
+ else if (field.IsFamily)
+ {
+ flag = FD_Scope_Family;
+ }
+ else if (field.IsPublic)
+ {
+ flag = FD_Scope_Public;
+ }
+
+ if (field.IsNotSerialized)
+ {
+ flag |= FD_NotSerialized;
+ }
+
+ if (field.IsStatic)
+ {
+ flag |= FD_Static;
+ }
+
+ if (field.IsInitOnly)
+ {
+ flag |= FD_InitOnly;
+ }
+
+ if (field.IsLiteral)
+ {
+ flag |= FD_Literal;
+ }
+
+ if (field.IsSpecialName)
+ {
+ flag |= FD_SpecialName;
+ }
+
+ if (field.HasDefault)
+ {
+ flag |= FD_HasDefault;
+ }
+
+ if (field.HasCustomAttributes)
+ {
+ flag |= FD_HasAttributes;
+ }
+
+ if (field.RVA != 0)
+ {
+ flag |= FD_HasFieldRVA;
+ }
+
+ return flag;
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoFieldReferenceTable.cs b/source/MetadataProcessor.Core/Tables/nanoFieldReferenceTable.cs
new file mode 100644
index 00000000..3be40f05
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoFieldReferenceTable.cs
@@ -0,0 +1,81 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing member (methods or fields) references list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoFieldReferenceTable :
+ nanoReferenceTableBase
+ {
+ ///
+ /// Helper class for comparing two instances of objects
+ /// using property as unique key for comparison.
+ ///
+ private sealed class MemberReferenceComparer : IEqualityComparer
+ {
+ ///
+ public bool Equals(FieldReference lhs, FieldReference rhs)
+ {
+ return string.Equals(lhs.FullName, rhs.FullName, StringComparison.Ordinal);
+ }
+
+ ///
+ public int GetHashCode(FieldReference that)
+ {
+ return that.FullName.GetHashCode();
+ }
+ }
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// List of member references in Mono.Cecil format.
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoFieldReferenceTable(
+ IEnumerable items,
+ nanoTablesContext context)
+ : base(items, new MemberReferenceComparer(), context)
+ {
+ }
+
+ ///
+ /// Gets field reference ID if possible (if field is external and stored in this table).
+ ///
+ /// Field reference metadata in Mono.Cecil format.
+ /// Field reference ID in .NET nanoFramework format.
+ /// Returns true if reference found, otherwise returns false.
+ public bool TryGetFieldReferenceId(
+ FieldReference fieldReference,
+ out ushort referenceId)
+ {
+ return TryGetIdByValue(fieldReference, out referenceId);
+ }
+
+ ///
+ protected override void WriteSingleItem(
+ nanoBinaryWriter writer,
+ FieldReference item)
+ {
+ ushort referenceId;
+ _context.TypeReferencesTable.TryGetTypeReferenceId(item.DeclaringType, out referenceId);
+
+ WriteStringReference(writer, item.Name);
+ writer.WriteUInt16(referenceId);
+
+ writer.WriteUInt16(_context.SignaturesTable.GetOrCreateSignatureId(item));
+ writer.WriteUInt16(0); // padding
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoMethodDefinitionTable.cs b/source/MetadataProcessor.Core/Tables/nanoMethodDefinitionTable.cs
new file mode 100644
index 00000000..0d4d1267
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoMethodDefinitionTable.cs
@@ -0,0 +1,244 @@
+using System;
+using System.Collections.Generic;
+using Mono.Cecil;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing methods definitions list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoMethodDefinitionTable :
+ nanoReferenceTableBase
+ {
+ ///
+ /// Helper class for comparing two instances of objects
+ /// using property as unique key for comparison.
+ ///
+ private sealed class MethodDefinitionComparer : IEqualityComparer
+ {
+ ///
+ public bool Equals(MethodDefinition lhs, MethodDefinition rhs)
+ {
+ return string.Equals(lhs.FullName, rhs.FullName, StringComparison.Ordinal);
+ }
+
+ ///
+ public int GetHashCode(MethodDefinition that)
+ {
+ return that.FullName.GetHashCode();
+ }
+ }
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// List of methods definitions in Mono.Cecil format.
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoMethodDefinitionTable(
+ IEnumerable items,
+ nanoTablesContext context)
+ :base(items, new MethodDefinitionComparer(), context)
+ {
+ }
+
+ ///
+ /// Gets method reference identifier (if method is defined inside target assembly).
+ ///
+ /// Method definition in Mono.Cecil format.
+ /// Method definition reference identifier for filling.
+ /// Returns true if item found, otherwise returns false.
+ public bool TryGetMethodReferenceId(
+ MethodDefinition methodDefinition,
+ out ushort referenceId)
+ {
+ return TryGetIdByValue(methodDefinition, out referenceId);
+ }
+
+ ///
+ protected override void WriteSingleItem(
+ nanoBinaryWriter writer,
+ MethodDefinition item)
+ {
+ WriteStringReference(writer, item.Name);
+ writer.WriteUInt16(_context.ByteCodeTable.GetMethodRva(item));
+
+ writer.WriteUInt32(GetFlags(item));
+
+ var parametersCount = (byte)item.Parameters.Count;
+ if (!item.IsStatic)
+ {
+ ++parametersCount; // add implicit 'this' pointer into non-static methods
+ }
+
+ _context.SignaturesTable.WriteDataType(item.ReturnType, writer, false, false);
+ if (item.ReturnType is TypeSpecification)
+ {
+ _context.TypeSpecificationsTable
+ .GetOrCreateTypeSpecificationId(item.ReturnType);
+ }
+
+ writer.WriteByte(parametersCount);
+ writer.WriteByte((byte)(item.HasBody ? item.Body.Variables.Count : 0));
+ writer.WriteByte(CodeWriter.CalculateStackSize(item.Body));
+
+ var methodSignature = _context.SignaturesTable.GetOrCreateSignatureId(item);
+ writer.WriteUInt16(item.HasBody ?
+ _context.SignaturesTable.GetOrCreateSignatureId(item.Body.Variables) :
+ (item.IsAbstract || item.IsRuntime ? (ushort)0x0000 : (ushort)0xFFFF));
+ writer.WriteUInt16(methodSignature);
+ }
+
+ private uint GetFlags(
+ MethodDefinition method)
+ {
+ const uint MD_Scope_Private = 0x00000001; // Accessible only by the parent type.
+ const uint MD_Scope_FamANDAssem = 0x00000002; // Accessible by sub-types only in this Assembly.
+ const uint MD_Scope_Assem = 0x00000003; // Accessibly by anyone in the Assembly.
+ const uint MD_Scope_Family = 0x00000004; // Accessible only by type and sub-types.
+ const uint MD_Scope_FamORAssem = 0x00000005; // Accessibly by sub-types anywhere, plus anyone in assembly.
+ const uint MD_Scope_Public = 0x00000006; // Accessibly by anyone who has visibility to this scope.
+
+ const uint MD_Static = 0x00000010; // Defined on type, else per instance.
+ const uint MD_Final = 0x00000020; // Method may not be overridden.
+ const uint MD_Virtual = 0x00000040; // Method virtual.
+ const uint MD_HideBySig = 0x00000080; // Method hides by name+sig, else just by name.
+
+ const uint MD_ReuseSlot = 0x00000000; // The default.
+ const uint MD_NewSlot = 0x00000100; // Method always gets a new slot in the vtable.
+ const uint MD_Abstract = 0x00000200; // Method does not provide an implementation.
+ const uint MD_SpecialName = 0x00000400; // Method is special. Name describes how.
+ const uint MD_NativeProfiled = 0x00000800;
+
+ const uint MD_Constructor = 0x00001000;
+ const uint MD_StaticConstructor = 0x00002000;
+ const uint MD_Finalizer = 0x00004000;
+
+ const uint MD_DelegateConstructor = 0x00010000;
+ const uint MD_DelegateInvoke = 0x00020000;
+ const uint MD_DelegateBeginInvoke = 0x00040000;
+ const uint MD_DelegateEndInvoke = 0x00080000;
+
+ const uint MD_Synchronized = 0x01000000;
+ const uint MD_GloballySynchronized = 0x02000000;
+ const uint MD_Patched = 0x04000000;
+ const uint MD_EntryPoint = 0x08000000;
+ const uint MD_RequireSecObject = 0x10000000; // Method calls another method containing security code.
+ const uint MD_HasSecurity = 0x20000000; // Method has security associate with it.
+ const uint MD_HasExceptionHandlers = 0x40000000;
+ const uint MD_HasAttributes = 0x80000000;
+
+ uint flag = 0;
+ if (method.IsPrivate)
+ {
+ flag = MD_Scope_Private;
+ }
+ else if (method.IsFamilyAndAssembly)
+ {
+ flag = MD_Scope_FamANDAssem;
+ }
+ else if (method.IsFamilyOrAssembly)
+ {
+ flag = MD_Scope_FamORAssem;
+ }
+ else if (method.IsAssembly)
+ {
+ flag = MD_Scope_Assem;
+ }
+ else if (method.IsFamily)
+ {
+ flag = MD_Scope_Family;
+ }
+ else if (method.IsPublic)
+ {
+ flag = MD_Scope_Public;
+ }
+
+ if (method.IsStatic)
+ {
+ flag |= MD_Static;
+ }
+ if (method.IsFinal)
+ {
+ flag |= MD_Final;
+ }
+ if (method.IsVirtual)
+ {
+ flag |= MD_Virtual;
+ }
+ if (method.IsHideBySig)
+ {
+ flag |= MD_HideBySig;
+ }
+
+ if (method.IsReuseSlot)
+ {
+ flag |= MD_ReuseSlot;
+ }
+ if (method.IsNewSlot)
+ {
+ flag |= MD_NewSlot;
+ }
+ if (method.IsAbstract)
+ {
+ flag |= MD_Abstract;
+ }
+ if (method.IsSpecialName)
+ {
+ flag |= MD_SpecialName;
+ }
+ if (method.IsNative)
+ {
+ flag |= MD_NativeProfiled; // ???
+ }
+
+ if (method.IsConstructor)
+ {
+ flag |= (method.IsStatic ? MD_StaticConstructor : MD_Constructor);
+ }
+
+ if (method.IsSynchronized)
+ {
+ flag |= MD_Synchronized;
+ }
+ if (method.HasCustomAttributes)
+ {
+ flag |= MD_HasAttributes; // ???
+ }
+
+ if (method == method.Module.EntryPoint)
+ {
+ flag |= MD_EntryPoint;
+ }
+
+ if (method.HasBody && method.Body.HasExceptionHandlers)
+ {
+ flag |= MD_HasExceptionHandlers;
+ }
+
+ var baseType = method.DeclaringType.BaseType;
+ if (baseType != null && baseType.FullName == "System.MulticastDelegate")
+ {
+ if (method.IsConstructor)
+ {
+ flag |= MD_DelegateConstructor;
+ }
+ else if (method.Name == "Invoke")
+ {
+ flag |= MD_DelegateInvoke;
+ }
+ else if (method.Name == "BeginInvoke")
+ {
+ flag |= MD_DelegateBeginInvoke;
+ }
+ else if (method.Name == "EndInvoke")
+ {
+ flag |= MD_DelegateEndInvoke;
+ }
+ }
+ return flag;
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoMethodReferenceTable.cs b/source/MetadataProcessor.Core/Tables/nanoMethodReferenceTable.cs
new file mode 100644
index 00000000..324bdabe
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoMethodReferenceTable.cs
@@ -0,0 +1,81 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing methods references list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoMethodReferenceTable :
+ nanoReferenceTableBase
+ {
+ ///
+ /// Helper class for comparing two instances of objects
+ /// using property as unique key for comparison.
+ ///
+ private sealed class MemberReferenceComparer : IEqualityComparer
+ {
+ ///
+ public bool Equals(MethodReference lhs, MethodReference rhs)
+ {
+ return string.Equals(lhs.FullName, rhs.FullName, StringComparison.Ordinal);
+ }
+
+ ///
+ public int GetHashCode(MethodReference that)
+ {
+ return that.FullName.GetHashCode();
+ }
+ }
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// List of member references in Mono.Cecil format.
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoMethodReferenceTable(
+ IEnumerable items,
+ nanoTablesContext context)
+ : base(items, new MemberReferenceComparer(), context)
+ {
+ }
+
+ ///
+ /// Gets method reference ID if possible (if method is external and stored in this table).
+ ///
+ /// Method reference metadata in Mono.Cecil format.
+ /// Method reference ID in .NET nanoFramework format.
+ /// Returns true if reference found, otherwise returns false.
+ public bool TryGetMethodReferenceId(
+ MethodReference methodReference,
+ out ushort referenceId)
+ {
+ return TryGetIdByValue(methodReference, out referenceId);
+ }
+
+ ///
+ protected override void WriteSingleItem(
+ nanoBinaryWriter writer,
+ MethodReference item)
+ {
+ ushort referenceId;
+ _context.TypeReferencesTable.TryGetTypeReferenceId(item.DeclaringType, out referenceId);
+
+ WriteStringReference(writer, item.Name);
+ writer.WriteUInt16(referenceId);
+
+ writer.WriteUInt16(_context.SignaturesTable.GetOrCreateSignatureId(item));
+ writer.WriteUInt16(0); // padding
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoReferenceTableBase.cs b/source/MetadataProcessor.Core/Tables/nanoReferenceTableBase.cs
new file mode 100644
index 00000000..b61de963
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoReferenceTableBase.cs
@@ -0,0 +1,139 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Base class for all metadata tables with lookup functionality. Stores items in Mono.Cecil
+ /// format in dictionary and allows to get item ID by item value (using custom comparer).
+ ///
+ /// Type of stored metadata item (in Mono.Cecil format).
+ public abstract class nanoReferenceTableBase : InanoTable
+ {
+ ///
+ /// Lookup table for finding item ID by item value.
+ ///
+ private readonly Dictionary _idsByItemsDictionary;
+
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ protected readonly nanoTablesContext _context;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// List of items for initial loading.
+ /// Custom comparer for items (type-specific).
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ protected nanoReferenceTableBase(
+ IEnumerable tinyTableItems,
+ IEqualityComparer comparer,
+ nanoTablesContext context)
+ {
+ _idsByItemsDictionary = tinyTableItems
+ .Select((reference, index) => new { reference, index })
+ .ToDictionary(item => item.reference, item => (ushort)item.index,
+ comparer);
+
+ _context = context;
+ }
+
+ ///
+ public void Write(
+ nanoBinaryWriter writer)
+ {
+ foreach (var item in _idsByItemsDictionary
+ .OrderBy(item => item.Value)
+ .Select(item => item.Key))
+ {
+ WriteSingleItem(writer, item);
+ }
+ }
+
+ public void ForEachItems(Action action)
+ {
+ foreach (var item in _idsByItemsDictionary
+ .OrderBy(item => item.Value))
+ {
+ action(item.Value, item.Key);
+ }
+ }
+
+ ///
+ /// Helper method for allocating strings from table before table will be written.
+ ///
+ public void AllocateStrings()
+ {
+ foreach (var item in _idsByItemsDictionary
+ .OrderBy(item => item.Value)
+ .Select(item => item.Key))
+ {
+ AllocateSingleItemStrings(item);
+ }
+ }
+
+ ///
+ /// Writes string reference ID related to passed string value into output stream.
+ ///
+ /// Target binary writer for writing reference ID.
+ /// String value for obtaining reference and writing.
+ protected void WriteStringReference(
+ nanoBinaryWriter writer,
+ string value)
+ {
+ writer.WriteUInt16(GetOrCreateStringId(value));
+ }
+
+ ///
+ /// Gets existing or creates new string reference ID for provided string value.
+ ///
+ /// String value for lookup in string literals table.
+ /// String reference ID which can be used for filling metadata and byte code.
+ protected ushort GetOrCreateStringId(
+ string value)
+ {
+ return _context.StringTable.GetOrCreateStringId(value);
+ }
+
+ ///
+ /// Helper method for lookup in internal dictionary. Wraps
+ /// method.
+ ///
+ /// Key value for lookup.
+ /// Item reference identifier.
+ /// Returns true if item found, otherwise returns false.
+ protected bool TryGetIdByValue(
+ T key,
+ out ushort id)
+ {
+ return _idsByItemsDictionary.TryGetValue(key, out id);
+ }
+
+ ///
+ /// Provides concrete implementation for string allocation method in this table.
+ ///
+ /// Table item for allocating strings.
+ protected virtual void AllocateSingleItemStrings(T item)
+ {
+ }
+
+ ///
+ /// Inherited class should provides concrete implementation for writing single table item here.
+ ///
+ /// Target binary writer for writing item data.
+ /// Single table item for writing into ouptut stream.
+ protected abstract void WriteSingleItem(
+ nanoBinaryWriter writer,
+ T item);
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoResourceDataTable.cs b/source/MetadataProcessor.Core/Tables/nanoResourceDataTable.cs
new file mode 100644
index 00000000..fa131284
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoResourceDataTable.cs
@@ -0,0 +1,62 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using System.Collections.Generic;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing concrete resource data items list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoResourceDataTable : InanoTable
+ {
+ ///
+ /// List of registered resouce data for writing into output stream "as is".
+ ///
+ private readonly IList _dataByteArrays = new List();
+
+ ///
+ /// Gets current offset in resrouces data table (total size of all data blocks).
+ ///
+ public int CurrentOffset { get; private set; }
+
+ ///
+ /// Adds new chunk of binary data for resouces into list of resources.
+ ///
+ /// Resouce data in binary format.
+ public void AddResourceData(
+ byte[] resourceData)
+ {
+ _dataByteArrays.Add(resourceData);
+ CurrentOffset += resourceData.Length;
+ }
+
+ ///
+ public void Write(
+ nanoBinaryWriter writer)
+ {
+ foreach (var item in _dataByteArrays)
+ {
+ writer.WriteBytes(item);
+ }
+ }
+
+ ///
+ /// Aligns current data in table by word boundary and return size of alignment.
+ ///
+ /// Number of bytes added into bytes block for proper data alignment.
+ public int AlignToWord()
+ {
+ var padding = (4 - (CurrentOffset % 4)) % 4;
+ if (padding != 0)
+ {
+ AddResourceData(new byte[padding]);
+ }
+ return padding;
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoResourceFileTable.cs b/source/MetadataProcessor.Core/Tables/nanoResourceFileTable.cs
new file mode 100644
index 00000000..01f77ab9
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoResourceFileTable.cs
@@ -0,0 +1,79 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+using System.IO;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing resource files definitions list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoResourceFileTable : InanoTable
+ {
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ private readonly nanoTablesContext _context;
+
+ ///
+ /// List of resource fiels data for producing correct output records.
+ ///
+ private readonly IList> _resouces = new List>();
+
+ ///
+ /// Creates new instance of object.
+ ///
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoResourceFileTable(
+ nanoTablesContext context)
+ {
+ _context = context;
+ }
+
+ ///
+ /// Adds infromation about embedded resource file in Mono.Cecil format into list.
+ ///
+ /// Embedded resouce file information in Mono.Cecil format.
+ /// Number of recource items in this resouce file.
+ public void AddResourceFile(
+ EmbeddedResource item,
+ uint count)
+ {
+ var correctFileName = Path.ChangeExtension(item.Name, ".tinyresources");
+ var nameStringId = _context.StringTable.GetOrCreateStringId(correctFileName);
+
+ _resouces.Add(new Tuple(nameStringId, count));
+ }
+
+ ///
+ public void Write(
+ nanoBinaryWriter writer)
+ {
+ var offset = 0U;
+ foreach (var item in _resouces)
+ {
+ writer.WriteUInt32(0x02); // Version
+ writer.WriteUInt32(0x04); // Size of header
+ writer.WriteUInt32(0x08); // Size of resouce header
+
+ writer.WriteUInt32(item.Item2);
+
+ writer.WriteUInt16(item.Item1);
+ writer.WriteUInt16(0x0); // paddding
+
+ writer.WriteUInt32(offset);
+ offset += 8; // Size of resource table record
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/MetadataProcessor.Core/Tables/nanoResourcesTable.cs b/source/MetadataProcessor.Core/Tables/nanoResourcesTable.cs
new file mode 100644
index 00000000..8b69e16f
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoResourcesTable.cs
@@ -0,0 +1,208 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Resources;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing embedded resources list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoResourcesTable : InanoTable
+ {
+ private enum ResourceKind : byte
+ {
+ None = 0x00,
+ Bitmap = 0x01,
+ Font = 0x02,
+ String = 0x03,
+ Binary = 0x04
+ }
+
+ private const uint FONT_HEADER_MAGIC = 0xf995b0a8;
+
+ ///
+ /// Original list of resouces in Mono.Cecil format.
+ ///
+ private readonly IEnumerable _resources;
+
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ private readonly nanoTablesContext _context;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// Original list of resouces in Mono.Cecil format.
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoResourcesTable(
+ IEnumerable resources,
+ nanoTablesContext context)
+ {
+ _resources = resources.ToList();
+ _context = context;
+ }
+
+ ///
+ public void Write(
+ nanoBinaryWriter writer)
+ {
+ var orderedResources = new SortedDictionary>();
+ foreach (var item in _resources.OfType())
+ {
+ var count = 0U;
+ using (var reader = new ResourceReader(item.GetResourceStream()))
+ {
+ foreach (DictionaryEntry resource in reader)
+ {
+ string resourceType;
+ byte[] resourceData;
+ var resourceName = resource.Key.ToString();
+
+ reader.GetResourceData(resourceName, out resourceType, out resourceData);
+
+ var kind = GetResourceKind(resourceType, resourceData);
+
+ if (kind == ResourceKind.Bitmap)
+ {
+ using (var stream = new MemoryStream(resourceData.Length))
+ {
+ var bitmapProcessor = new nanoBitmapProcessor((Bitmap)resource.Value);
+ bitmapProcessor.Process(writer.GetMemoryBasedClone(stream));
+ resourceData = stream.ToArray();
+ }
+ }
+
+ orderedResources.Add(GenerateIdFromResourceName(resourceName),
+ new Tuple(kind, resourceData));
+
+ ++count;
+ }
+ }
+
+ _context.ResourceFileTable.AddResourceFile(item, count);
+ }
+
+ foreach (var item in orderedResources)
+ {
+ var kind = item.Value.Item1;
+ var bytes = item.Value.Item2;
+
+ var padding = 0;
+ switch (kind)
+ {
+ case ResourceKind.String:
+ var stringLength = (int)bytes[0];
+ if (stringLength < 0x7F)
+ {
+ bytes = bytes.Skip(1).Concat(Enumerable.Repeat((byte)0, 1)).ToArray();
+ }
+ else
+ {
+ bytes = bytes.Skip(2).Concat(Enumerable.Repeat((byte)0, 1)).ToArray();
+ }
+ break;
+ case ResourceKind.Bitmap:
+ padding = _context.ResourceDataTable.AlignToWord();
+ break;
+ case ResourceKind.Binary:
+ bytes = bytes.Skip(4).ToArray();
+ break;
+ case ResourceKind.Font:
+ padding = _context.ResourceDataTable.AlignToWord();
+ bytes = bytes.Skip(32).ToArray(); // File size + resource header size
+ break;
+ }
+
+ // Pre-process font data (swap endiannes if needed).
+ if (kind == ResourceKind.Font)
+ {
+ using (var stream = new MemoryStream(bytes.Length))
+ {
+ var fontProcessor = new nanoFontProcessor(bytes);
+ fontProcessor.Process(writer.GetMemoryBasedClone(stream));
+ bytes = stream.ToArray();
+ }
+ }
+
+ writer.WriteInt16(item.Key);
+ writer.WriteByte((byte)kind);
+ writer.WriteByte((byte)padding);
+ writer.WriteInt32(_context.ResourceDataTable.CurrentOffset);
+
+ _context.ResourceDataTable.AddResourceData(bytes);
+ }
+
+ if (orderedResources.Count != 0)
+ {
+ writer.WriteInt16(0x7FFF);
+ writer.WriteByte((byte)ResourceKind.None);
+ writer.WriteByte(0x00);
+ writer.WriteInt32(_context.ResourceDataTable.CurrentOffset);
+ }
+ }
+
+ private static ResourceKind GetResourceKind(
+ string resourceType,
+ byte[] resourceData)
+ {
+ if (resourceType.EndsWith(".String"))
+ {
+ return ResourceKind.String;
+ }
+
+ if (resourceType.StartsWith("System.Drawing.Bitmap"))
+ {
+ return ResourceKind.Bitmap;
+ }
+
+ using(var stream = new MemoryStream(resourceData))
+ using (var reader = new BinaryReader(stream))
+ {
+ var size = reader.ReadUInt32();
+ return (size > 4 && reader.ReadUInt32() == FONT_HEADER_MAGIC
+ ? ResourceKind.Font
+ : ResourceKind.Binary);
+ }
+ }
+
+ private static short GenerateIdFromResourceName(
+ string value)
+ {
+ var hash1 = (5381 << 16) + 5381;
+ var hash2 = hash1;
+
+ for (var i = 0; i < value.Length; ++i)
+ {
+ var c = value[i];
+ if (i % 2 == 0)
+ {
+ hash1 = ((hash1 << 5) + hash1) ^ c;
+ }
+ else
+ {
+ hash2 = ((hash2 << 5) + hash2) ^ c;
+ }
+ }
+
+ var hash = hash1 + (hash2 * 1566083941);
+
+ return (short)((short)(hash >> 16) ^ (short)hash);
+ }
+
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoSignaturesTable.cs b/source/MetadataProcessor.Core/Tables/nanoSignaturesTable.cs
new file mode 100644
index 00000000..eced3911
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoSignaturesTable.cs
@@ -0,0 +1,591 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using Mono.Cecil.Cil;
+using Mono.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing member (methods or fields) signatures list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoSignaturesTable : InanoTable
+ {
+ ///
+ /// Helper class for comparing two instances of objects
+ /// using full array content for comparison (length of arrays also should be equal).
+ ///
+ private sealed class ByteArrayComparer : IEqualityComparer
+ {
+ ///
+ public bool Equals(byte[] lhs, byte[] rhs)
+ {
+ return (lhs.Length == rhs.Length && lhs.SequenceEqual(rhs));
+ }
+
+ ///
+ public int GetHashCode(byte[] that)
+ {
+ return that.Aggregate(37, (hash, item) => item ^ hash);
+ }
+ }
+
+ private static readonly IDictionary _primitiveTypes =
+ new Dictionary(StringComparer.Ordinal);
+
+ static nanoSignaturesTable()
+ {
+ _primitiveTypes.Add(typeof(void).FullName, nanoCLR_DataType.DATATYPE_VOID);
+
+ _primitiveTypes.Add(typeof(sbyte).FullName, nanoCLR_DataType.DATATYPE_I1);
+ _primitiveTypes.Add(typeof(short).FullName, nanoCLR_DataType.DATATYPE_I2);
+ _primitiveTypes.Add(typeof(int).FullName, nanoCLR_DataType.DATATYPE_I4);
+ _primitiveTypes.Add(typeof(long).FullName, nanoCLR_DataType.DATATYPE_I8);
+
+ _primitiveTypes.Add(typeof(byte).FullName, nanoCLR_DataType.DATATYPE_U1);
+ _primitiveTypes.Add(typeof(ushort).FullName, nanoCLR_DataType.DATATYPE_U2);
+ _primitiveTypes.Add(typeof(uint).FullName, nanoCLR_DataType.DATATYPE_U4);
+ _primitiveTypes.Add(typeof(ulong).FullName, nanoCLR_DataType.DATATYPE_U8);
+
+ _primitiveTypes.Add(typeof(float).FullName, nanoCLR_DataType.DATATYPE_R4);
+ _primitiveTypes.Add(typeof(double).FullName, nanoCLR_DataType.DATATYPE_R8);
+
+ _primitiveTypes.Add(typeof(char).FullName, nanoCLR_DataType.DATATYPE_CHAR);
+ _primitiveTypes.Add(typeof(string).FullName, nanoCLR_DataType.DATATYPE_STRING);
+ _primitiveTypes.Add(typeof(bool).FullName, nanoCLR_DataType.DATATYPE_BOOLEAN);
+
+ _primitiveTypes.Add(typeof(object).FullName, nanoCLR_DataType.DATATYPE_OBJECT);
+ _primitiveTypes.Add(typeof(IntPtr).FullName, nanoCLR_DataType.DATATYPE_I4);
+ _primitiveTypes.Add(typeof(UIntPtr).FullName, nanoCLR_DataType.DATATYPE_U4);
+ }
+
+ ///
+ /// Stores list of unique signatures and corresspoinding identifiers.
+ ///
+ private readonly IDictionary _idsBySignatures =
+ new Dictionary(new ByteArrayComparer());
+
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ private readonly nanoTablesContext _context;
+
+ ///
+ /// Last available signature id (offset in resulting table).
+ ///
+ private ushort _lastAvailableId;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoSignaturesTable(
+ nanoTablesContext context)
+ {
+ _context = context;
+ }
+
+ ///
+ /// Gets existing or creates new singature identifier for method definition.
+ ///
+ /// Method definition in Mono.Cecil format.
+ public ushort GetOrCreateSignatureId(
+ MethodDefinition methodDefinition)
+ {
+ return GetOrCreateSignatureIdImpl(GetSignature(methodDefinition));
+ }
+
+ ///
+ /// Gets existing or creates new singature identifier for field definition.
+ ///
+ /// Field definition in Mono.Cecil format.
+ public ushort GetOrCreateSignatureId(
+ FieldDefinition fieldDefinition)
+ {
+ return GetOrCreateSignatureIdImpl(GetSignature(fieldDefinition.FieldType, true));
+ }
+
+ ///
+ /// Gets existing or creates new singature identifier for field reference.
+ ///
+ /// Field reference in Mono.Cecil format.
+ public ushort GetOrCreateSignatureId(
+ FieldReference fieldReference)
+ {
+ return GetOrCreateSignatureIdImpl(GetSignature(fieldReference));
+ }
+
+ ///
+ /// Gets existing or creates new singature identifier for member reference.
+ ///
+ /// Method reference in Mono.Cecil format.
+ public ushort GetOrCreateSignatureId(
+ MethodReference methodReference)
+ {
+ return GetOrCreateSignatureIdImpl(GetSignature(methodReference));
+ }
+
+ ///
+ /// Gets existing or creates new singature identifier for list of local variables.
+ ///
+ /// List of variables information in Mono.Cecil format.
+ public ushort GetOrCreateSignatureId(
+ Collection variables)
+ {
+ if (variables == null || variables.Count == 0)
+ {
+ return 0xFFFF; // No local variables
+ }
+
+ return GetOrCreateSignatureIdImpl(GetSignature(variables));
+ }
+
+ ///
+ /// Gets existing or creates new singature identifier for list of class interfaces.
+ ///
+ /// List of interfaes information in Mono.Cecil format.
+ public ushort GetOrCreateSignatureId(
+ Collection interfaces)
+ {
+ if (interfaces == null || interfaces.Count == 0)
+ {
+ return 0xFFFF; // No implemented interfaces
+ }
+
+ return GetOrCreateSignatureIdImpl(GetSignature(interfaces));
+ }
+
+ ///
+ /// Gets existing or creates new field default value (just writes value as is with size).
+ ///
+ /// Default field value in binary format.
+ public ushort GetOrCreateSignatureId(
+ byte[] defaultValue)
+ {
+ if (defaultValue == null || defaultValue.Length == 0)
+ {
+ return 0xFFFF; // No default value
+ }
+
+ return GetOrCreateSignatureIdImpl(GetSignature(defaultValue));
+ }
+
+ ///
+ /// Gets existing or creates new type reference signature (used for encoding type specification).
+ ///
+ /// Interface implementation in Mono.Cecil format.
+ public ushort GetOrCreateSignatureId(
+ InterfaceImplementation interfaceImplementation)
+ {
+ return GetOrCreateSignatureIdImpl(GetSignature(interfaceImplementation, false));
+ }
+
+ ///
+ /// Gets existing or creates new type reference signature (used for encoding type specification).
+ ///
+ /// Type reference in Mono.Cecil format.
+ public ushort GetOrCreateSignatureId(
+ TypeReference typeReference)
+ {
+ return GetOrCreateSignatureIdImpl(GetSignature(typeReference, false));
+ }
+
+ ///
+ /// Gets existing or creates new custom attribute signature.
+ ///
+ /// Custom attribute in Mono.Cecil format.
+ public ushort GetOrCreateSignatureId(CustomAttribute customAttribute)
+ {
+ return GetOrCreateSignatureIdImpl(GetSignature(customAttribute));
+ }
+
+ ///
+ /// Writes data tzpe signature into ouput stream.
+ ///
+ /// Tzpe reference or definition in Mono.Cecil format.
+ /// Target binary writer for writing signature information.
+ /// If set to true also sub-type will be written.
+ /// If set to true expand enum with base type.
+ public void WriteDataType(
+ TypeReference typeDefinition,
+ nanoBinaryWriter writer,
+ bool alsoWriteSubType,
+ bool expandEnumType)
+ {
+ nanoCLR_DataType dataType;
+ if (_primitiveTypes.TryGetValue(typeDefinition.FullName, out dataType))
+ {
+ writer.WriteByte((byte)dataType);
+ return;
+ }
+
+ if (typeDefinition is TypeSpecification)
+ {
+ //Debug.Fail("Gotcha!");
+ }
+
+ if (typeDefinition.MetadataType == MetadataType.Class)
+ {
+ writer.WriteByte((byte)nanoCLR_DataType.DATATYPE_CLASS);
+ if (alsoWriteSubType)
+ {
+ WriteSubTypeInfo(typeDefinition, writer);
+ }
+ return;
+ }
+
+ if (typeDefinition.MetadataType == MetadataType.ValueType)
+ {
+ var resolvedType = typeDefinition.Resolve();
+ if (resolvedType != null && resolvedType.IsEnum && expandEnumType)
+ {
+ var baseTypeValue = resolvedType.Fields.FirstOrDefault(item => item.IsSpecialName);
+ if (baseTypeValue != null)
+ {
+ WriteTypeInfo(baseTypeValue.FieldType, writer);
+ return;
+ }
+ }
+
+ writer.WriteByte((byte)nanoCLR_DataType.DATATYPE_VALUETYPE);
+ if (alsoWriteSubType)
+ {
+ WriteSubTypeInfo(typeDefinition, writer);
+ }
+ return;
+ }
+
+ if (typeDefinition.IsArray)
+ {
+ writer.WriteByte((byte)nanoCLR_DataType.DATATYPE_SZARRAY);
+
+ if (alsoWriteSubType)
+ {
+ var array = (ArrayType)typeDefinition;
+ WriteDataType(array.ElementType, writer, true, expandEnumType);
+ }
+ return;
+ }
+
+ writer.WriteByte(0x00);
+ }
+
+ ///
+ public void Write(
+ nanoBinaryWriter writer)
+ {
+ foreach (var signature in _idsBySignatures
+ .OrderBy(item => item.Value)
+ .Select(item => item.Key))
+ {
+ writer.WriteBytes(signature);
+ }
+ }
+
+ private byte[] GetSignature(
+ FieldReference fieldReference)
+ {
+ using (var buffer = new MemoryStream())
+ using (var writer = new BinaryWriter(buffer)) // Only Write(Byte) will be used
+ {
+ var binaryWriter = nanoBinaryWriter.CreateBigEndianBinaryWriter(writer);
+
+ binaryWriter.WriteByte(0x06); // Field reference calling convention
+ WriteTypeInfo(fieldReference.FieldType, binaryWriter);
+
+ return buffer.ToArray();
+ }
+ }
+
+ private byte[] GetSignature(
+ IMethodSignature methodReference)
+ {
+ using (var buffer = new MemoryStream())
+ using (var writer = new BinaryWriter(buffer)) // Only Write(Byte) will be used
+ {
+ var binaryWriter = nanoBinaryWriter.CreateLittleEndianBinaryWriter(writer);
+ writer.Write((byte)(methodReference.HasThis ? 0x20 : 0x00));
+
+ writer.Write((byte)(methodReference.Parameters.Count));
+
+ WriteTypeInfo(methodReference.ReturnType, binaryWriter);
+ foreach (var parameter in methodReference.Parameters)
+ {
+ WriteTypeInfo(parameter.ParameterType, binaryWriter);
+ }
+
+ return buffer.ToArray();
+ }
+ }
+
+ private byte[] GetSignature(
+ IEnumerable variables)
+ {
+ using (var buffer = new MemoryStream())
+ using (var writer = new BinaryWriter(buffer)) // Only Write(Byte) will be used
+ {
+ var binaryWriter = nanoBinaryWriter.CreateBigEndianBinaryWriter(writer);
+ foreach (var variable in variables)
+ {
+ WriteTypeInfo(variable.VariableType, binaryWriter);
+ }
+
+ return buffer.ToArray();
+ }
+ }
+
+ private byte[] GetSignature(
+ Collection interfaces)
+ {
+ using (var buffer = new MemoryStream())
+ using (var writer = new BinaryWriter(buffer)) // Only Write(Byte) will be used
+ {
+ var binaryWriter = nanoBinaryWriter.CreateBigEndianBinaryWriter(writer);
+
+ binaryWriter.WriteByte((byte)interfaces.Count);
+ foreach (var item in interfaces)
+ {
+ WriteSubTypeInfo(item.InterfaceType, binaryWriter);
+ }
+
+ return buffer.ToArray();
+ }
+ }
+
+ private byte[] GetSignature(
+ TypeReference typeReference,
+ bool isFieldSignature)
+ {
+ using (var buffer = new MemoryStream())
+ using (var writer = new BinaryWriter(buffer)) // Only Write(Byte) will be used
+ {
+ var binaryWriter = nanoBinaryWriter.CreateBigEndianBinaryWriter(writer);
+
+ if (isFieldSignature)
+ {
+ writer.Write((byte)0x06); // Field signature prefix
+ }
+ WriteTypeInfo(typeReference, binaryWriter);
+
+ return buffer.ToArray();
+ }
+ }
+
+ private byte[] GetSignature(
+ InterfaceImplementation typeReference,
+ bool isFieldSignature)
+ {
+ return GetSignature(typeReference.InterfaceType, isFieldSignature);
+ }
+
+ private byte[] GetSignature(
+ byte[] defaultValue)
+ {
+ using (var buffer = new MemoryStream())
+ using (var writer = new BinaryWriter(buffer))
+ {
+ writer.Write((byte)defaultValue.Length);
+ writer.Write((byte)0x00); // TODO: investigate this temporary fix
+ writer.Write(defaultValue);
+
+ return buffer.ToArray();
+ }
+ }
+
+ private byte[] GetSignature(
+ CustomAttribute customAttribute)
+ {
+ using (var buffer = new MemoryStream())
+ using (var writer = new BinaryWriter(buffer))
+ {
+ foreach (var argument in customAttribute.ConstructorArguments)
+ {
+ WriteAttributeArgumentValue(writer, argument);
+ }
+
+ // TODO: use compressed format
+ writer.Write((ushort)(customAttribute.Properties.Count + customAttribute.Fields.Count));
+
+ foreach (var namedArgument in customAttribute.Fields.OrderBy(item => item.Name))
+ {
+ writer.Write((byte)nanoSerializationType.SERIALIZATION_TYPE_FIELD);
+ writer.Write(_context.StringTable.GetOrCreateStringId(namedArgument.Name));
+ WriteAttributeArgumentValue(writer, namedArgument.Argument);
+ }
+
+ foreach (var namedArgument in customAttribute.Properties.OrderBy(item => item.Name))
+ {
+ writer.Write((byte)nanoSerializationType.SERIALIZATION_TYPE_PROPERTY);
+ writer.Write(_context.StringTable.GetOrCreateStringId(namedArgument.Name));
+ WriteAttributeArgumentValue(writer, namedArgument.Argument);
+ }
+
+ return buffer.ToArray();
+ }
+ }
+
+ private void WriteAttributeArgumentValue(
+ BinaryWriter writer,
+ CustomAttributeArgument argument)
+ {
+ nanoCLR_DataType dataType;
+ if (_primitiveTypes.TryGetValue(argument.Type.FullName, out dataType))
+ {
+ switch (dataType)
+ {
+ case nanoCLR_DataType.DATATYPE_BOOLEAN:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_BOOLEAN);
+ writer.Write((byte)((bool)argument.Value ? 1 : 0));
+ break;
+ case nanoCLR_DataType.DATATYPE_I1:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_I1);
+ writer.Write((sbyte)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_U1:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_U1);
+ writer.Write((byte)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_I2:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_I2);
+ writer.Write((short)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_U2:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_U2);
+ writer.Write((ushort)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_I4:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_I4);
+ writer.Write((int)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_U4:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_U4);
+ writer.Write((uint)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_I8:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_I8);
+ writer.Write((long)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_U8:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_U8);
+ writer.Write((ulong)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_R4:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_R4);
+ writer.Write((float)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_R8:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_R8);
+ writer.Write((double)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_CHAR:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_CHAR);
+ writer.Write((char)argument.Value);
+ break;
+ case nanoCLR_DataType.DATATYPE_STRING:
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_STRING);
+ writer.Write(_context.StringTable.GetOrCreateStringId((string)argument.Value));
+ break;
+ default:
+ Debug.Fail(dataType.ToString());
+ break;
+ }
+ }
+ if (argument.Type.FullName == "System.Type")
+ {
+ writer.Write((byte)nanoSerializationType.ELEMENT_TYPE_STRING);
+ writer.Write(_context.StringTable.GetOrCreateStringId(((TypeReference)argument.Value).FullName));
+ }
+ }
+
+ private ushort GetOrCreateSignatureIdImpl(
+ byte[] signature)
+ {
+ ushort id;
+ if (_idsBySignatures.TryGetValue(signature, out id))
+ {
+ return id;
+ }
+
+ var fullSignatures = GetFullSignaturesArray();
+ for (var i = 0; i < fullSignatures.Length - signature.Length; ++i)
+ {
+ if (signature.SequenceEqual(fullSignatures.Skip(i).Take(signature.Length)))
+ {
+ return (ushort)i;
+ }
+ }
+
+ id = _lastAvailableId;
+ _idsBySignatures.Add(signature, id);
+ _lastAvailableId += (ushort)signature.Length;
+
+ return id;
+ }
+
+ private void WriteTypeInfo(
+ TypeReference typeReference,
+ nanoBinaryWriter writer)
+ {
+ if (typeReference.IsOptionalModifier)
+ {
+ writer.WriteByte(0); // OpTypeModifier ???
+ }
+
+ var byReference = typeReference as ByReferenceType;
+ if (byReference != null)
+ {
+ writer.WriteByte((byte)nanoCLR_DataType.DATATYPE_BYREF);
+ WriteDataType(byReference.ElementType, writer, true, false);
+ }
+ else
+ {
+ WriteDataType(typeReference, writer, true, false);
+ }
+ }
+
+ private byte[] GetFullSignaturesArray()
+ {
+ return _idsBySignatures
+ .OrderBy(item => item.Value)
+ .Select(item => item.Key)
+ .Aggregate(new List(),
+ (current, item) =>
+ {
+ current.AddRange(item);
+ return current;
+ })
+ .ToArray();
+ }
+
+ private void WriteSubTypeInfo(TypeReference typeDefinition, nanoBinaryWriter writer)
+ {
+ ushort referenceId;
+ if (typeDefinition is TypeSpecification &&
+ _context.TypeSpecificationsTable.TryGetTypeReferenceId(typeDefinition, out referenceId))
+ {
+ writer.WriteMetadataToken(((uint)referenceId << 2) | 0x04);
+ }
+ else if (_context.TypeReferencesTable.TryGetTypeReferenceId(typeDefinition, out referenceId))
+ {
+ writer.WriteMetadataToken(((uint)referenceId << 2) | 0x01);
+ }
+ else if (_context.TypeDefinitionTable.TryGetTypeReferenceId(
+ typeDefinition.Resolve(), out referenceId))
+ {
+ writer.WriteMetadataToken((uint)referenceId << 2);
+ }
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoStringTable.cs b/source/MetadataProcessor.Core/Tables/nanoStringTable.cs
new file mode 100644
index 00000000..118debc2
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoStringTable.cs
@@ -0,0 +1,116 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing strings list and writing this
+ /// list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoStringTable : InanoTable
+ {
+ ///
+ /// Default implementation of interface.
+ /// Do nothing and just returns original sequence of string literals.
+ ///
+ private sealed class EmptyStringSorter : ICustomStringSorter
+ {
+ ///
+ public IEnumerable Sort(
+ ICollection strings)
+ {
+ return strings;
+ }
+ }
+
+ ///
+ /// Maps for each unique string and related identifier (offset in strings table).
+ ///
+ private readonly Dictionary _idsByStrings =
+ new Dictionary(StringComparer.Ordinal);
+
+ ///
+ /// Concrete implementation of string literals sorting algorithm (used by UTs).
+ ///
+ private readonly ICustomStringSorter _stringSorter;
+
+ ///
+ /// Last available string identifier.
+ ///
+ private ushort _lastAvailableId;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ public nanoStringTable(
+ ICustomStringSorter stringSorter = null)
+ {
+ GetOrCreateStringId(string.Empty); // First item in string table always empty string
+ _stringSorter = stringSorter ?? new EmptyStringSorter();
+ }
+
+ ///
+ /// Gets existing or creates new string reference identifier related to passed string value.
+ ///
+ ///
+ /// Identifier is offset in strings table or just number from table of pre-defined constants.
+ ///
+ /// String value for obtaining identifier.
+ ///
+ /// If true hard-coded string constants table will be used (should be false
+ /// for byte code writer because onlyloader use this pre-defined string table optimization).
+ ///
+ /// Existing identifier if string already in table or new one.
+ public ushort GetOrCreateStringId(
+ string value,
+ bool useConstantsTable = true)
+ {
+ ushort id;
+ if (useConstantsTable && nanoStringsConstants.TryGetStringIndex(value, out id))
+ {
+ return id;
+ }
+ if (!_idsByStrings.TryGetValue(value, out id))
+ {
+ id = _lastAvailableId;
+ _idsByStrings.Add(value, id);
+ var length = Encoding.UTF8.GetBytes(value).Length + 1;
+ _lastAvailableId += (ushort)(length);
+ }
+ return id;
+ }
+
+ ///
+ public void Write(
+ nanoBinaryWriter writer)
+ {
+ foreach (var item in _idsByStrings
+ .OrderBy(item => item.Value)
+ .Select(item => item.Key))
+ {
+ writer.WriteString(item);
+ }
+ }
+
+ ///
+ /// Adds all string constants from table into this one.
+ ///
+ /// Additional string table for merging with this one.
+ internal void MergeValues(
+ nanoStringTable fakeStringTable)
+ {
+ foreach (var item in _stringSorter.Sort(fakeStringTable._idsByStrings.Keys))
+ {
+ GetOrCreateStringId(item, false);
+ }
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoTablesContext.cs b/source/MetadataProcessor.Core/Tables/nanoTablesContext.cs
new file mode 100644
index 00000000..fc54915f
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoTablesContext.cs
@@ -0,0 +1,400 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ public sealed class nanoTablesContext
+ {
+ private readonly HashSet _ignoringAttributes =
+ new HashSet(StringComparer.Ordinal)
+ {
+ // Assembly-level attributes
+ "System.Reflection.AssemblyCultureAttribute",
+ "System.Reflection.AssemblyVersionAttribute",
+ "System.Reflection.AssemblyFileVersionAttribute",
+ "System.Reflection.AssemblyTrademarkAttribute",
+ "System.Reflection.AssemblyTitleAttribute",
+ "System.Reflection.AssemblyProductAttribute",
+ "System.Reflection.AssemblyKeyNameAttribute",
+ "System.Reflection.AssemblyKeyFileAttribute",
+ "System.Reflection.AssemblyInformationalVersionAttribute",
+ "System.Reflection.AssemblyFlagsAttribute",
+ "System.Reflection.AssemblyDescriptionAttribute",
+ "System.Reflection.AssemblyDelaySignAttribute",
+ "System.Reflection.AssemblyDefaultAliasAttribute",
+ "System.Reflection.AssemblyCopyrightAttribute",
+ "System.Reflection.AssemblyConfigurationAttribute",
+ "System.Reflection.AssemblyCompanyAttribute",
+ "System.Runtime.InteropServices.ComVisibleAttribute",
+ "System.Runtime.InteropServices.GuidAttribute",
+
+ // Compiler-specific attributes
+ "System.ParamArrayAttribute",
+ "System.SerializableAttribute",
+ "System.NonSerializedAttribute",
+ "System.Runtime.InteropServices.StructLayoutAttribute",
+ "System.Runtime.InteropServices.LayoutKind",
+ "System.Runtime.InteropServices.OutAttribute",
+ "System.Runtime.CompilerServices.ExtensionAttribute",
+ "System.Runtime.CompilerServices.MethodImplAttribute",
+ "System.Runtime.CompilerServices.InternalsVisibleToAttribute",
+ "System.Runtime.CompilerServices.IndexerNameAttribute",
+ "System.Runtime.CompilerServices.MethodImplOptions",
+ "System.Reflection.FieldNoReflectionAttribute",
+ "System.Reflection.DefaultMemberAttribute",
+
+ // Debugger-specific attributes
+ "System.Diagnostics.DebuggableAttribute",
+ "System.Diagnostics.DebuggerNonUserCodeAttribute",
+ "System.Diagnostics.DebuggerStepThroughAttribute",
+ "System.Diagnostics.DebuggerDisplayAttribute",
+ "System.Diagnostics.DebuggerBrowsableAttribute",
+ "System.Diagnostics.DebuggerBrowsableState",
+ "System.Diagnostics.DebuggerHiddenAttribute",
+
+ // Compile-time attributes
+ "System.AttributeUsageAttribute",
+ "System.CLSCompliantAttribute",
+ "System.FlagsAttribute",
+ "System.ObsoleteAttribute",
+ "System.Diagnostics.ConditionalAttribute",
+
+ // Intellisense filtering attributes
+ "System.ComponentModel.EditorBrowsableAttribute",
+
+ // Not supported attributes
+ "System.MTAThreadAttribute",
+ "System.STAThreadAttribute",
+ "System.Reflection.DefaultMemberAttribute",
+ };
+
+ public nanoTablesContext(
+ AssemblyDefinition assemblyDefinition,
+ List explicitTypesOrder,
+ ICustomStringSorter stringSorter,
+ bool applyAttributesCompression)
+ {
+ AssemblyDefinition = assemblyDefinition;
+
+ foreach (var item in assemblyDefinition.CustomAttributes)
+ {
+ _ignoringAttributes.Add(item.AttributeType.FullName);
+ }
+
+ NativeMethodsCrc = new NativeMethodsCrc(assemblyDefinition);
+
+ var mainModule = AssemblyDefinition.MainModule;
+
+ // External references
+
+ AssemblyReferenceTable = new nanoAssemblyReferenceTable(
+ mainModule.AssemblyReferences, this);
+
+ var typeReferences = mainModule.GetTypeReferences()
+ .Where(item => !IsAttribute(item))
+ .ToList();
+ TypeReferencesTable = new nanoTypeReferenceTable(
+ typeReferences, this);
+
+ var typeReferencesNames = new HashSet(
+ typeReferences.Select(item => item.FullName),
+ StringComparer.Ordinal);
+ var memberReferences = mainModule.GetMemberReferences()
+ .Where(item => typeReferencesNames.Contains(item.DeclaringType.FullName))
+ .ToList();
+ FieldReferencesTable = new nanoFieldReferenceTable(
+ memberReferences.OfType(), this);
+ MethodReferencesTable = new nanoMethodReferenceTable(
+ memberReferences.OfType(), this);
+
+ // Internal types definitions
+
+ var types = GetOrderedTypes(mainModule, explicitTypesOrder);
+
+ TypeDefinitionTable = new nanoTypeDefinitionTable(types, this);
+
+ var fields = types
+ .SelectMany(item => GetOrderedFields(item.Fields.Where(field => !field.HasConstant)))
+ .ToList();
+ FieldsTable = new nanoFieldDefinitionTable(fields, this);
+
+ var methods = types.SelectMany(item => GetOrderedMethods(item.Methods)).ToList();
+
+ MethodDefinitionTable = new nanoMethodDefinitionTable(methods, this);
+
+ AttributesTable = new nanoAttributesTable(
+ GetAttributes(types, applyAttributesCompression),
+ GetAttributes(fields, applyAttributesCompression),
+ GetAttributes(methods, applyAttributesCompression),
+ this);
+
+ TypeSpecificationsTable = new nanoTypeSpecificationsTable(this);
+
+ // Resources information
+
+ ResourcesTable = new nanoResourcesTable(
+ mainModule.Resources, this);
+ ResourceDataTable = new nanoResourceDataTable();
+
+ // Strings and signatures
+
+ SignaturesTable = new nanoSignaturesTable(this);
+ StringTable = new nanoStringTable(stringSorter);
+
+ // Byte code table
+ ByteCodeTable = new nanoByteCodeTable(this);
+
+ // Additional information
+
+ ResourceFileTable = new nanoResourceFileTable(this);
+
+ // Pre-allocate strings from some tables
+ AssemblyReferenceTable.AllocateStrings();
+ TypeReferencesTable.AllocateStrings();
+ foreach (var item in memberReferences)
+ {
+ StringTable.GetOrCreateStringId(item.Name);
+
+ var fieldReference = item as FieldReference;
+ if (fieldReference != null)
+ {
+ SignaturesTable.GetOrCreateSignatureId(fieldReference);
+ }
+
+ var methodReference = item as MethodReference;
+ if (methodReference != null)
+ {
+ SignaturesTable.GetOrCreateSignatureId(methodReference);
+ }
+ }
+ }
+
+ ///
+ /// Gets method reference identifier (external or internal) encoded with appropriate prefix.
+ ///
+ /// Method reference in Mono.Cecil format.
+ /// Reference identifier for passed value.
+ public ushort GetMethodReferenceId(
+ MethodReference methodReference)
+ {
+ ushort referenceId;
+ if (MethodReferencesTable.TryGetMethodReferenceId(methodReference, out referenceId))
+ {
+ referenceId |= 0x8000; // External method reference
+ }
+ else
+ {
+ MethodDefinitionTable.TryGetMethodReferenceId(methodReference.Resolve(), out referenceId);
+ }
+ return referenceId;
+ }
+
+ public AssemblyDefinition AssemblyDefinition { get; private set; }
+
+ public NativeMethodsCrc NativeMethodsCrc { get; private set; }
+
+ public nanoAssemblyReferenceTable AssemblyReferenceTable { get; private set; }
+
+ public nanoTypeReferenceTable TypeReferencesTable { get; private set; }
+
+ public nanoFieldReferenceTable FieldReferencesTable { get; private set; }
+
+ public nanoMethodReferenceTable MethodReferencesTable { get; private set; }
+
+ public nanoFieldDefinitionTable FieldsTable { get; private set; }
+
+ public nanoMethodDefinitionTable MethodDefinitionTable { get; private set; }
+
+ public nanoTypeDefinitionTable TypeDefinitionTable { get; private set; }
+
+ public nanoAttributesTable AttributesTable { get; private set; }
+
+ public nanoTypeSpecificationsTable TypeSpecificationsTable { get; private set; }
+
+ public nanoResourcesTable ResourcesTable { get; private set; }
+
+ public nanoResourceDataTable ResourceDataTable { get; private set; }
+
+ public nanoSignaturesTable SignaturesTable { get; private set; }
+
+ public nanoStringTable StringTable { get; private set; }
+
+ public nanoByteCodeTable ByteCodeTable { get; private set; }
+
+ public nanoResourceFileTable ResourceFileTable { get; private set; }
+
+ private IEnumerable> GetAttributes(
+ IEnumerable types,
+ bool applyAttributesCompression)
+ {
+ if (applyAttributesCompression)
+ {
+ return types.SelectMany(
+ (item, index) => item.CustomAttributes
+ .Where(attr => !IsAttribute(attr.AttributeType))
+ .OrderByDescending(attr => attr.AttributeType.FullName)
+ .Select(attr => new Tuple(attr, (ushort)index)));
+
+ }
+ return types.SelectMany(
+ (item, index) => item.CustomAttributes
+ .Where(attr => !IsAttribute(attr.AttributeType))
+ .Select(attr => new Tuple(attr, (ushort)index)));
+ }
+
+ private bool IsAttribute(
+ MemberReference typeReference)
+ {
+ return
+ _ignoringAttributes.Contains(typeReference.FullName) ||
+ (typeReference.DeclaringType != null &&
+ _ignoringAttributes.Contains(typeReference.DeclaringType.FullName));
+ }
+
+ private static List GetOrderedTypes(
+ ModuleDefinition mainModule,
+ List explicitTypesOrder)
+ {
+ var unorderedTypes = mainModule.GetTypes()
+ .Where(item => item.FullName != "")
+ .ToList();
+
+ if (explicitTypesOrder == null || explicitTypesOrder.Count == 0)
+ {
+ return SortTypesAccordingUsages(
+ unorderedTypes, mainModule.FileName);
+ }
+
+ return explicitTypesOrder
+ .Join(unorderedTypes, outer => outer, inner => inner.FullName, (inner, outer) => outer)
+ .ToList();
+ }
+
+ private static List SortTypesAccordingUsages(
+ IEnumerable types,
+ string mainModuleName)
+ {
+ var processedTypes = new HashSet(StringComparer.Ordinal);
+ return SortTypesAccordingUsagesImpl(
+ types.OrderBy(item => item.FullName),
+ mainModuleName, processedTypes)
+ .ToList();
+ }
+
+ private static IEnumerable SortTypesAccordingUsagesImpl(
+ IEnumerable types,
+ string mainModuleName,
+ ISet processedTypes)
+ {
+ foreach (var type in types)
+ {
+ if (processedTypes.Contains(type.FullName))
+ {
+ continue;
+ }
+
+ if (type.DeclaringType != null)
+ {
+ foreach (var declaredIn in SortTypesAccordingUsagesImpl(
+ Enumerable.Repeat(type.DeclaringType, 1), mainModuleName, processedTypes))
+ {
+ yield return declaredIn;
+ }
+ }
+
+ foreach (var implement in SortTypesAccordingUsagesImpl(
+ type.Interfaces.Select(itf => itf.InterfaceType.Resolve())
+ .Where(item => item.Module.FileName == mainModuleName),
+ mainModuleName, processedTypes))
+ {
+ yield return implement;
+ }
+
+ if (processedTypes.Add(type.FullName))
+ {
+ var operands = type.Methods
+ .Where(item => item.HasBody)
+ .SelectMany(item => item.Body.Instructions)
+ .Select(item => item.Operand)
+ .OfType()
+ .ToList();
+
+ foreach (var fieldType in SortTypesAccordingUsagesImpl(
+ operands.SelectMany(GetTypesList)
+ .Where(item => item.Module.FileName == mainModuleName),
+ mainModuleName, processedTypes))
+ {
+ yield return fieldType;
+ }
+
+ yield return type;
+ }
+ }
+ }
+
+ private static IEnumerable GetTypesList(
+ MethodReference methodReference)
+ {
+ var returnType = methodReference.ReturnType.Resolve();
+ if (returnType != null && returnType.FullName != "System.Void")
+ {
+ yield return returnType;
+ }
+ foreach (var parameter in methodReference.Parameters)
+ {
+ var parameterType = parameter.ParameterType.Resolve();
+ if (parameterType != null)
+ {
+ yield return parameterType;
+ }
+ }
+ }
+
+ private static IEnumerable GetOrderedMethods(
+ IEnumerable methods)
+ {
+ var ordered = methods
+ .ToList();
+
+ foreach (var method in ordered.Where(item => item.IsVirtual))
+ {
+ yield return method;
+ }
+
+ foreach (var method in ordered.Where(item => !(item.IsVirtual || item.IsStatic)))
+ {
+ yield return method;
+ }
+
+ foreach (var method in ordered.Where(item => item.IsStatic))
+ {
+ yield return method;
+ }
+ }
+
+ private static IEnumerable GetOrderedFields(
+ IEnumerable fields)
+ {
+ var ordered = fields
+ .ToList();
+
+ foreach (var method in ordered.Where(item => item.IsStatic))
+ {
+ yield return method;
+ }
+
+ foreach (var method in ordered.Where(item => !item.IsStatic))
+ {
+ yield return method;
+ }
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoTypeDefinitionTable.cs b/source/MetadataProcessor.Core/Tables/nanoTypeDefinitionTable.cs
new file mode 100644
index 00000000..4ab64a5a
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoTypeDefinitionTable.cs
@@ -0,0 +1,378 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using Mono.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing type definitions (complete type metadata) list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoTypeDefinitionTable :
+ nanoReferenceTableBase
+ {
+ ///
+ /// Helper class for comparing two instances of objects
+ /// using property as unique key for comparison.
+ ///
+ private sealed class TypeDefinitionEqualityComparer : IEqualityComparer
+ {
+ ///
+ public bool Equals(TypeDefinition lhs, TypeDefinition rhs)
+ {
+ return string.Equals(lhs.FullName, rhs.FullName, StringComparison.Ordinal);
+ }
+
+ ///
+ public int GetHashCode(TypeDefinition item)
+ {
+ return item.FullName.GetHashCode();
+ }
+ }
+
+ private IDictionary>> _byteCodeOffsets =
+ new Dictionary>>();
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// List of types definitins in Mono.Cecil format.
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoTypeDefinitionTable(
+ IEnumerable items,
+ nanoTablesContext context)
+ : base(items, new TypeDefinitionEqualityComparer(), context)
+ {
+ }
+
+ ///
+ /// Gets type reference identifier (if type is provided and this type is defined in target assembly).
+ ///
+ ///
+ /// For null value passed in returns 0xFFFF value.
+ ///
+ /// Type definition in Mono.Cecil format.
+ /// Type reference identifier for filling.
+ /// Returns true if item found, otherwise returns false.
+ public bool TryGetTypeReferenceId(
+ TypeDefinition typeDefinition,
+ out ushort referenceId)
+ {
+ if (typeDefinition == null) // This case is possible for encoding 'nested inside' case
+ {
+ referenceId = 0xFFFF;
+ return true;
+ }
+
+ return TryGetIdByValue(typeDefinition, out referenceId);
+ }
+
+ public IEnumerable> GetByteCodeOffsets(
+ uint clrMethodToken)
+ {
+ return _byteCodeOffsets[clrMethodToken];
+ }
+
+ ///
+ protected override void WriteSingleItem(
+ nanoBinaryWriter writer,
+ TypeDefinition item)
+ {
+ _context.StringTable.GetOrCreateStringId(item.Namespace);
+
+ WriteStringReference(writer, item.Name);
+ WriteStringReference(writer, item.Namespace);
+
+ writer.WriteUInt16(GetTypeReferenceOrDefinitionId(item.BaseType));
+ writer.WriteUInt16(GetTypeReferenceOrDefinitionId(item.DeclaringType));
+
+ var fieldsList = item.Fields
+ .Where(field => !field.HasConstant)
+ .OrderByDescending(field => field.IsStatic)
+ .ToList();
+ foreach (var field in fieldsList)
+ {
+ _context.SignaturesTable.GetOrCreateSignatureId(field);
+ _context.SignaturesTable.GetOrCreateSignatureId(field.InitialValue);
+ }
+
+ using (var stream = new MemoryStream(6))
+ {
+ WriteClassFields(fieldsList, writer.GetMemoryBasedClone(stream));
+
+ if (item.DeclaringType == null)
+ {
+ foreach (var method in item.Methods)
+ {
+ var offsets = CodeWriter
+ .PreProcessMethod(method, _context.ByteCodeTable.FakeStringTable)
+ .ToList();
+ _byteCodeOffsets.Add(method.MetadataToken.ToUInt32(), offsets);
+ }
+ }
+ foreach (var nestedType in item.NestedTypes)
+ {
+ foreach (var method in nestedType.Methods)
+ {
+ var offsets = CodeWriter
+ .PreProcessMethod(method, _context.ByteCodeTable.FakeStringTable)
+ .ToList();
+ _byteCodeOffsets.Add(method.MetadataToken.ToUInt32(), offsets);
+ }
+ }
+
+ WriteMethodBodies(item.Methods, item.Interfaces, writer);
+
+ _context.SignaturesTable.WriteDataType(item, writer, false, true);
+
+ writer.WriteBytes(stream.ToArray());
+ }
+
+ writer.WriteUInt16(GetFlags(item)); // flags
+ }
+
+ private void WriteClassFields(
+ IList fieldsList,
+ nanoBinaryWriter writer)
+ {
+ var firstStaticFieldId = _context.FieldsTable.MaxFieldId;
+ var staticFieldsNumber = 0;
+ foreach (var field in fieldsList.Where(item => item.IsStatic))
+ {
+ ushort fieldReferenceId;
+ _context.FieldsTable.TryGetFieldReferenceId(field, true, out fieldReferenceId);
+ firstStaticFieldId = Math.Min(firstStaticFieldId, fieldReferenceId);
+
+ _context.SignaturesTable.GetOrCreateSignatureId(field);
+ _context.StringTable.GetOrCreateStringId(field.Name);
+
+ ++staticFieldsNumber;
+ }
+
+ var firstInstanseFieldId = _context.FieldsTable.MaxFieldId;
+ var instanceFieldsNumber = 0;
+ foreach (var field in fieldsList.Where(item => !item.IsStatic))
+ {
+ ushort fieldReferenceId;
+ _context.FieldsTable.TryGetFieldReferenceId(field, true, out fieldReferenceId);
+ firstInstanseFieldId = Math.Min(firstInstanseFieldId, fieldReferenceId);
+
+ _context.SignaturesTable.GetOrCreateSignatureId(field);
+ _context.StringTable.GetOrCreateStringId(field.Name);
+
+ ++instanceFieldsNumber;
+ }
+
+ if (firstStaticFieldId > firstInstanseFieldId)
+ {
+ firstStaticFieldId = firstInstanseFieldId;
+ }
+
+ writer.WriteUInt16(firstStaticFieldId);
+ writer.WriteUInt16(firstInstanseFieldId);
+
+ writer.WriteByte((byte) staticFieldsNumber);
+ writer.WriteByte((byte) instanceFieldsNumber);
+ }
+
+ private void WriteMethodBodies(
+ Collection methods,
+ Collection iInterfaces,
+ nanoBinaryWriter writer)
+ {
+ ushort firstMethodId = 0xFFFF;
+ var virtualMethodsNumber = 0;
+ foreach (var method in methods.Where(item => item.IsVirtual))
+ {
+ firstMethodId = Math.Min(firstMethodId, _context.ByteCodeTable.GetMethodId(method));
+ CreateMethodSignatures(method);
+ ++virtualMethodsNumber;
+ }
+
+ var instanceMethodsNumber = 0;
+ foreach (var method in methods.Where(item => !(item.IsVirtual || item.IsStatic)))
+ {
+ firstMethodId = Math.Min(firstMethodId, _context.ByteCodeTable.GetMethodId(method));
+ CreateMethodSignatures(method);
+ ++instanceMethodsNumber;
+ }
+
+ var staticMethodsNumber = 0;
+ foreach (var method in methods.Where(item => item.IsStatic))
+ {
+ firstMethodId = Math.Min(firstMethodId, _context.ByteCodeTable.GetMethodId(method));
+ CreateMethodSignatures(method);
+ ++staticMethodsNumber;
+ }
+
+ if (virtualMethodsNumber + instanceMethodsNumber + staticMethodsNumber == 0)
+ {
+ firstMethodId = _context.ByteCodeTable.NextMethodId;
+ }
+
+ writer.WriteUInt16(_context.SignaturesTable.GetOrCreateSignatureId(iInterfaces));
+
+ writer.WriteUInt16(firstMethodId);
+
+ writer.WriteByte((byte)virtualMethodsNumber);
+ writer.WriteByte((byte)instanceMethodsNumber);
+ writer.WriteByte((byte)staticMethodsNumber);
+ }
+
+ private void CreateMethodSignatures(
+ MethodDefinition method)
+ {
+ _context.SignaturesTable.GetOrCreateSignatureId(method);
+ if (method.HasBody)
+ {
+ _context.SignaturesTable.GetOrCreateSignatureId(method.Body.Variables);
+ }
+ _context.StringTable.GetOrCreateStringId(method.Name);
+ }
+
+ private ushort GetTypeReferenceOrDefinitionId(
+ TypeReference typeReference)
+ {
+ ushort referenceId;
+ if (_context.TypeReferencesTable.TryGetTypeReferenceId(typeReference, out referenceId))
+ {
+ return (ushort)(0x8000 | referenceId);
+ }
+
+ ushort typeId;
+ if (TryGetTypeReferenceId(typeReference.Resolve(), out typeId))
+ {
+ return typeId;
+ }
+
+ return 0xFFFF;
+ }
+
+ private ushort GetFlags(
+ TypeDefinition definition)
+ {
+ const ushort TD_Scope_Public = 0x0001; // Class is public scope.
+ const ushort TD_Scope_NestedPublic = 0x0002; // Class is nested with public visibility.
+ const ushort TD_Scope_NestedPrivate = 0x0003; // Class is nested with private visibility.
+ const ushort TD_Scope_NestedFamily = 0x0004; // Class is nested with family visibility.
+ const ushort TD_Scope_NestedAssembly = 0x0005; // Class is nested with assembly visibility.
+ const ushort TD_Scope_NestedFamANDAssem = 0x0006; // Class is nested with family and assembly visibility.
+ const ushort TD_Scope_NestedFamORAssem = 0x0007; // Class is nested with family or assembly visibility.
+
+ const ushort TD_Serializable = 0x0008;
+
+ const ushort TD_Semantics_ValueType = 0x0010;
+ const ushort TD_Semantics_Interface = 0x0020;
+ const ushort TD_Semantics_Enum = 0x0030;
+
+ const ushort TD_Abstract = 0x0040;
+ const ushort TD_Sealed = 0x0080;
+
+ const ushort TD_SpecialName = 0x0100;
+ const ushort TD_Delegate = 0x0200;
+ const ushort TD_MulticastDelegate = 0x0400;
+ const ushort TD_Patched = 0x0800;
+
+ const ushort TD_BeforeFieldInit = 0x1000;
+ const ushort TD_HasSecurity = 0x2000;
+ const ushort TD_HasFinalizer = 0x4000;
+ const ushort TD_HasAttributes = 0x8000;
+
+ var flags = 0x0000;
+
+ if (definition.IsPublic)
+ {
+ flags = TD_Scope_Public;
+ }
+ else if (definition.IsNestedPublic)
+ {
+ flags = TD_Scope_NestedPublic;
+ }
+ else if (definition.IsNestedPrivate)
+ {
+ flags = TD_Scope_NestedPrivate;
+ }
+ else if (definition.IsNestedFamily)
+ {
+ flags = TD_Scope_NestedFamily;
+ }
+ else if (definition.IsNestedAssembly)
+ {
+ flags = TD_Scope_NestedAssembly;
+ }
+ else if (definition.IsNestedFamilyAndAssembly)
+ {
+ flags = TD_Scope_NestedFamANDAssem;
+ }
+ else if (definition.IsNestedFamilyOrAssembly)
+ {
+ flags = TD_Scope_NestedFamORAssem;
+ }
+
+ if (definition.IsSerializable)
+ {
+ flags |= TD_Serializable;
+ }
+
+ if (definition.IsEnum)
+ {
+ flags |= TD_Semantics_Enum;
+ flags |= TD_Serializable;
+ }
+ else if (definition.IsValueType)
+ {
+ flags |= TD_Semantics_ValueType;
+ }
+ else if (definition.IsInterface)
+ {
+ flags |= TD_Semantics_Interface;
+ }
+
+ if (definition.IsAbstract)
+ {
+ flags |= TD_Abstract;
+ }
+ if (definition.IsSealed)
+ {
+ flags |= TD_Sealed;
+ }
+
+ if (definition.IsSpecialName)
+ {
+ flags |= TD_SpecialName;
+ }
+
+ if (definition.IsBeforeFieldInit)
+ {
+ flags |= TD_BeforeFieldInit;
+ }
+ if (definition.HasSecurity)
+ {
+ flags |= TD_HasSecurity;
+ }
+ if (definition.HasCustomAttributes)
+ {
+ flags |= TD_HasAttributes;
+ }
+
+ var baseType = definition.BaseType;
+ if (baseType != null && baseType.FullName == "System.MulticastDelegate")
+ {
+ flags |= TD_MulticastDelegate;
+ }
+
+ return (ushort)flags;
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoTypeReferenceTable.cs b/source/MetadataProcessor.Core/Tables/nanoTypeReferenceTable.cs
new file mode 100644
index 00000000..ad5b8c38
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoTypeReferenceTable.cs
@@ -0,0 +1,110 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing external type references list and writing
+ /// this collected list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoTypeReferenceTable :
+ nanoReferenceTableBase
+ {
+ ///
+ /// Helper class for comparing two instances of objects
+ /// using property as unique key for comparison.
+ ///
+ private sealed class TypeReferenceEqualityComparer : IEqualityComparer
+ {
+ ///
+ public bool Equals(TypeReference lhs, TypeReference rhs)
+ {
+ return string.Equals(lhs.FullName, rhs.FullName, StringComparison.Ordinal);
+ }
+
+ ///
+ public int GetHashCode(TypeReference item)
+ {
+ return item.FullName.GetHashCode();
+ }
+ }
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// Type references list in Mono.Cecil format.
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoTypeReferenceTable(
+ IEnumerable items,
+ nanoTablesContext context)
+ : base(items, new TypeReferenceEqualityComparer(), context)
+ {
+ }
+
+ ///
+ /// Gets type reference identifier (if type is provided and this type is defined in target assembly).
+ ///
+ ///
+ /// For null value passed in returns 0xFFFF value.
+ ///
+ /// Type definition in Mono.Cecil format.
+ /// Type reference identifier for filling.
+ /// Returns true if item found, otherwise returns false.
+ public bool TryGetTypeReferenceId(
+ TypeReference typeReference,
+ out ushort referenceId)
+ {
+ if (typeReference == null) // This case is possible for encoding 'nested inside' case
+ {
+ referenceId = 0xFFFF;
+ return true;
+ }
+
+ return TryGetIdByValue(typeReference, out referenceId);
+ }
+
+ ///
+ protected override void WriteSingleItem(
+ nanoBinaryWriter writer,
+ TypeReference item)
+ {
+ WriteStringReference(writer, item.Name);
+ WriteStringReference(writer, item.Namespace);
+
+ writer.WriteUInt16(GetScope(item)); // scope - TBL_AssemblyRef | TBL_TypeRef // 0x8000
+ writer.WriteUInt16(0); // padding
+ }
+
+ ///
+ protected override void AllocateSingleItemStrings(
+ TypeReference item)
+ {
+ GetOrCreateStringId(item.Namespace);
+ GetOrCreateStringId(item.Name);
+ }
+
+ private ushort GetScope(
+ TypeReference typeReference)
+ {
+ if (typeReference.DeclaringType == null)
+ {
+ return _context.AssemblyReferenceTable.GetReferenceId(typeReference.Scope as AssemblyNameReference);
+ }
+ else
+ {
+ ushort referenceId;
+ _context.TypeReferencesTable.TryGetTypeReferenceId(typeReference.DeclaringType, out referenceId);
+ return (ushort)(0x8000 | referenceId);
+ }
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Tables/nanoTypeSpecificationsTable.cs b/source/MetadataProcessor.Core/Tables/nanoTypeSpecificationsTable.cs
new file mode 100644
index 00000000..4afce906
--- /dev/null
+++ b/source/MetadataProcessor.Core/Tables/nanoTypeSpecificationsTable.cs
@@ -0,0 +1,113 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for storing type sprcifications list and writing this
+ /// list into target assembly in .NET nanoFramework format.
+ ///
+ public sealed class nanoTypeSpecificationsTable : InanoTable
+ {
+ ///
+ /// Helper class for comparing two instances of objects
+ /// using property as unique key for comparison.
+ ///
+ private sealed class TypeReferenceComparer : IEqualityComparer
+ {
+ ///
+ public bool Equals(TypeReference lhs, TypeReference rhs)
+ {
+ return string.Equals(lhs.FullName, rhs.FullName, StringComparison.Ordinal);
+ }
+
+ ///
+ public int GetHashCode(TypeReference that)
+ {
+ return that.FullName.GetHashCode();
+ }
+ }
+
+ ///
+ /// Maps for each unique type specification and related identifier.
+ ///
+ private readonly IDictionary _idByTypeSpecifications =
+ new Dictionary(new TypeReferenceComparer());
+
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ private readonly nanoTablesContext _context;
+
+ ///
+ /// Last available type specifier identificator.
+ ///
+ private ushort _lastAvailableId;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoTypeSpecificationsTable(
+ nanoTablesContext context)
+ {
+ _context = context;
+ }
+
+ ///
+ /// Gets existing or creates new type specification reference identifier.
+ ///
+ /// Type reference value for obtaining identifier.
+ /// Existing identifier if specification already in table or new one.
+ public ushort GetOrCreateTypeSpecificationId(
+ TypeReference typeReference)
+ {
+ ushort referenceId;
+ if (!_idByTypeSpecifications.TryGetValue(typeReference, out referenceId))
+ {
+ _idByTypeSpecifications.Add(typeReference, _lastAvailableId);
+
+ referenceId = _lastAvailableId;
+ ++_lastAvailableId;
+ }
+
+ return referenceId;
+ }
+
+ ///
+ /// Gets type specification identifier (if it already added into type specifications list).
+ ///
+ /// Type reference in Mono.Cecil format.
+ /// Type reference identifier for filling.
+ /// Returns true if item found, otherwise returns false.
+ public bool TryGetTypeReferenceId(
+ TypeReference typeReference,
+ out ushort referenceId)
+ {
+ return _idByTypeSpecifications.TryGetValue(typeReference, out referenceId);
+ }
+
+ ///
+ public void Write(
+ nanoBinaryWriter writer)
+ {
+ foreach (var item in _idByTypeSpecifications
+ .OrderBy(item => item.Value)
+ .Select(item => item.Key))
+ {
+ writer.WriteUInt16(_context.SignaturesTable.GetOrCreateSignatureId(item));
+ writer.WriteUInt16(0x0000); // padding
+ }
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Utility/Crc32.cs b/source/MetadataProcessor.Core/Utility/Crc32.cs
new file mode 100644
index 00000000..32ad2eff
--- /dev/null
+++ b/source/MetadataProcessor.Core/Utility/Crc32.cs
@@ -0,0 +1,66 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using System.Linq;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Helper class for calculating CRC32 value according IEEE 802 standard (ZModem protocol).
+ ///
+ internal static class Crc32
+ {
+ //
+ // CRC 32 table for use under ZModem protocol, IEEE 802
+ // G(x) = x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1
+ //
+ private static readonly uint[] _crcTable =
+ {
+ 0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B, 0x1A864DB2, 0x1E475005,
+ 0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61, 0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD,
+ 0x4C11DB70, 0x48D0C6C7, 0x4593E01E, 0x4152FDA9, 0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75,
+ 0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011, 0x791D4014, 0x7DDC5DA3, 0x709F7B7A, 0x745E66CD,
+ 0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039, 0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5,
+ 0xBE2B5B58, 0xBAEA46EF, 0xB7A96036, 0xB3687D81, 0xAD2F2D84, 0xA9EE3033, 0xA4AD16EA, 0xA06C0B5D,
+ 0xD4326D90, 0xD0F37027, 0xDDB056FE, 0xD9714B49, 0xC7361B4C, 0xC3F706FB, 0xCEB42022, 0xCA753D95,
+ 0xF23A8028, 0xF6FB9D9F, 0xFBB8BB46, 0xFF79A6F1, 0xE13EF6F4, 0xE5FFEB43, 0xE8BCCD9A, 0xEC7DD02D,
+ 0x34867077, 0x30476DC0, 0x3D044B19, 0x39C556AE, 0x278206AB, 0x23431B1C, 0x2E003DC5, 0x2AC12072,
+ 0x128E9DCF, 0x164F8078, 0x1B0CA6A1, 0x1FCDBB16, 0x018AEB13, 0x054BF6A4, 0x0808D07D, 0x0CC9CDCA,
+ 0x7897AB07, 0x7C56B6B0, 0x71159069, 0x75D48DDE, 0x6B93DDDB, 0x6F52C06C, 0x6211E6B5, 0x66D0FB02,
+ 0x5E9F46BF, 0x5A5E5B08, 0x571D7DD1, 0x53DC6066, 0x4D9B3063, 0x495A2DD4, 0x44190B0D, 0x40D816BA,
+ 0xACA5C697, 0xA864DB20, 0xA527FDF9, 0xA1E6E04E, 0xBFA1B04B, 0xBB60ADFC, 0xB6238B25, 0xB2E29692,
+ 0x8AAD2B2F, 0x8E6C3698, 0x832F1041, 0x87EE0DF6, 0x99A95DF3, 0x9D684044, 0x902B669D, 0x94EA7B2A,
+ 0xE0B41DE7, 0xE4750050, 0xE9362689, 0xEDF73B3E, 0xF3B06B3B, 0xF771768C, 0xFA325055, 0xFEF34DE2,
+ 0xC6BCF05F, 0xC27DEDE8, 0xCF3ECB31, 0xCBFFD686, 0xD5B88683, 0xD1799B34, 0xDC3ABDED, 0xD8FBA05A,
+ 0x690CE0EE, 0x6DCDFD59, 0x608EDB80, 0x644FC637, 0x7A089632, 0x7EC98B85, 0x738AAD5C, 0x774BB0EB,
+ 0x4F040D56, 0x4BC510E1, 0x46863638, 0x42472B8F, 0x5C007B8A, 0x58C1663D, 0x558240E4, 0x51435D53,
+ 0x251D3B9E, 0x21DC2629, 0x2C9F00F0, 0x285E1D47, 0x36194D42, 0x32D850F5, 0x3F9B762C, 0x3B5A6B9B,
+ 0x0315D626, 0x07D4CB91, 0x0A97ED48, 0x0E56F0FF, 0x1011A0FA, 0x14D0BD4D, 0x19939B94, 0x1D528623,
+ 0xF12F560E, 0xF5EE4BB9, 0xF8AD6D60, 0xFC6C70D7, 0xE22B20D2, 0xE6EA3D65, 0xEBA91BBC, 0xEF68060B,
+ 0xD727BBB6, 0xD3E6A601, 0xDEA580D8, 0xDA649D6F, 0xC423CD6A, 0xC0E2D0DD, 0xCDA1F604, 0xC960EBB3,
+ 0xBD3E8D7E, 0xB9FF90C9, 0xB4BCB610, 0xB07DABA7, 0xAE3AFBA2, 0xAAFBE615, 0xA7B8C0CC, 0xA379DD7B,
+ 0x9B3660C6, 0x9FF77D71, 0x92B45BA8, 0x9675461F, 0x8832161A, 0x8CF30BAD, 0x81B02D74, 0x857130C3,
+ 0x5D8A9099, 0x594B8D2E, 0x5408ABF7, 0x50C9B640, 0x4E8EE645, 0x4A4FFBF2, 0x470CDD2B, 0x43CDC09C,
+ 0x7B827D21, 0x7F436096, 0x7200464F, 0x76C15BF8, 0x68860BFD, 0x6C47164A, 0x61043093, 0x65C52D24,
+ 0x119B4BE9, 0x155A565E, 0x18197087, 0x1CD86D30, 0x029F3D35, 0x065E2082, 0x0B1D065B, 0x0FDC1BEC,
+ 0x3793A651, 0x3352BBE6, 0x3E119D3F, 0x3AD08088, 0x2497D08D, 0x2056CD3A, 0x2D15EBE3, 0x29D4F654,
+ 0xC5A92679, 0xC1683BCE, 0xCC2B1D17, 0xC8EA00A0, 0xD6AD50A5, 0xD26C4D12, 0xDF2F6BCB, 0xDBEE767C,
+ 0xE3A1CBC1, 0xE760D676, 0xEA23F0AF, 0xEEE2ED18, 0xF0A5BD1D, 0xF464A0AA, 0xF9278673, 0xFDE69BC4,
+ 0x89B8FD09, 0x8D79E0BE, 0x803AC667, 0x84FBDBD0, 0x9ABC8BD5, 0x9E7D9662, 0x933EB0BB, 0x97FFAD0C,
+ 0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4
+ };
+
+ ///
+ /// Calculates CRC32 value for passsed byte array using
+ /// initial value of parameter as base for CRC calculation.
+ ///
+ public static uint Compute(byte[] buffer, uint crc = 0)
+ {
+ return buffer.Aggregate(crc,
+ (index, item) => _crcTable[((index >> 24) ^ item) & 0xFF] ^ (index << 8));
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/MetadataProcessor.Core/Utility/LoadHintsAssemblyResolver.cs b/source/MetadataProcessor.Core/Utility/LoadHintsAssemblyResolver.cs
new file mode 100644
index 00000000..929412f3
--- /dev/null
+++ b/source/MetadataProcessor.Core/Utility/LoadHintsAssemblyResolver.cs
@@ -0,0 +1,75 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Implements special external .NET nanoFramework assemblies resolution logic.
+ /// MetadataTransformer gets maps with pair assembly name and assebly path in command line,
+ /// if we unable to load assemlby using default resolver we will try to use this map.
+ ///
+ public sealed class LoadHintsAssemblyResolver : BaseAssemblyResolver
+ {
+ ///
+ /// List of 'load hints' - map between assembly name and assembly path.
+ ///
+ private readonly IDictionary _loadHints;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// Metadata transformer load hints.
+ public LoadHintsAssemblyResolver(
+ IDictionary loadHints)
+ {
+ _loadHints = loadHints;
+ }
+
+ ///
+ public override AssemblyDefinition Resolve(AssemblyNameReference name)
+ {
+ try
+ {
+ return base.Resolve(name);
+ }
+ catch (Exception)
+ {
+ string assemblyFileName;
+ if (_loadHints.TryGetValue(name.Name, out assemblyFileName))
+ {
+ return AssemblyDefinition.ReadAssembly(assemblyFileName);
+ }
+
+ throw;
+ }
+ }
+
+
+ ///
+ public override AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters)
+ {
+ try
+ {
+ return base.Resolve(name, parameters);
+ }
+ catch (Exception)
+ {
+ string assemblyFileName;
+ if (_loadHints.TryGetValue(new AssemblyName(name.FullName).Name, out assemblyFileName))
+ {
+ return AssemblyDefinition.ReadAssembly(assemblyFileName);
+ }
+
+ throw;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/MetadataProcessor.Core/Utility/NativeMethodsCrc.cs b/source/MetadataProcessor.Core/Utility/NativeMethodsCrc.cs
new file mode 100644
index 00000000..5fa45c43
--- /dev/null
+++ b/source/MetadataProcessor.Core/Utility/NativeMethodsCrc.cs
@@ -0,0 +1,100 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Helper class for calculating native methods CRC value. Really caclulates CRC32 value
+ /// for native method signatures (not methods itself) and signatures treated as string
+ /// values, formatted by weird rules incompartible with all rest codebase.
+ ///
+ public sealed class NativeMethodsCrc
+ {
+ private readonly HashSet _generatedNames = new HashSet(StringComparer.Ordinal);
+
+ private readonly byte[] _null = Encoding.ASCII.GetBytes("NULL");
+
+ private readonly byte[] _name;
+
+ public NativeMethodsCrc(
+ AssemblyDefinition assembly)
+ {
+ _name = Encoding.ASCII.GetBytes(assembly.Name.Name);
+ }
+
+ public uint Current { get; private set; }
+
+ public void UpdateCrc(MethodDefinition method)
+ {
+ var type = method.DeclaringType;
+ if ((type.IsClass || type.IsValueType) &&
+ (method.RVA == 0xFFFFFFF && !method.IsAbstract))
+ {
+ Current = Crc32.Compute(_name, Current);
+ Current = Crc32.Compute(Encoding.ASCII.GetBytes(GetClassName(type)), Current);
+ Current = Crc32.Compute(Encoding.ASCII.GetBytes(GetMethodName(method)), Current);
+ }
+ else
+ {
+ Current = Crc32.Compute(_null, Current);
+ }
+ }
+
+ private string GetClassName(
+ TypeDefinition type)
+ {
+ return (type != null
+ ? string.Concat(GetClassName(type.DeclaringType), type.Namespace, type.Name)
+ .Replace(".", string.Empty)
+ : string.Empty);
+ }
+
+ private string GetMethodName(
+ MethodDefinition method)
+ {
+ var name = string.Concat(method.Name, (method.IsStatic ? "___STATIC__" : "___"),
+ string.Join("__", GetAllParameters(method)));
+
+ var originalName = name.Replace(".", string.Empty);
+
+ var index = 1;
+ name = originalName;
+ while (_generatedNames.Add(name))
+ {
+ name = string.Concat(originalName, index.ToString(CultureInfo.InvariantCulture));
+ ++index;
+ }
+
+ return name;
+ }
+
+ private IEnumerable GetAllParameters(
+ MethodDefinition method)
+ {
+ yield return GetParameterType(method.ReturnType);
+
+ if (method.HasParameters)
+ {
+ foreach (var item in method.Parameters)
+ {
+ yield return GetParameterType(item.ParameterType);
+ }
+ }
+ }
+
+ private string GetParameterType(
+ TypeReference parameterType)
+ {
+ return parameterType.Name.ToUpper();
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Utility/nanoBitmapProcessor.cs b/source/MetadataProcessor.Core/Utility/nanoBitmapProcessor.cs
new file mode 100644
index 00000000..469309e9
--- /dev/null
+++ b/source/MetadataProcessor.Core/Utility/nanoBitmapProcessor.cs
@@ -0,0 +1,80 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using System.Drawing;
+using System.Drawing.Imaging;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ internal sealed class nanoBitmapProcessor
+ {
+ private readonly Bitmap _bitmap;
+
+ public nanoBitmapProcessor(
+ Bitmap bitmap)
+ {
+ _bitmap = bitmap;
+ }
+
+ public void Process(
+ nanoBinaryWriter writer)
+ {
+ writer.WriteUInt32((uint)_bitmap.Width);
+ writer.WriteUInt32((uint)_bitmap.Height);
+
+ writer.WriteUInt16(0x00); // flags
+
+ var tinyImageFormat = GetTinytImageFormat(_bitmap.RawFormat);
+
+ if (tinyImageFormat != 0)
+ {
+ writer.WriteByte(0x01); // bpp
+ writer.WriteByte(tinyImageFormat);
+ _bitmap.Save(writer.BaseStream, _bitmap.RawFormat);
+ }
+ else
+ {
+ writer.WriteByte(0x10); // bpp
+ writer.WriteByte(tinyImageFormat);
+
+ var rect = new Rectangle(Point.Empty, _bitmap.Size);
+ using (var convertedBitmap =
+ _bitmap.Clone(new Rectangle(Point.Empty, _bitmap.Size),
+ PixelFormat.Format16bppRgb565))
+ {
+ var bitmapData = convertedBitmap.LockBits(
+ rect, ImageLockMode.ReadOnly, convertedBitmap.PixelFormat);
+
+ var buffer = new short[bitmapData.Stride * convertedBitmap.Height / sizeof(short)];
+ System.Runtime.InteropServices.Marshal.Copy(
+ bitmapData.Scan0, buffer, 0, buffer.Length);
+
+ convertedBitmap.UnlockBits(bitmapData);
+ foreach (var item in buffer)
+ {
+ writer.WriteInt16(item);
+ }
+ }
+ }
+ }
+
+ private byte GetTinytImageFormat(
+ ImageFormat rawFormat)
+ {
+ if (rawFormat.Equals(ImageFormat.Gif))
+ {
+ return 1;
+ }
+
+ if (rawFormat.Equals(ImageFormat.Jpeg))
+ {
+ return 2;
+ }
+
+ return 0;
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/MetadataProcessor.Core/Utility/nanoCLR_DataType.cs b/source/MetadataProcessor.Core/Utility/nanoCLR_DataType.cs
new file mode 100644
index 00000000..2b3436de
--- /dev/null
+++ b/source/MetadataProcessor.Core/Utility/nanoCLR_DataType.cs
@@ -0,0 +1,40 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ internal enum nanoCLR_DataType : byte
+ {
+ // these where defined @ enum CLR_DataType
+
+ DATATYPE_VOID, // 0 bytes
+
+ DATATYPE_BOOLEAN, // 1 byte
+ DATATYPE_I1, // 1 byte
+ DATATYPE_U1, // 1 byte
+
+ DATATYPE_CHAR, // 2 bytes
+ DATATYPE_I2, // 2 bytes
+ DATATYPE_U2, // 2 bytes
+
+ DATATYPE_I4, // 4 bytes
+ DATATYPE_U4, // 4 bytes
+ DATATYPE_R4, // 4 bytes
+
+ DATATYPE_I8, // 8 bytes
+ DATATYPE_U8, // 8 bytes
+ DATATYPE_R8, // 8 bytes
+ DATATYPE_DATETIME, // 8 bytes // Shortcut for System.DateTime
+ DATATYPE_TIMESPAN, // 8 bytes // Shortcut for System.TimeSpan
+ DATATYPE_STRING,
+
+ DATATYPE_OBJECT, // Shortcut for System.Object
+ DATATYPE_CLASS, // CLASS
+ DATATYPE_VALUETYPE, // VALUETYPE
+ DATATYPE_SZARRAY, // Shortcut for single dimension zero lower bound array SZARRAY
+ DATATYPE_BYREF, // BYREF
+ }
+}
diff --git a/source/MetadataProcessor.Core/Utility/nanoFontProcessor.cs b/source/MetadataProcessor.Core/Utility/nanoFontProcessor.cs
new file mode 100644
index 00000000..2d1b16b5
--- /dev/null
+++ b/source/MetadataProcessor.Core/Utility/nanoFontProcessor.cs
@@ -0,0 +1,130 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using System.IO;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for processing .tinyfont resource data and swap endianness if neede.
+ ///
+ internal sealed class nanoFontProcessor
+ {
+ ///
+ /// Indicates additional font information in container (anti-aliasing).
+ ///
+ private const ushort FLAG_FONT_EX = 0x0008;
+
+ ///
+ /// Original binary data for processing.
+ ///
+ private readonly byte[] _fontResouce;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// Original font binary data for processing.
+ public nanoFontProcessor(
+ byte[] fontResouce)
+ {
+ _fontResouce = fontResouce;
+ }
+
+ ///
+ /// Processes original data and writes processed data into output writer.
+ ///
+ /// Endianness-aware binary writer.
+ public void Process(
+ nanoBinaryWriter writer)
+ {
+ using (var stream = new MemoryStream(_fontResouce, false))
+ using (var reader = new BinaryReader(stream))
+ {
+ // CLR_GFX_FontDescription
+
+ {
+ // CLR_GFX_FontMetrics
+
+ writer.WriteUInt16(reader.ReadUInt16()); // CLR_GFX_FontMetrics.m_height
+ writer.WriteInt16(reader.ReadInt16()); // CLR_GFX_FontMetrics.m_offset
+
+ writer.WriteInt16(reader.ReadInt16()); // CLR_GFX_FontMetrics.m_ascent
+ writer.WriteInt16(reader.ReadInt16()); // CLR_GFX_FontMetrics.m_descent
+
+ writer.WriteInt16(reader.ReadInt16()); // CLR_GFX_FontMetrics.m_internalLeading
+ writer.WriteInt16(reader.ReadInt16()); // CLR_GFX_FontMetrics.m_externalLeading
+
+ writer.WriteInt16(reader.ReadInt16()); // CLR_GFX_FontMetrics.m_aveCharWidth
+ writer.WriteInt16(reader.ReadInt16()); // CLR_GFX_FontMetrics.m_aveCharWidth
+ }
+
+ var rangesCount = reader.ReadInt16();
+ writer.WriteInt16(rangesCount); // CLR_GFX_FontDescription.m_ranges
+ var charactersCount = reader.ReadInt16();
+ writer.WriteInt16(charactersCount); // CLR_GFX_FontDescription.m_characters
+
+ var flags = reader.ReadInt16();
+ writer.WriteInt16(flags); // CLR_GFX_FontDescription.m_flags
+ writer.WriteInt16(reader.ReadInt16()); // CLR_GFX_FontDescription.m_pad
+
+ // CLR_GFX_BitmapDescription
+
+ var width = reader.ReadUInt32();
+ writer.WriteUInt32(width); // CLR_GFX_BitmapDescription.m_width
+ var height = reader.ReadUInt32();
+ writer.WriteUInt32(height); // CLR_GFX_BitmapDescription.m_height
+
+ writer.WriteUInt16(reader.ReadUInt16()); // CLR_GFX_BitmapDescription.m_flags
+
+ var bitsPerPixel = reader.ReadByte();
+ writer.WriteByte(bitsPerPixel); // CLR_GFX_BitmapDescription.m_bitsPerPixel
+ writer.WriteByte(reader.ReadByte()); // CLR_GFX_BitmapDescription.m_type
+
+ for (var i = 0; i <= rangesCount; ++i) // Including sentinel range
+ {
+ // CLR_GFX_FontCharacterRange
+
+ writer.WriteUInt32(reader.ReadUInt32()); // CLR_GFX_FontCharacterRange.m_indexOfFirstFontCharacter
+
+ writer.WriteUInt16(reader.ReadUInt16()); // CLR_GFX_FontCharacterRange.m_firstChar
+ writer.WriteUInt16(reader.ReadUInt16()); // CLR_GFX_FontCharacterRange.m_lastChar
+
+ writer.WriteUInt32(reader.ReadUInt32()); // CLR_GFX_FontCharacterRange.m_rangeOffset
+ }
+
+ for (var i = 0; i <= charactersCount; ++i) // Including sentinel character
+ {
+ // CLR_GFX_FontCharacter
+
+ writer.WriteUInt16(reader.ReadUInt16()); // CLR_GFX_FontCharacter.m_offset
+
+ writer.WriteByte(reader.ReadByte()); // CLR_GFX_FontCharacter.m_marginLeft
+ writer.WriteByte(reader.ReadByte()); // CLR_GFX_FontCharacter.m_marginRight
+ }
+
+ if (bitsPerPixel == 0)
+ {
+ bitsPerPixel = 16; // Native value, rest calculations are same
+ }
+ var totalSizeInWords = ((width * bitsPerPixel + 31) / 32) * height;
+ for (var i = 0; i < totalSizeInWords; ++i)
+ {
+ writer.WriteUInt32(reader.ReadUInt32());
+ }
+
+ if ((flags & FLAG_FONT_EX) == FLAG_FONT_EX)
+ {
+ // TODO: implement it according original idea if needed
+ }
+
+ while (stream.Position < stream.Length)
+ {
+ writer.WriteByte(reader.ReadByte());
+ }
+ }
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Utility/nanoPdbxFileWriter.cs b/source/MetadataProcessor.Core/Utility/nanoPdbxFileWriter.cs
new file mode 100644
index 00000000..03d0726c
--- /dev/null
+++ b/source/MetadataProcessor.Core/Utility/nanoPdbxFileWriter.cs
@@ -0,0 +1,143 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Xml;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ internal sealed class nanoPdbxFileWriter
+ {
+ private readonly nanoTablesContext _context;
+
+ public nanoPdbxFileWriter(
+ nanoTablesContext context)
+ {
+ _context = context;
+ }
+
+ public void Write(
+ XmlWriter writer)
+ {
+ writer.WriteStartElement("PdbxFile");
+ writer.WriteStartElement("Assembly");
+
+ WriteTokensPair(writer, _context.AssemblyDefinition.MetadataToken.ToUInt32(), 0x00000000);
+ writer.WriteElementString("FileName", _context.AssemblyDefinition.MainModule.Name);
+ WriteVersionInfo(writer, _context.AssemblyDefinition.Name.Version);
+
+ writer.WriteStartElement("Classes");
+ _context.TypeDefinitionTable.ForEachItems((token, item) => WriteClassInfo(writer, token, item));
+
+ writer.WriteEndDocument();
+ }
+
+ private void WriteVersionInfo(
+ XmlWriter writer,
+ Version version)
+ {
+ writer.WriteStartElement("Version");
+
+ writer.WriteElementString("Major", version.Major.ToString("D", CultureInfo.InvariantCulture));
+ writer.WriteElementString("Minor", version.Minor.ToString("D", CultureInfo.InvariantCulture));
+ writer.WriteElementString("Build", version.Build.ToString("D", CultureInfo.InvariantCulture));
+ writer.WriteElementString("Revision", version.Revision.ToString("D", CultureInfo.InvariantCulture));
+
+ writer.WriteEndElement();
+ }
+
+ private void WriteClassInfo(
+ XmlWriter writer,
+ uint tinyClrItemToken,
+ TypeDefinition item)
+ {
+ writer.WriteStartElement("Class");
+
+ WriteTokensPair(writer, item.MetadataToken.ToUInt32(), 0x04000000 | tinyClrItemToken);
+
+ writer.WriteStartElement("Methods");
+ foreach (var tuple in GetMethodsTokens(item.Methods))
+ {
+ writer.WriteStartElement("Method");
+
+ WriteTokensPair(writer, tuple.Item1, tuple.Item2);
+
+ if (!tuple.Item3.HasBody)
+ {
+ writer.WriteElementString("HasByteCode", "false");
+ }
+ writer.WriteStartElement("ILMap");
+ foreach (var offset in _context.TypeDefinitionTable.GetByteCodeOffsets(tuple.Item1))
+ {
+ writer.WriteStartElement("IL");
+
+ writer.WriteElementString("CLR", "0x" + offset.Item1.ToString("X8", CultureInfo.InvariantCulture));
+ writer.WriteElementString("TinyCLR", "0x" + offset.Item2.ToString("X8", CultureInfo.InvariantCulture));
+
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("Fields");
+ foreach (var pair in GetFieldsTokens(item.Fields))
+ {
+ writer.WriteStartElement("Field");
+
+ WriteTokensPair(writer, pair.Item1, pair.Item2);
+
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+
+ writer.WriteEndElement();
+ }
+
+ private IEnumerable> GetMethodsTokens(
+ IEnumerable methods)
+ {
+ foreach (var method in methods)
+ {
+ ushort fieldToken;
+ _context.MethodDefinitionTable.TryGetMethodReferenceId(method, out fieldToken);
+ yield return new Tuple(
+ method.MetadataToken.ToUInt32(), 0x06000000 | (uint)fieldToken, method);
+ }
+ }
+
+ private IEnumerable> GetFieldsTokens(
+ IEnumerable fields)
+ {
+ foreach (var field in fields.Where(item => !item.HasConstant))
+ {
+ ushort fieldToken;
+ _context.FieldsTable.TryGetFieldReferenceId(field, false, out fieldToken);
+ yield return new Tuple(
+ field.MetadataToken.ToUInt32(), 0x05000000 | (uint)fieldToken);
+ }
+ }
+
+ private void WriteTokensPair(
+ XmlWriter writer,
+ uint clrToken,
+ uint tinyClrToken)
+ {
+ writer.WriteStartElement("Token");
+
+ writer.WriteElementString("CLR", "0x" + clrToken.ToString("X8", CultureInfo.InvariantCulture));
+ writer.WriteElementString("TinyCLR", "0x" + tinyClrToken.ToString("X8", CultureInfo.InvariantCulture));
+
+ writer.WriteEndElement();
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/Utility/nanoSerializationType.cs b/source/MetadataProcessor.Core/Utility/nanoSerializationType.cs
new file mode 100644
index 00000000..3dd86289
--- /dev/null
+++ b/source/MetadataProcessor.Core/Utility/nanoSerializationType.cs
@@ -0,0 +1,33 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// This list contains type codes used for serializing attributes signatures
+ ///
+ internal enum nanoSerializationType : byte
+ {
+ // these where defined @ typedef enum CorElementType
+
+ ELEMENT_TYPE_BOOLEAN = 0x2,
+ ELEMENT_TYPE_CHAR = 0x3,
+ ELEMENT_TYPE_I1 = 0x4,
+ ELEMENT_TYPE_U1 = 0x5,
+ ELEMENT_TYPE_I2 = 0x6,
+ ELEMENT_TYPE_U2 = 0x7,
+ ELEMENT_TYPE_I4 = 0x8,
+ ELEMENT_TYPE_U4 = 0x9,
+ ELEMENT_TYPE_I8 = 0xa,
+ ELEMENT_TYPE_U8 = 0xb,
+ ELEMENT_TYPE_R4 = 0xc,
+ ELEMENT_TYPE_R8 = 0xd,
+ ELEMENT_TYPE_STRING = 0xe,
+
+ SERIALIZATION_TYPE_FIELD = 0x53,
+ SERIALIZATION_TYPE_PROPERTY = 0x54,
+ }
+}
diff --git a/source/MetadataProcessor.Core/Utility/nanoStringsConstants.cs b/source/MetadataProcessor.Core/Utility/nanoStringsConstants.cs
new file mode 100644
index 00000000..eb03ed55
--- /dev/null
+++ b/source/MetadataProcessor.Core/Utility/nanoStringsConstants.cs
@@ -0,0 +1,898 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Helper class for storing list of 'predefined' string constants which encoded in
+ /// .NET nanoFramework assembly metadata using special notation (highest possible values).
+ ///
+ internal static class nanoStringsConstants
+ {
+ ///
+ /// Gets string reference identifier for passed string from constants table.
+ ///
+ /// String value for lookup.
+ /// String reference identifier.
+ /// Returns true if string found in constants table, false otherwise.
+ public static bool TryGetStringIndex(
+ string value,
+ out ushort index)
+ {
+ return _idsByStrings.TryGetValue(value, out index);
+ }
+
+ private static readonly IDictionary _idsByStrings = new[]
+ {
+ /* 0000 */ ".cctor",
+ /* 0001 */ ".ctor",
+ /* 0002 */ "Abort",
+ /* 0003 */ "Abs",
+ /* 0004 */ "AccessedThroughPropertyAttribute",
+ /* 0005 */ "Acos",
+ /* 0006 */ "Add",
+ /* 0007 */ "AddDays",
+ /* 0008 */ "AddHours",
+ /* 0009 */ "AddMilliseconds",
+ /* 000A */ "AddMinutes",
+ /* 000B */ "AddSeconds",
+ /* 000C */ "AddTicks",
+ /* 000D */ "AnyPendingFinalizers",
+ /* 000E */ "AppDomain",
+ /* 000F */ "AppDomainUnloadedException",
+ /* 0010 */ "Append",
+ /* 0011 */ "AppendHelper",
+ /* 0012 */ "AppendLine",
+ /* 0013 */ "AppendTrailingZeros",
+ /* 0014 */ "ApplicationException",
+ /* 0015 */ "ArgumentException",
+ /* 0016 */ "ArgumentNullException",
+ /* 0017 */ "ArgumentOutOfRangeException",
+ /* 0018 */ "Arguments",
+ /* 0019 */ "Array",
+ /* 001A */ "ArrayList",
+ /* 001B */ "ArraySize",
+ /* 001C */ "Asin",
+ /* 001D */ "Assembly",
+ /* 001E */ "AssemblyInfo",
+ /* 001F */ "AssemblyMemoryInfo",
+ /* 0020 */ "AssemblyName",
+ /* 0021 */ "AssemblyNameFlags",
+ /* 0022 */ "AssemblyRef",
+ /* 0023 */ "AssemblyRefElements",
+ /* 0024 */ "Assert",
+ /* 0025 */ "AsyncCallback",
+ /* 0026 */ "Atan",
+ /* 0027 */ "Atan2",
+ /* 0028 */ "Attribute",
+ /* 0029 */ "Attributes",
+ /* 002A */ "AttributesElements",
+ /* 002B */ "AutoResetEvent",
+ /* 002C */ "Backlight",
+ /* 002D */ "BaseEvent",
+ /* 002E */ "BeginInvoke",
+ /* 002F */ "Bias",
+ /* 0030 */ "BinarySearch",
+ /* 0031 */ "Binder",
+ /* 0032 */ "BindingFlags",
+ /* 0033 */ "BitConverter",
+ /* 0034 */ "BitPacked",
+ /* 0035 */ "Boolean",
+ /* 0036 */ "Break",
+ /* 0037 */ "Byte",
+ /* 0038 */ "ByteCode",
+ /* 0039 */ "Ceiling",
+ /* 003A */ "Change",
+ /* 003B */ "Char",
+ /* 003C */ "Check",
+ /* 003D */ "Clear",
+ /* 003E */ "Clone",
+ /* 003F */ "Close",
+ /* 0040 */ "Combine",
+ /* 0041 */ "CombineArrays",
+ /* 0042 */ "Compare",
+ /* 0043 */ "CompareExchange",
+ /* 0044 */ "CompareTo",
+ /* 0045 */ "ComputeCRC",
+ /* 0046 */ "Concat",
+ /* 0047 */ "ConstraintException",
+ /* 0048 */ "ConstructorInfo",
+ /* 0049 */ "ContactHeight",
+ /* 004A */ "ContactWidth",
+ /* 004B */ "Contains",
+ /* 004C */ "Convert",
+ /* 004D */ "Copy",
+ /* 004E */ "CopyTo",
+ /* 004F */ "CopyToCollection",
+ /* 0050 */ "Cos",
+ /* 0051 */ "Cosh",
+ /* 0052 */ "CreateDomain",
+ /* 0053 */ "CreateInstance",
+ /* 0054 */ "CreateInstanceAndUnwrap",
+ /* 0055 */ "CultureInfo",
+ /* 0056 */ "CultureTypes",
+ /* 0057 */ "CurrentSystemTimeZone",
+ /* 0058 */ "DateTime",
+ /* 0059 */ "DateTimeFormat",
+ /* 005A */ "DateTimeFormatInfo",
+ /* 005B */ "DateTimeKind",
+ /* 005C */ "Day",
+ /* 005D */ "DayOfWeek",
+ /* 005E */ "DaylightBias",
+ /* 005F */ "DaylightDate",
+ /* 0060 */ "DaylightName",
+ /* 0061 */ "DaylightTime",
+ /* 0062 */ "DaysInMonth",
+ /* 0063 */ "Debug",
+ /* 0064 */ "DebuggableAttribute",
+ /* 0065 */ "Debugger",
+ /* 0066 */ "DebuggingModes",
+ /* 0067 */ "Decoder",
+ /* 0068 */ "Decrement",
+ /* 0069 */ "Delegate",
+ /* 006A */ "Dequeue",
+ /* 006B */ "Deserialize",
+ /* 006C */ "DictionaryEntry",
+ /* 006D */ "Dispose",
+ /* 006E */ "Double",
+ /* 006F */ "DoubleToInt64Bits",
+ /* 0070 */ "Duration",
+ /* 0071 */ "EditorBrowsableState",
+ /* 0072 */ "Empty",
+ /* 0073 */ "EnableGCMessages",
+ /* 0074 */ "Encoding",
+ /* 0075 */ "EndInvoke",
+ /* 0076 */ "EndPoint",
+ /* 0077 */ "Enqueue",
+ /* 0078 */ "EnsureCapacity",
+ /* 0079 */ "EnsureStringArrayResource",
+ /* 007A */ "EnsureStringResource",
+ /* 007B */ "Enter",
+ /* 007C */ "Entry",
+ /* 007D */ "EntryForKey",
+ /* 007E */ "Enum",
+ /* 007F */ "EnumeratorType",
+ /* 0080 */ "Equals",
+ /* 0081 */ "EventArgs",
+ /* 0082 */ "EventCategory",
+ /* 0083 */ "EventData",
+ /* 0084 */ "EventMessage",
+ /* 0085 */ "Exception",
+ /* 0086 */ "Exchange",
+ /* 0087 */ "ExecutionConstraint",
+ /* 0088 */ "Exit",
+ /* 0089 */ "Exp",
+ /* 008A */ "ExpandByABlock",
+ /* 008B */ "ExtendedTimer",
+ /* 008C */ "ExtendedWeakReference",
+ /* 008D */ "ExtensionAttribute",
+ /* 008E */ "ExtractRangeFromArray",
+ /* 008F */ "ExtractValueFromArray",
+ /* 0090 */ "FalseString",
+ /* 0091 */ "FieldDef",
+ /* 0092 */ "FieldDefElements",
+ /* 0093 */ "FieldInfo",
+ /* 0094 */ "FieldRef",
+ /* 0095 */ "FieldRefElements",
+ /* 0096 */ "Finalize",
+ /* 0097 */ "FindChunkForIndex",
+ /* 0098 */ "FindResource",
+ /* 0099 */ "Flags",
+ /* 009A */ "Floor",
+ /* 009B */ "Flush",
+ /* 009C */ "FlushAll",
+ /* 009D */ "Format",
+ /* 009E */ "FormatCustomized",
+ /* 009F */ "FormatDigits",
+ /* 00A0 */ "FormatNative",
+ /* 00A1 */ "FromBase64CharArray",
+ /* 00A2 */ "FromBase64String",
+ /* 00A3 */ "FromTicks",
+ /* 00A4 */ "GC",
+ /* 00A5 */ "GenericEvent",
+ /* 00A6 */ "Gesture",
+ /* 00A7 */ "GetAssemblies",
+ /* 00A8 */ "GetAssembly",
+ /* 00A9 */ "GetAssemblyFromHash",
+ /* 00AA */ "GetAssemblyHash",
+ /* 00AB */ "GetAssemblyInfo",
+ /* 00AC */ "GetAssemblyMemoryInfo",
+ /* 00AD */ "GetBase64EncodedLength",
+ /* 00AE */ "GetBytes",
+ /* 00AF */ "GetChars",
+ /* 00B0 */ "GetConstructor",
+ /* 00B1 */ "GetCultures",
+ /* 00B2 */ "GetDaylightChanges",
+ /* 00B3 */ "GetDecoder",
+ /* 00B4 */ "GetDelimitedStringResource",
+ /* 00B5 */ "GetDelimitedStringResources",
+ /* 00B6 */ "GetDomain",
+ /* 00B7 */ "GetDoubleNumber",
+ /* 00B8 */ "GetEffectiveDate",
+ /* 00B9 */ "GetElementType",
+ /* 00BA */ "GetEnumerator",
+ /* 00BB */ "GetExecutingAssembly",
+ /* 00BC */ "GetExpirationDate",
+ /* 00BD */ "GetField",
+ /* 00BE */ "GetFields",
+ /* 00BF */ "GetFormat",
+ /* 00C0 */ "GetHashCode",
+ /* 00C1 */ "GetInterfaces",
+ /* 00C2 */ "GetMachineTime",
+ /* 00C3 */ "GetManifestResourceNames",
+ /* 00C4 */ "GetMessage",
+ /* 00C5 */ "GetMethod",
+ /* 00C6 */ "GetMethods",
+ /* 00C7 */ "GetName",
+ /* 00C8 */ "GetObject",
+ /* 00C9 */ "GetObjectChunkFromId",
+ /* 00CA */ "GetObjectFromId",
+ /* 00CB */ "GetObjectInternal",
+ /* 00CC */ "GetObjectValue",
+ /* 00CD */ "GetParentCultureName",
+ /* 00CE */ "GetPosition",
+ /* 00CF */ "GetRawCertData",
+ /* 00D0 */ "GetRealFormat",
+ /* 00D1 */ "GetSatelliteAssembly",
+ /* 00D2 */ "GetString",
+ /* 00D3 */ "GetSystemVersion",
+ /* 00D4 */ "GetTimeZoneOffset",
+ /* 00D5 */ "GetType",
+ /* 00D6 */ "GetTypeFromHandle",
+ /* 00D7 */ "GetTypeFromHash",
+ /* 00D8 */ "GetTypeHash",
+ /* 00D9 */ "GetTypeInternal",
+ /* 00DA */ "GetTypes",
+ /* 00DB */ "GetTypesImplementingInterface",
+ /* 00DC */ "GetUtcOffset",
+ /* 00DD */ "GetValue",
+ /* 00DE */ "GetVersion",
+ /* 00DF */ "GloballySynchronizedAttribute",
+ /* 00E0 */ "Guid",
+ /* 00E1 */ "Hash",
+ /* 00E2 */ "Hashtable",
+ /* 00E3 */ "HashtableEnumerator",
+ /* 00E4 */ "HexToChar",
+ /* 00E5 */ "Hour",
+ /* 00E6 */ "IAsyncResult",
+ /* 00E7 */ "ICloneable",
+ /* 00E8 */ "ICollection",
+ /* 00E9 */ "IComparable",
+ /* 00EA */ "IComparer",
+ /* 00EB */ "ICustomFormatter",
+ /* 00EC */ "IDictionary",
+ /* 00ED */ "IDisposable",
+ /* 00EE */ "IEEERemainder",
+ /* 00EF */ "IEnumerable",
+ /* 00F0 */ "IEnumerator",
+ /* 00F1 */ "IEqualityComparer",
+ /* 00F2 */ "IEventListener",
+ /* 00F3 */ "IEventProcessor",
+ /* 00F4 */ "IFormatProvider",
+ /* 00F5 */ "IFormattable",
+ /* 00F6 */ "IList",
+ /* 00F7 */ "ILog",
+ /* 00F8 */ "IOException",
+ /* 00F9 */ "IOExceptionErrorCode",
+ /* 00FA */ "IReflect",
+ /* 00FB */ "Increment",
+ /* 00FC */ "IndexOf",
+ /* 00FD */ "IndexOfAny",
+ /* 00FE */ "IndexOutOfRangeException",
+ /* 00FF */ "Initialize",
+ /* 0100 */ "InitializeArray",
+ /* 0101 */ "InitializeForEventSource",
+ /* 0102 */ "InitializeHashTable",
+ /* 0103 */ "Insert",
+ /* 0104 */ "InsertGroupSeperators",
+ /* 0105 */ "InsertValueIntoArray",
+ /* 0106 */ "Install",
+ /* 0107 */ "Int16",
+ /* 0108 */ "Int32",
+ /* 0109 */ "Int64",
+ /* 010A */ "Int64BitsToDouble",
+ /* 010B */ "IntPtr",
+ /* 010C */ "Interlocked",
+ /* 010D */ "Intern",
+ /* 010E */ "InvalidCastException",
+ /* 010F */ "InvalidOperationException",
+ /* 0110 */ "Invoke",
+ /* 0111 */ "InvokeMember",
+ /* 0112 */ "IsDaylightSavingTime",
+ /* 0113 */ "IsEmulator",
+ /* 0114 */ "IsInfinity",
+ /* 0115 */ "IsInstanceOfType",
+ /* 0116 */ "IsInterned",
+ /* 0117 */ "IsNaN",
+ /* 0118 */ "IsNegativeInfinity",
+ /* 0119 */ "IsPositiveInfinity",
+ /* 011A */ "IsSubclassOf",
+ /* 011B */ "IsTransparentProxy",
+ /* 011C */ "IsTypeLoaded",
+ /* 011D */ "Join",
+ /* 011E */ "Key",
+ /* 011F */ "KeyCollection",
+ /* 0120 */ "LastIndexOf",
+ /* 0121 */ "LastIndexOfAny",
+ /* 0122 */ "Load",
+ /* 0123 */ "LoadInternal",
+ /* 0124 */ "Log",
+ /* 0125 */ "Log10",
+ /* 0126 */ "MakeRoom",
+ /* 0127 */ "ManualResetEvent",
+ /* 0128 */ "MarshalByRefObject",
+ /* 0129 */ "Math",
+ /* 012A */ "Max",
+ /* 012B */ "MaxValue",
+ /* 012C */ "MemberInfo",
+ /* 012D */ "MemberTypes",
+ /* 012E */ "MemberwiseClone",
+ /* 012F */ "Message",
+ /* 0130 */ "MetadataSize",
+ /* 0131 */ "MethodBase",
+ /* 0132 */ "MethodDef",
+ /* 0133 */ "MethodDefElements",
+ /* 0134 */ "MethodInfo",
+ /* 0135 */ "MethodRef",
+ /* 0136 */ "MethodRefElements",
+ /* 0137 */ "Microsoft.SPOT",
+ /* 0138 */ "Microsoft.SPOT.Hardware",
+ /* 0139 */ "Microsoft.SPOT.Messaging",
+ /* 013A */ "Microsoft.SPOT.Touch",
+ /* 013B */ "Milliseconds",
+ /* 013C */ "Min",
+ /* 013D */ "MinValue",
+ /* 013E */ "Minute",
+ /* 013F */ "Monitor",
+ /* 0140 */ "Month",
+ /* 0141 */ "MoveNext",
+ /* 0142 */ "MulticastDelegate",
+ /* 0143 */ "Native_Resources",
+ /* 0144 */ "Negate",
+ /* 0145 */ "NewGuid",
+ /* 0146 */ "Next",
+ /* 0147 */ "NextBytes",
+ /* 0148 */ "NextDouble",
+ /* 0149 */ "NotImplementedException",
+ /* 014A */ "NotSupportedException",
+ /* 014B */ "NullReferenceException",
+ /* 014C */ "Number",
+ /* 014D */ "NumberFormatInfo",
+ /* 014E */ "Object",
+ /* 014F */ "ObjectDisposedException",
+ /* 0150 */ "OnEvent",
+ /* 0151 */ "OutOfMemoryException",
+ /* 0152 */ "Parse",
+ /* 0153 */ "ParseAssemblyName",
+ /* 0154 */ "ParseCertificate",
+ /* 0155 */ "ParseNextChar",
+ /* 0156 */ "ParseQuoteString",
+ /* 0157 */ "ParseRepeatPattern",
+ /* 0158 */ "ParseTypeName",
+ /* 0159 */ "Peek",
+ /* 015A */ "Piezo",
+ /* 015B */ "Pop",
+ /* 015C */ "PostProcessFloat",
+ /* 015D */ "PostProcessInteger",
+ /* 015E */ "Pow",
+ /* 015F */ "Print",
+ /* 0160 */ "PriorityLevel",
+ /* 0161 */ "ProcessEvent",
+ /* 0162 */ "ProcessorArchitecture",
+ /* 0163 */ "PropertyInfo",
+ /* 0164 */ "Push",
+ /* 0165 */ "PushBackIntoRecoverList",
+ /* 0166 */ "Queue",
+ /* 0167 */ "Raise",
+ /* 0168 */ "RamSize",
+ /* 0169 */ "Random",
+ /* 016A */ "RangeBias",
+ /* 016B */ "ReRegisterForFinalize",
+ /* 016C */ "Read",
+ /* 016D */ "ReadByte",
+ /* 016E */ "Recover",
+ /* 016F */ "RecoverOrCreate",
+ /* 0170 */ "ReferenceEquals",
+ /* 0171 */ "Reflection",
+ /* 0172 */ "Rehash",
+ /* 0173 */ "RemotedException",
+ /* 0174 */ "RemotingServices",
+ /* 0175 */ "Remove",
+ /* 0176 */ "RemoveAt",
+ /* 0177 */ "Replace",
+ /* 0178 */ "ReplaceAllInChunk",
+ /* 0179 */ "ReplaceDecimalSeperator",
+ /* 017A */ "ReplaceInPlaceAtChunk",
+ /* 017B */ "ReplaceNegativeSign",
+ /* 017C */ "Reply",
+ /* 017D */ "ReplyRaw",
+ /* 017E */ "Reset",
+ /* 017F */ "ResourceManager",
+ /* 0180 */ "ResourceUtility",
+ /* 0181 */ "Resources",
+ /* 0182 */ "ResourcesData",
+ /* 0183 */ "ResourcesElements",
+ /* 0184 */ "ResourcesFiles",
+ /* 0185 */ "ResourcesFilesElements",
+ /* 0186 */ "Resume",
+ /* 0187 */ "RomSize",
+ /* 0188 */ "Round",
+ /* 0189 */ "RunClassConstructor",
+ /* 018A */ "RuntimeArgumentHandle",
+ /* 018B */ "RuntimeConstructorInfo",
+ /* 018C */ "RuntimeFieldHandle",
+ /* 018D */ "RuntimeFieldInfo",
+ /* 018E */ "RuntimeHelpers",
+ /* 018F */ "RuntimeMethodHandle",
+ /* 0190 */ "RuntimeMethodInfo",
+ /* 0191 */ "RuntimeType",
+ /* 0192 */ "RuntimeTypeHandle",
+ /* 0193 */ "SByte",
+ /* 0194 */ "SZArrayEnumerator",
+ /* 0195 */ "Scale",
+ /* 0196 */ "Second",
+ /* 0197 */ "Seek",
+ /* 0198 */ "SeekOrigin",
+ /* 0199 */ "SendMessage",
+ /* 019A */ "SendMessageRaw",
+ /* 019B */ "SerializationFlags",
+ /* 019C */ "SerializationHintsAttribute",
+ /* 019D */ "Serialize",
+ /* 019E */ "Set",
+ /* 019F */ "SetCapacity",
+ /* 01A0 */ "SetCurrentUICulture",
+ /* 01A1 */ "SetLength",
+ /* 01A2 */ "SetLocalTime",
+ /* 01A3 */ "SetValue",
+ /* 01A4 */ "Sign",
+ /* 01A5 */ "Signatures",
+ /* 01A6 */ "Sin",
+ /* 01A7 */ "Single",
+ /* 01A8 */ "Sinh",
+ /* 01A9 */ "Sleep",
+ /* 01AA */ "Source",
+ /* 01AB */ "SourceID",
+ /* 01AC */ "SpecifyKind",
+ /* 01AD */ "Split",
+ /* 01AE */ "Sqrt",
+ /* 01AF */ "Stack",
+ /* 01B0 */ "StandardBias",
+ /* 01B1 */ "StandardDate",
+ /* 01B2 */ "StandardName",
+ /* 01B3 */ "Start",
+ /* 01B4 */ "StartsWith",
+ /* 01B5 */ "StaticFields",
+ /* 01B6 */ "Stream",
+ /* 01B7 */ "String",
+ /* 01B8 */ "StringBuilder",
+ /* 01B9 */ "StringResources",
+ /* 01BA */ "Strings",
+ /* 01BB */ "Substring",
+ /* 01BC */ "Subtract",
+ /* 01BD */ "SuppressFinalize",
+ /* 01BE */ "Suspend",
+ /* 01BF */ "System",
+ /* 01C0 */ "System.Collections",
+ /* 01C1 */ "System.Collections.ICollection.get_Count",
+ /* 01C2 */ "System.Collections.IList.Add",
+ /* 01C3 */ "System.Collections.IList.Clear",
+ /* 01C4 */ "System.Collections.IList.Contains",
+ /* 01C5 */ "System.Collections.IList.IndexOf",
+ /* 01C6 */ "System.Collections.IList.Insert",
+ /* 01C7 */ "System.Collections.IList.Remove",
+ /* 01C8 */ "System.Collections.IList.RemoveAt",
+ /* 01C9 */ "System.Collections.IList.get_Item",
+ /* 01CA */ "System.Collections.IList.set_Item",
+ /* 01CB */ "System.ComponentModel",
+ /* 01CC */ "System.Diagnostics",
+ /* 01CD */ "System.Globalization",
+ /* 01CE */ "System.Globalization.Resources",
+ /* 01CF */ "System.IO",
+ /* 01D0 */ "System.Reflection",
+ /* 01D1 */ "System.Resources",
+ /* 01D2 */ "System.Runtime.CompilerServices",
+ /* 01D3 */ "System.Runtime.Remoting",
+ /* 01D4 */ "System.Runtime.Versioning",
+ /* 01D5 */ "System.Security.Cryptography.X509Certificates",
+ /* 01D6 */ "System.Text",
+ /* 01D7 */ "System.Threading",
+ /* 01D8 */ "SystemException",
+ /* 01D9 */ "SystemID",
+ /* 01DA */ "SystemInfo",
+ /* 01DB */ "SystemTime",
+ /* 01DC */ "Tan",
+ /* 01DD */ "Tanh",
+ /* 01DE */ "Target",
+ /* 01DF */ "TargetFrameworkAttribute",
+ /* 01E0 */ "Thread",
+ /* 01E1 */ "ThreadAbortException",
+ /* 01E2 */ "ThreadPriority",
+ /* 01E3 */ "ThreadStart",
+ /* 01E4 */ "ThreadState",
+ /* 01E5 */ "Time",
+ /* 01E6 */ "TimeEvents",
+ /* 01E7 */ "TimeSpan",
+ /* 01E8 */ "TimeStamp",
+ /* 01E9 */ "TimeZone",
+ /* 01EA */ "TimeZoneId",
+ /* 01EB */ "TimeZoneInformation",
+ /* 01EC */ "Timer",
+ /* 01ED */ "TimerCallback",
+ /* 01EE */ "Timestamp",
+ /* 01EF */ "ToArray",
+ /* 01F0 */ "ToBase64String",
+ /* 01F1 */ "ToBoolean",
+ /* 01F2 */ "ToByte",
+ /* 01F3 */ "ToByteArray",
+ /* 01F4 */ "ToChar",
+ /* 01F5 */ "ToCharArray",
+ /* 01F6 */ "ToDouble",
+ /* 01F7 */ "ToInt16",
+ /* 01F8 */ "ToInt32",
+ /* 01F9 */ "ToInt64",
+ /* 01FA */ "ToLocalTime",
+ /* 01FB */ "ToLower",
+ /* 01FC */ "ToSByte",
+ /* 01FD */ "ToSingle",
+ /* 01FE */ "ToString",
+ /* 01FF */ "ToUInt16",
+ /* 0200 */ "ToUInt32",
+ /* 0201 */ "ToUInt64",
+ /* 0202 */ "ToUniversalTime",
+ /* 0203 */ "ToUpper",
+ /* 0204 */ "TouchEvent",
+ /* 0205 */ "TouchGesture",
+ /* 0206 */ "TouchGestureEventArgs",
+ /* 0207 */ "TouchGestureEventHandler",
+ /* 0208 */ "TouchInput",
+ /* 0209 */ "TouchInputFlags",
+ /* 020A */ "TouchMessages",
+ /* 020B */ "TouchScreenEventArgs",
+ /* 020C */ "TouchScreenEventHandler",
+ /* 020D */ "Touches",
+ /* 020E */ "Trace",
+ /* 020F */ "Trim",
+ /* 0210 */ "TrimEnd",
+ /* 0211 */ "TrimStart",
+ /* 0212 */ "TrueString",
+ /* 0213 */ "Truncate",
+ /* 0214 */ "TryParse",
+ /* 0215 */ "TrySZIndexOf",
+ /* 0216 */ "Type",
+ /* 0217 */ "TypeCode",
+ /* 0218 */ "TypeDef",
+ /* 0219 */ "TypeDefElements",
+ /* 021A */ "TypeRef",
+ /* 021B */ "TypeRefElements",
+ /* 021C */ "TypeSpec",
+ /* 021D */ "TypeSpecElements",
+ /* 021E */ "UInt16",
+ /* 021F */ "UInt32",
+ /* 0220 */ "UInt64",
+ /* 0221 */ "UTF8Decoder",
+ /* 0222 */ "UTF8Encoding",
+ /* 0223 */ "UnknownTypeException",
+ /* 0224 */ "Unload",
+ /* 0225 */ "Utility",
+ /* 0226 */ "ValidateFormat",
+ /* 0227 */ "Value",
+ /* 0228 */ "ValueCollection",
+ /* 0229 */ "ValueType",
+ /* 022A */ "Version",
+ /* 022B */ "Void",
+ /* 022C */ "WaitAll",
+ /* 022D */ "WaitAny",
+ /* 022E */ "WaitForPendingFinalizers",
+ /* 022F */ "WaitHandle",
+ /* 0230 */ "WaitMultiple",
+ /* 0231 */ "WaitOne",
+ /* 0232 */ "WeakDelegate",
+ /* 0233 */ "WeakReference",
+ /* 0234 */ "Write",
+ /* 0235 */ "WriteByte",
+ /* 0236 */ "X",
+ /* 0237 */ "X509Certificate",
+ /* 0238 */ "Y",
+ /* 0239 */ "Year",
+ /* 023A */ "Zero",
+ /* 023B */ "_Build",
+ /* 023C */ "_Major",
+ /* 023D */ "_Minor",
+ /* 023E */ "_Revision",
+ /* 023F */ "_array",
+ /* 0240 */ "_arrayLength",
+ /* 0241 */ "_assembly",
+ /* 0242 */ "_buckets",
+ /* 0243 */ "_count",
+ /* 0244 */ "_endIndex",
+ /* 0245 */ "_frameworkDisplayName",
+ /* 0246 */ "_frameworkName",
+ /* 0247 */ "_growthFactor",
+ /* 0248 */ "_head",
+ /* 0249 */ "_index",
+ /* 024A */ "_items",
+ /* 024B */ "_loadFactor",
+ /* 024C */ "_maxLoadFactor",
+ /* 024D */ "_message",
+ /* 024E */ "_numberOfBuckets",
+ /* 024F */ "_random",
+ /* 0250 */ "_size",
+ /* 0251 */ "_startIndex",
+ /* 0252 */ "_tail",
+ /* 0253 */ "abbreviatedDayNames",
+ /* 0254 */ "abbreviatedMonthNames",
+ /* 0255 */ "amDesignator",
+ /* 0256 */ "dateSeparator",
+ /* 0257 */ "dateTimeInfo",
+ /* 0258 */ "dayNames",
+ /* 0259 */ "fullDateTimePattern",
+ /* 025A */ "generalLongTimePattern",
+ /* 025B */ "generalShortTimePattern",
+ /* 025C */ "get_AMDesignator",
+ /* 025D */ "get_AbbreviatedDayNames",
+ /* 025E */ "get_AbbreviatedMonthNames",
+ /* 025F */ "get_Angle",
+ /* 0260 */ "get_Assembly",
+ /* 0261 */ "get_AssemblyQualifiedName",
+ /* 0262 */ "get_BaseType",
+ /* 0263 */ "get_Build",
+ /* 0264 */ "get_CanRead",
+ /* 0265 */ "get_CanSeek",
+ /* 0266 */ "get_CanTimeout",
+ /* 0267 */ "get_CanWrite",
+ /* 0268 */ "get_Capacity",
+ /* 0269 */ "get_Chars",
+ /* 026A */ "get_Count",
+ /* 026B */ "get_Current",
+ /* 026C */ "get_CurrentDomain",
+ /* 026D */ "get_CurrentInfo",
+ /* 026E */ "get_CurrentThread",
+ /* 026F */ "get_CurrentTimeZone",
+ /* 0270 */ "get_CurrentUICulture",
+ /* 0271 */ "get_CurrentUICultureInternal",
+ /* 0272 */ "get_Date",
+ /* 0273 */ "get_DateSeparator",
+ /* 0274 */ "get_DateTimeFormat",
+ /* 0275 */ "get_Day",
+ /* 0276 */ "get_DayNames",
+ /* 0277 */ "get_DayOfWeek",
+ /* 0278 */ "get_DayOfYear",
+ /* 0279 */ "get_DaylightName",
+ /* 027A */ "get_Days",
+ /* 027B */ "get_DeclaringType",
+ /* 027C */ "get_Delta",
+ /* 027D */ "get_End",
+ /* 027E */ "get_ErrorCode",
+ /* 027F */ "get_FieldType",
+ /* 0280 */ "get_Flags",
+ /* 0281 */ "get_FrameworkDisplayName",
+ /* 0282 */ "get_FrameworkName",
+ /* 0283 */ "get_FriendlyName",
+ /* 0284 */ "get_FullDateTimePattern",
+ /* 0285 */ "get_FullName",
+ /* 0286 */ "get_GeneralLongTimePattern",
+ /* 0287 */ "get_GeneralShortTimePattern",
+ /* 0288 */ "get_GrowthFactor",
+ /* 0289 */ "get_Hour",
+ /* 028A */ "get_Hours",
+ /* 028B */ "get_Id",
+ /* 028C */ "get_InnerException",
+ /* 028D */ "get_IsAbstract",
+ /* 028E */ "get_IsAlive",
+ /* 028F */ "get_IsArray",
+ /* 0290 */ "get_IsAttached",
+ /* 0291 */ "get_IsBigEndian",
+ /* 0292 */ "get_IsClass",
+ /* 0293 */ "get_IsEnum",
+ /* 0294 */ "get_IsFinal",
+ /* 0295 */ "get_IsFixedSize",
+ /* 0296 */ "get_IsInterface",
+ /* 0297 */ "get_IsLittleEndian",
+ /* 0298 */ "get_IsNotPublic",
+ /* 0299 */ "get_IsPublic",
+ /* 029A */ "get_IsReadOnly",
+ /* 029B */ "get_IsSerializable",
+ /* 029C */ "get_IsStatic",
+ /* 029D */ "get_IsSynchronized",
+ /* 029E */ "get_IsValid",
+ /* 029F */ "get_IsValueType",
+ /* 02A0 */ "get_IsVirtual",
+ /* 02A1 */ "get_Issuer",
+ /* 02A2 */ "get_Item",
+ /* 02A3 */ "get_Keys",
+ /* 02A4 */ "get_Kind",
+ /* 02A5 */ "get_LastExpiration",
+ /* 02A6 */ "get_Length",
+ /* 02A7 */ "get_LongDatePattern",
+ /* 02A8 */ "get_LongTimePattern",
+ /* 02A9 */ "get_Major",
+ /* 02AA */ "get_ManagedThreadId",
+ /* 02AB */ "get_MaxCapacity",
+ /* 02AC */ "get_MaxLoadFactor",
+ /* 02AD */ "get_MemberType",
+ /* 02AE */ "get_Message",
+ /* 02AF */ "get_Method",
+ /* 02B0 */ "get_Millisecond",
+ /* 02B1 */ "get_Milliseconds",
+ /* 02B2 */ "get_Minor",
+ /* 02B3 */ "get_Minute",
+ /* 02B4 */ "get_Minutes",
+ /* 02B5 */ "get_Model",
+ /* 02B6 */ "get_Month",
+ /* 02B7 */ "get_MonthDayPattern",
+ /* 02B8 */ "get_MonthNames",
+ /* 02B9 */ "get_Name",
+ /* 02BA */ "get_NegativeSign",
+ /* 02BB */ "get_Now",
+ /* 02BC */ "get_NumberDecimalSeparator",
+ /* 02BD */ "get_NumberFormat",
+ /* 02BE */ "get_NumberGroupSeparator",
+ /* 02BF */ "get_NumberGroupSizes",
+ /* 02C0 */ "get_OEM",
+ /* 02C1 */ "get_OEMString",
+ /* 02C2 */ "get_OffsetToStringData",
+ /* 02C3 */ "get_PMDesignator",
+ /* 02C4 */ "get_ParamName",
+ /* 02C5 */ "get_Parent",
+ /* 02C6 */ "get_Payload",
+ /* 02C7 */ "get_PayloadRaw",
+ /* 02C8 */ "get_Position",
+ /* 02C9 */ "get_PositiveSign",
+ /* 02CA */ "get_Priority",
+ /* 02CB */ "get_PropertyName",
+ /* 02CC */ "get_PropertyType",
+ /* 02CD */ "get_RFC1123Pattern",
+ /* 02CE */ "get_ReadTimeout",
+ /* 02CF */ "get_ResourceManager",
+ /* 02D0 */ "get_ReturnType",
+ /* 02D1 */ "get_Revision",
+ /* 02D2 */ "get_SKU",
+ /* 02D3 */ "get_Second",
+ /* 02D4 */ "get_Seconds",
+ /* 02D5 */ "get_Selector",
+ /* 02D6 */ "get_ShortDatePattern",
+ /* 02D7 */ "get_ShortTimePattern",
+ /* 02D8 */ "get_SortableDateTimePattern",
+ /* 02D9 */ "get_StackTrace",
+ /* 02DA */ "get_StandardName",
+ /* 02DB */ "get_Start",
+ /* 02DC */ "get_Subject",
+ /* 02DD */ "get_SyncRoot",
+ /* 02DE */ "get_Target",
+ /* 02DF */ "get_ThreadState",
+ /* 02E0 */ "get_Ticks",
+ /* 02E1 */ "get_TimeOfDay",
+ /* 02E2 */ "get_TimeSeparator",
+ /* 02E3 */ "get_Today",
+ /* 02E4 */ "get_UTF8",
+ /* 02E5 */ "get_UniversalSortableDateTimePattern",
+ /* 02E6 */ "get_UseRFC4648Encoding",
+ /* 02E7 */ "get_UtcNow",
+ /* 02E8 */ "get_Values",
+ /* 02E9 */ "get_Version",
+ /* 02EA */ "get_WriteTimeout",
+ /* 02EB */ "get_Year",
+ /* 02EC */ "get_YearMonthPattern",
+ /* 02ED */ "ht",
+ /* 02EE */ "index",
+ /* 02EF */ "key",
+ /* 02F0 */ "longDatePattern",
+ /* 02F1 */ "longTimePattern",
+ /* 02F2 */ "m_AppDomain",
+ /* 02F3 */ "m_ChunkChars",
+ /* 02F4 */ "m_ChunkLength",
+ /* 02F5 */ "m_ChunkOffset",
+ /* 02F6 */ "m_ChunkPrevious",
+ /* 02F7 */ "m_Delegate",
+ /* 02F8 */ "m_HResult",
+ /* 02F9 */ "m_Id",
+ /* 02FA */ "m_MaxCapacity",
+ /* 02FB */ "m_Priority",
+ /* 02FC */ "m_Thread",
+ /* 02FD */ "m_appDomain",
+ /* 02FE */ "m_assembly",
+ /* 02FF */ "m_baseAssembly",
+ /* 0300 */ "m_baseName",
+ /* 0301 */ "m_callback",
+ /* 0302 */ "m_certificate",
+ /* 0303 */ "m_cultureInfo",
+ /* 0304 */ "m_cultureName",
+ /* 0305 */ "m_data",
+ /* 0306 */ "m_delta",
+ /* 0307 */ "m_effectiveDate",
+ /* 0308 */ "m_end",
+ /* 0309 */ "m_expirationDate",
+ /* 030A */ "m_flags",
+ /* 030B */ "m_friendlyName",
+ /* 030C */ "m_handle",
+ /* 030D */ "m_hash",
+ /* 030E */ "m_id",
+ /* 030F */ "m_innerException",
+ /* 0310 */ "m_issuer",
+ /* 0311 */ "m_message",
+ /* 0312 */ "m_name",
+ /* 0313 */ "m_paramName",
+ /* 0314 */ "m_parent",
+ /* 0315 */ "m_password",
+ /* 0316 */ "m_payload",
+ /* 0317 */ "m_rand",
+ /* 0318 */ "m_refs",
+ /* 0319 */ "m_resourceFileId",
+ /* 031A */ "m_rm",
+ /* 031B */ "m_rmFallback",
+ /* 031C */ "m_selector",
+ /* 031D */ "m_seq",
+ /* 031E */ "m_sessionHandle",
+ /* 031F */ "m_size",
+ /* 0320 */ "m_source",
+ /* 0321 */ "m_stackTrace",
+ /* 0322 */ "m_start",
+ /* 0323 */ "m_state",
+ /* 0324 */ "m_subject",
+ /* 0325 */ "m_ticks",
+ /* 0326 */ "m_ticksOffset",
+ /* 0327 */ "m_timer",
+ /* 0328 */ "m_type",
+ /* 0329 */ "m_value",
+ /* 032A */ "manager",
+ /* 032B */ "monthDayPattern",
+ /* 032C */ "monthNames",
+ /* 032D */ "mscorlib",
+ /* 032E */ "negativeSign",
+ /* 032F */ "next",
+ /* 0330 */ "numInfo",
+ /* 0331 */ "numberDecimalSeparator",
+ /* 0332 */ "numberGroupSeparator",
+ /* 0333 */ "numberGroupSizes",
+ /* 0334 */ "op_Addition",
+ /* 0335 */ "op_Equality",
+ /* 0336 */ "op_GreaterThan",
+ /* 0337 */ "op_GreaterThanOrEqual",
+ /* 0338 */ "op_Inequality",
+ /* 0339 */ "op_LessThan",
+ /* 033A */ "op_LessThanOrEqual",
+ /* 033B */ "op_Subtraction",
+ /* 033C */ "op_UnaryNegation",
+ /* 033D */ "op_UnaryPlus",
+ /* 033E */ "pmDesignator",
+ /* 033F */ "positiveSign",
+ /* 0340 */ "propertyName",
+ /* 0341 */ "returnType",
+ /* 0342 */ "s_ewr",
+ /* 0343 */ "s_rgbBase64Decode",
+ /* 0344 */ "s_rgchBase64Encoding",
+ /* 0345 */ "s_rgchBase64EncodingDefault",
+ /* 0346 */ "s_rgchBase64EncodingRFC4648",
+ /* 0347 */ "set_Capacity",
+ /* 0348 */ "set_CurrentUICultureInternal",
+ /* 0349 */ "set_FrameworkDisplayName",
+ /* 034A */ "set_GrowthFactor",
+ /* 034B */ "set_Item",
+ /* 034C */ "set_Length",
+ /* 034D */ "set_MaxLoadFactor",
+ /* 034E */ "set_Position",
+ /* 034F */ "set_Priority",
+ /* 0350 */ "set_ReadTimeout",
+ /* 0351 */ "set_Target",
+ /* 0352 */ "set_UseRFC4648Encoding",
+ /* 0353 */ "set_WriteTimeout",
+ /* 0354 */ "shortDatePattern",
+ /* 0355 */ "shortTimePattern",
+ /* 0356 */ "temp",
+ /* 0357 */ "ticksAtOrigin",
+ /* 0358 */ "timeSeparator",
+ /* 0359 */ "value",
+ /* 035A */ "value__",
+ /* 035B */ "yearMonthPattern",
+ }
+ .Select((value, index) => new {value, index = (ushort) (0xFFFF - index)})
+ .ToDictionary(item => item.value, item => item.index, StringComparer.Ordinal);
+ }
+}
diff --git a/source/MetadataProcessor.Core/nanoAssemblyBuilder.cs b/source/MetadataProcessor.Core/nanoAssemblyBuilder.cs
new file mode 100644
index 00000000..22be290e
--- /dev/null
+++ b/source/MetadataProcessor.Core/nanoAssemblyBuilder.cs
@@ -0,0 +1,113 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using Mono.Cecil;
+using System.Collections.Generic;
+using System.IO;
+using System.Xml;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Main metadata transformation class - builds .NET nanoFramework assembly
+ /// from full .NET Framework assembly metadata represented in Mono.Cecil format.
+ ///
+ public sealed class nanoAssemblyBuilder
+ {
+ private readonly nanoTablesContext _tablesContext;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ /// Original assembly metadata in Mono.Cecil format.
+ /// List of full type names with explicit ordering.
+ /// Custom string literals sorter for UTs using only.
+ ///
+ /// If contains true each type/method/field should contains one attribute of each type.
+ ///
+ public nanoAssemblyBuilder(
+ AssemblyDefinition assemblyDefinition,
+ List explicitTypesOrder = null,
+ ICustomStringSorter stringSorter = null,
+ bool applyAttributesCompression = false)
+ {
+ _tablesContext = new nanoTablesContext(
+ assemblyDefinition, explicitTypesOrder, stringSorter, applyAttributesCompression);
+ }
+
+ ///
+ /// Writes all .NET nanoFramework metadata into output stream.
+ ///
+ /// Binary writer with correct endianness.
+ public void Write(
+ nanoBinaryWriter binaryWriter)
+ {
+ var header = new nanoAssemblyDefinition(_tablesContext);
+ header.Write(binaryWriter, true);
+
+ foreach (var table in GetTables(_tablesContext))
+ {
+ var tableBegin = (binaryWriter.BaseStream.Position + 3) & 0xFFFFFFFC;
+ table.Write(binaryWriter);
+
+ var padding = (4 - ((binaryWriter.BaseStream.Position - tableBegin) % 4)) % 4;
+ binaryWriter.WriteBytes(new byte[padding]);
+
+ header.UpdateTableOffset(binaryWriter, tableBegin, padding);
+ }
+
+ binaryWriter.BaseStream.Seek(0, SeekOrigin.Begin);
+ header.Write(binaryWriter, false);
+ }
+
+ public void Write(
+ XmlWriter xmlWriter)
+ {
+ var pdbxWriter = new nanoPdbxFileWriter(_tablesContext);
+ pdbxWriter.Write(xmlWriter);
+ }
+
+ private static IEnumerable GetTables(
+ nanoTablesContext context)
+ {
+ yield return context.AssemblyReferenceTable;
+
+ yield return context.TypeReferencesTable;
+
+ yield return context.FieldReferencesTable;
+
+ yield return context.MethodReferencesTable;
+
+ yield return context.TypeDefinitionTable;
+
+ yield return context.FieldsTable;
+
+ yield return context.MethodDefinitionTable;
+
+ yield return context.AttributesTable;
+
+ yield return context.TypeSpecificationsTable;
+
+ yield return context.ResourcesTable;
+
+ yield return context.ResourceDataTable;
+
+ context.ByteCodeTable.UpdateStringTable();
+ context.StringTable.GetOrCreateStringId(
+ context.AssemblyDefinition.Name.Name);
+
+ yield return context.StringTable;
+
+ yield return context.SignaturesTable;
+
+ yield return context.ByteCodeTable;
+
+ yield return context.ResourceFileTable;
+
+ yield return nanoEmptyTable.Instance;
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/nanoAssemblyDefinition.cs b/source/MetadataProcessor.Core/nanoAssemblyDefinition.cs
new file mode 100644
index 00000000..0272f3ad
--- /dev/null
+++ b/source/MetadataProcessor.Core/nanoAssemblyDefinition.cs
@@ -0,0 +1,186 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// Original work from Oleg Rakhmatulin.
+// See LICENSE file in the project root for full license information.
+//
+
+using System.IO;
+
+namespace nanoFramework.Tools.MetadataProcessor
+{
+ ///
+ /// Encapsulates logic for assembly definition (header) writing.
+ ///
+ public sealed class nanoAssemblyDefinition
+ {
+ ///
+ /// nanoFramework assembly marker V1.
+ ///
+ private const string c_NFAssemblyMarker_v1 = "NFMRK1";
+
+ ///
+ /// Position of Assembly CRC32 in the PE file.
+ ///
+ private const int c_AssemblyCrc32Position = 0x0C;
+
+ ///
+ /// Position of the header CRC32 in the PE file.
+ ///
+ private const int c_HeaderCrc32Position = 0x08;
+
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ private readonly nanoTablesContext _context;
+
+ ///
+ /// Offset for current table address writing.
+ ///
+ private long _tablesOffset;
+
+ ///
+ /// Offset for current table padding writing.
+ ///
+ private long _paddingsOffset;
+
+ ///
+ /// Creates new instance of object.
+ ///
+ ///
+ /// Assembly tables context - contains all tables used for building target assembly.
+ ///
+ public nanoAssemblyDefinition(
+ nanoTablesContext context)
+ {
+ _context = context;
+ }
+
+ ///
+ /// Writes header information into output stream (w/o CRC and table offsets/paddings).
+ ///
+ /// Binary writer with correct endianness.
+ /// If true no assembly name will be written.
+ public void Write(
+ nanoBinaryWriter writer,
+ bool isPreAllocationCall)
+ {
+ // this replicates the original struct CLR_RECORD_ASSEMBLY
+
+ writer.WriteString(c_NFAssemblyMarker_v1);
+
+ // header CRC32
+ writer.WriteUInt32(0);
+
+ // assembly CRC32
+ writer.WriteUInt32(0);
+
+ // current builds are for little endian targets only
+ // keeping this here for now, just for compatibility
+ writer.WriteUInt32(0);
+
+ // native methods CRC32
+ writer.WriteUInt32(writer.IsBigEndian ? _context.NativeMethodsCrc.Current : 0x00);
+
+ // the existing MDP seems to have a bug because it's adding an extra byte at this place in the struct
+ // right between the NativeMethodsChecksum and PatchEntryOffset fields.
+ //// need this here to pad the structure in order to have a PE exactly as the one being generated now
+ //writer.WriteByte(0);
+
+ // Native methods offset
+ writer.WriteUInt32(0xFFFFFFFF);
+
+ writer.WriteVersion(_context.AssemblyDefinition.Name.Version);
+
+ writer.WriteUInt16(isPreAllocationCall
+ ? (ushort) 0x0000
+ : _context.StringTable.GetOrCreateStringId(_context.AssemblyDefinition.Name.Name));
+ writer.WriteUInt16(1); // String table version
+
+ //For every table, a number of bytes that were padded to the end of the table
+ //to align to unsigned long. Each table starts at a unsigned long boundary, and ends
+ //at a unsigned long boundary. Some of these tables will, by construction, have
+ //no padding, and all will have values in the range [0-3]. This isn't the most
+ //compact form to hold this information, but it only costs 16 bytes/assembly.
+ //Trying to only align some of the tables is just much more hassle than it's worth.
+ //And, of course, this field also has to be unsigned long-aligned.
+ if (isPreAllocationCall)
+ {
+ _tablesOffset = writer.BaseStream.Position;
+ for (var i = 0; i < 16; ++i)
+ {
+ writer.WriteUInt32(0);
+ }
+
+ writer.WriteUInt32(0); // Number of patched methods
+
+ _paddingsOffset = writer.BaseStream.Position;
+ for (var i = 0; i < 16; ++i)
+ {
+ writer.WriteByte(0);
+ }
+ }
+ else
+ {
+ // order matters!
+ // need to compute Assembly CRC32 before header CRC32
+
+ // set writer position at Assembly CRC32 position
+ writer.BaseStream.Seek(c_AssemblyCrc32Position, SeekOrigin.Begin);
+
+ var assemblyCrc32 = ComputeCrc32(
+ writer.BaseStream,
+ _paddingsOffset,
+ writer.BaseStream.Length - _paddingsOffset);
+ writer.WriteUInt32(assemblyCrc32);
+
+ // set writer position at Header CRC32 position
+ writer.BaseStream.Seek(c_HeaderCrc32Position, SeekOrigin.Begin);
+
+ var headerCrc32 = ComputeCrc32(
+ writer.BaseStream,
+ 0,
+ _paddingsOffset);
+ writer.WriteUInt32(headerCrc32);
+ }
+ }
+
+ ///
+ /// Updates tables offset value and padding value for current table and
+ /// advance writing position for next method call (filling tables info).
+ ///
+ /// Binary writer.
+ /// Table beginning address (offset).
+ /// Table padding value.
+ public void UpdateTableOffset(
+ nanoBinaryWriter writer,
+ long tableBegin,
+ long padding)
+ {
+ writer.BaseStream.Seek(_tablesOffset, SeekOrigin.Begin);
+ writer.WriteUInt32((uint)tableBegin);
+ _tablesOffset += sizeof(int);
+
+ writer.BaseStream.Seek(_paddingsOffset, SeekOrigin.Begin);
+ writer.WriteByte((byte)padding);
+ _paddingsOffset += sizeof(byte);
+
+ writer.BaseStream.Seek(0, SeekOrigin.End);
+ }
+
+ private static uint ComputeCrc32(
+ Stream outputStream,
+ long startOffset,
+ long size)
+ {
+ var currentPosition = outputStream.Position;
+ outputStream.Seek(startOffset, SeekOrigin.Begin);
+
+ var buffer = new byte[size];
+ outputStream.Read(buffer, 0, buffer.Length);
+
+ outputStream.Seek(currentPosition, SeekOrigin.Begin);
+
+ return Crc32.Compute(buffer);
+ }
+ }
+}
diff --git a/source/MetadataProcessor.Core/packages.config b/source/MetadataProcessor.Core/packages.config
new file mode 100644
index 00000000..778a66e9
--- /dev/null
+++ b/source/MetadataProcessor.Core/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.command.1.tlog b/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.command.1.tlog
deleted file mode 100644
index 8d0a18a8..00000000
Binary files a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.command.1.tlog and /dev/null differ
diff --git a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.write.1.tlog b/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.write.1.tlog
deleted file mode 100644
index 0df2e7ed..00000000
Binary files a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.write.1.tlog and /dev/null differ
diff --git a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.read.1.tlog b/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.read.1.tlog
deleted file mode 100644
index 128723c0..00000000
Binary files a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.read.1.tlog and /dev/null differ
diff --git a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.write.1.tlog b/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.write.1.tlog
deleted file mode 100644
index 904771fd..00000000
Binary files a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.write.1.tlog and /dev/null differ
diff --git a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib.command.1.tlog b/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib.command.1.tlog
deleted file mode 100644
index bfb51b42..00000000
Binary files a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib.command.1.tlog and /dev/null differ
diff --git a/source/Tools.CorHelper/Debug/Tools.Lib.CorHelper.idb b/source/Tools.CorHelper/Debug/Tools.Lib.CorHelper.idb
deleted file mode 100644
index 5fb91df1..00000000
Binary files a/source/Tools.CorHelper/Debug/Tools.Lib.CorHelper.idb and /dev/null differ
diff --git a/source/Tools.Parser/Debug/Tools.Lib.Parser.idb b/source/Tools.Parser/Debug/Tools.Lib.Parser.idb
deleted file mode 100644
index dbbe31e4..00000000
Binary files a/source/Tools.Parser/Debug/Tools.Lib.Parser.idb and /dev/null differ
diff --git a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.command.1.tlog b/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.command.1.tlog
deleted file mode 100644
index 79d1ac8f..00000000
Binary files a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.command.1.tlog and /dev/null differ
diff --git a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.write.1.tlog b/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.write.1.tlog
deleted file mode 100644
index e2320f3c..00000000
Binary files a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.write.1.tlog and /dev/null differ
diff --git a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.read.1.tlog b/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.read.1.tlog
deleted file mode 100644
index f871b6e7..00000000
Binary files a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.read.1.tlog and /dev/null differ
diff --git a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.write.1.tlog b/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.write.1.tlog
deleted file mode 100644
index 114a122a..00000000
Binary files a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.write.1.tlog and /dev/null differ
diff --git a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib.command.1.tlog b/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib.command.1.tlog
deleted file mode 100644
index ff69c4df..00000000
Binary files a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib.command.1.tlog and /dev/null differ
diff --git a/source/nanoFramework.Tools.MetadataProcessor.sln b/source/nanoFramework.Tools.MetadataProcessor.sln
index 6eecaffd..e8016217 100644
--- a/source/nanoFramework.Tools.MetadataProcessor.sln
+++ b/source/nanoFramework.Tools.MetadataProcessor.sln
@@ -1,207 +1,34 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.27130.2027
+VisualStudioVersion = 15.0.28307.902
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MetaDataProcessor", "MetaDataProcessor", "{FCCC9596-0809-4BB4-ACC2-3615EEC264C7}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetadataProcessor.Core", "MetadataProcessor.Core\MetadataProcessor.Core.csproj", "{E32F7D15-2499-440C-8026-4D5EE1C5EC3A}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "..\nf-interpreter\src\CLR\Core\Core.vcxproj", "{89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CorLib", "..\nf-interpreter\src\CLR\CorLib\CorLib.vcxproj", "{58E950CC-2FF6-423C-B006-A70A19272F20}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Diagnostics", "..\nf-interpreter\src\CLR\Diagnostics\Diagnostics.vcxproj", "{A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tools.Lib.Parser", "Tools.Parser\Parser.vcxproj", "{AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Serialization", "..\nf-interpreter\src\CLR\Core\Serialization\Serialization.vcxproj", "{16BF6131-A3B8-4B97-B867-E45669FB48BD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RPC", "..\nf-interpreter\src\CLR\Core\RPC\RPC.vcxproj", "{ED4C887A-EC09-465B-B5D9-075450ADC52D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Messaging", "..\nf-interpreter\src\CLR\Messaging\Messaging.vcxproj", "{131001E3-0201-451F-A87B-951D1C5C3EEE}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WireProtocol", "..\nf-interpreter\src\CLR\WireProtocol\WireProtocol.vcxproj", "{2337C4A4-3AB4-4014-9C29-9EBE32F4510E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hardware", "..\nf-interpreter\src\CLR\Core\Hardware\Hardware.vcxproj", "{5D50772E-DAC8-407D-972F-37DEB4450B72}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tools.Lib.CorHelper", "Tools.CorHelper\CorHelper.vcxproj", "{079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InterruptHandler", "..\nf-interpreter\src\CLR\Core\InterruptHandler\InterruptHandler.vcxproj", "{D32EE397-7E49-452D-AC95-AFCB3C962E3D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tools.MetaDataProcessor", "Tools.MetaDataProcessor\MetaDataProcessor.vcxproj", "{80209A7E-B9F0-4143-BCD1-B1891236A3CF}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetadataProcessor.Console", "MetadataProcessor.Console\MetadataProcessor.Console.csproj", "{A9E02E14-7321-4B12-8AB5-9A0408ED8FD0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
- Release|x64 = Release|x64
- Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|Any CPU.Build.0 = Debug|Win32
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|x64.ActiveCfg = Debug|x64
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|x64.Build.0 = Debug|x64
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|x86.ActiveCfg = Debug|Win32
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|x86.Build.0 = Debug|Win32
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|Any CPU.ActiveCfg = Release|Win32
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|Any CPU.Build.0 = Release|Win32
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|x64.ActiveCfg = Release|x64
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|x64.Build.0 = Release|x64
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|x86.ActiveCfg = Release|Win32
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|x86.Build.0 = Release|Win32
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|Any CPU.Build.0 = Debug|Win32
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|x64.ActiveCfg = Debug|x64
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|x64.Build.0 = Debug|x64
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|x86.ActiveCfg = Debug|Win32
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|x86.Build.0 = Debug|Win32
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|Any CPU.ActiveCfg = Release|Win32
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|Any CPU.Build.0 = Release|Win32
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|x64.ActiveCfg = Release|x64
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|x64.Build.0 = Release|x64
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|x86.ActiveCfg = Release|Win32
- {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|x86.Build.0 = Release|Win32
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|Any CPU.Build.0 = Debug|Win32
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|x64.ActiveCfg = Debug|x64
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|x64.Build.0 = Debug|x64
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|x86.ActiveCfg = Debug|Win32
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|x86.Build.0 = Debug|Win32
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|Any CPU.ActiveCfg = Release|Win32
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|Any CPU.Build.0 = Release|Win32
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|x64.ActiveCfg = Release|x64
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|x64.Build.0 = Release|x64
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|x86.ActiveCfg = Release|Win32
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|x86.Build.0 = Release|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|Any CPU.Build.0 = Debug|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|x64.ActiveCfg = Debug|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|x64.Build.0 = Debug|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|x86.ActiveCfg = Debug|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|x86.Build.0 = Debug|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|Any CPU.ActiveCfg = Release|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|Any CPU.Build.0 = Release|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|x64.ActiveCfg = Release|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|x64.Build.0 = Release|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|x86.ActiveCfg = Release|Win32
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|x86.Build.0 = Release|Win32
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|Any CPU.Build.0 = Debug|Win32
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|x64.ActiveCfg = Debug|x64
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|x64.Build.0 = Debug|x64
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|x86.ActiveCfg = Debug|Win32
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|x86.Build.0 = Debug|Win32
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|Any CPU.ActiveCfg = Release|Win32
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|Any CPU.Build.0 = Release|Win32
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|x64.ActiveCfg = Release|x64
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|x64.Build.0 = Release|x64
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|x86.ActiveCfg = Release|Win32
- {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|x86.Build.0 = Release|Win32
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|Any CPU.Build.0 = Debug|Win32
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|x64.ActiveCfg = Debug|x64
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|x64.Build.0 = Debug|x64
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|x86.ActiveCfg = Debug|Win32
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|x86.Build.0 = Debug|Win32
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|Any CPU.ActiveCfg = Release|Win32
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|Any CPU.Build.0 = Release|Win32
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|x64.ActiveCfg = Release|x64
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|x64.Build.0 = Release|x64
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|x86.ActiveCfg = Release|Win32
- {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|x86.Build.0 = Release|Win32
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|Any CPU.Build.0 = Debug|Win32
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|x64.ActiveCfg = Debug|x64
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|x64.Build.0 = Debug|x64
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|x86.ActiveCfg = Debug|Win32
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|x86.Build.0 = Debug|Win32
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|Any CPU.ActiveCfg = Release|Win32
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|Any CPU.Build.0 = Release|Win32
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|x64.ActiveCfg = Release|x64
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|x64.Build.0 = Release|x64
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|x86.ActiveCfg = Release|Win32
- {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|x86.Build.0 = Release|Win32
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|Any CPU.Build.0 = Debug|Win32
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|x64.ActiveCfg = Debug|x64
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|x64.Build.0 = Debug|x64
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|x86.ActiveCfg = Debug|Win32
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|x86.Build.0 = Debug|Win32
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|Any CPU.ActiveCfg = Release|Win32
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|Any CPU.Build.0 = Release|Win32
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|x64.ActiveCfg = Release|x64
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|x64.Build.0 = Release|x64
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|x86.ActiveCfg = Release|Win32
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|x86.Build.0 = Release|Win32
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|Any CPU.Build.0 = Debug|Win32
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|x64.ActiveCfg = Debug|x64
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|x64.Build.0 = Debug|x64
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|x86.ActiveCfg = Debug|Win32
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|x86.Build.0 = Debug|Win32
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|Any CPU.ActiveCfg = Release|Win32
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|Any CPU.Build.0 = Release|Win32
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|x64.ActiveCfg = Release|x64
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|x64.Build.0 = Release|x64
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|x86.ActiveCfg = Release|Win32
- {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|x86.Build.0 = Release|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|Any CPU.Build.0 = Debug|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|x64.ActiveCfg = Debug|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|x64.Build.0 = Debug|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|x86.ActiveCfg = Debug|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|x86.Build.0 = Debug|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|Any CPU.ActiveCfg = Release|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|Any CPU.Build.0 = Release|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|x64.ActiveCfg = Release|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|x64.Build.0 = Release|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|x86.ActiveCfg = Release|Win32
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|x86.Build.0 = Release|Win32
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|Any CPU.Build.0 = Debug|Win32
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|x64.ActiveCfg = Debug|x64
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|x64.Build.0 = Debug|x64
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|x86.ActiveCfg = Debug|Win32
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|x86.Build.0 = Debug|Win32
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|Any CPU.ActiveCfg = Release|Win32
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|Any CPU.Build.0 = Release|Win32
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|x64.ActiveCfg = Release|x64
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|x64.Build.0 = Release|x64
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|x86.ActiveCfg = Release|Win32
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|x86.Build.0 = Release|Win32
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|Any CPU.Build.0 = Debug|Win32
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|x64.ActiveCfg = Debug|x64
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|x64.Build.0 = Debug|x64
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|x86.ActiveCfg = Debug|Win32
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|x86.Build.0 = Debug|Win32
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|Any CPU.ActiveCfg = Release|Win32
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|Any CPU.Build.0 = Release|Win32
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|x64.ActiveCfg = Release|x64
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|x64.Build.0 = Release|x64
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|x86.ActiveCfg = Release|Win32
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|x86.Build.0 = Release|Win32
+ {E32F7D15-2499-440C-8026-4D5EE1C5EC3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E32F7D15-2499-440C-8026-4D5EE1C5EC3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E32F7D15-2499-440C-8026-4D5EE1C5EC3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E32F7D15-2499-440C-8026-4D5EE1C5EC3A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A9E02E14-7321-4B12-8AB5-9A0408ED8FD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A9E02E14-7321-4B12-8AB5-9A0408ED8FD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A9E02E14-7321-4B12-8AB5-9A0408ED8FD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A9E02E14-7321-4B12-8AB5-9A0408ED8FD0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {58E950CC-2FF6-423C-B006-A70A19272F20} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {16BF6131-A3B8-4B97-B867-E45669FB48BD} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {ED4C887A-EC09-465B-B5D9-075450ADC52D} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {131001E3-0201-451F-A87B-951D1C5C3EEE} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {2337C4A4-3AB4-4014-9C29-9EBE32F4510E} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {5D50772E-DAC8-407D-972F-37DEB4450B72} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {D32EE397-7E49-452D-AC95-AFCB3C962E3D} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- {80209A7E-B9F0-4143-BCD1-B1891236A3CF} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
- EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {5DF99A8C-CA3C-451A-ABC1-4D862154708B}
+ SolutionGuid = {31412224-888D-40FC-AE73-2FF5468E59CD}
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = MFMetaDataProcessor.Core\MFMetaDataProcessor.Core.csproj
EndGlobalSection
EndGlobal
diff --git a/source/Tools.CorHelper/CorHelper-vs2019.vcproj b/source/native/Tools.CorHelper/CorHelper-vs2019.vcproj
similarity index 100%
rename from source/Tools.CorHelper/CorHelper-vs2019.vcproj
rename to source/native/Tools.CorHelper/CorHelper-vs2019.vcproj
diff --git a/source/Tools.CorHelper/CorHelper-vs2019.vcxproj b/source/native/Tools.CorHelper/CorHelper-vs2019.vcxproj
similarity index 90%
rename from source/Tools.CorHelper/CorHelper-vs2019.vcxproj
rename to source/native/Tools.CorHelper/CorHelper-vs2019.vcxproj
index c7b9081d..01842e23 100644
--- a/source/Tools.CorHelper/CorHelper-vs2019.vcxproj
+++ b/source/native/Tools.CorHelper/CorHelper-vs2019.vcxproj
@@ -62,7 +62,7 @@
Disabled
- ..\Tools.MetaDataProcessor;..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
+ ..\Tools.MetaDataProcessor;..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
true
EnableFastChecks
@@ -80,7 +80,7 @@
MaxSpeed
OnlyExplicitInline
true
- ..\Tools.MetaDataProcessor;..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
+ ..\Tools.MetaDataProcessor;..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
true
MultiThreadedDLL
diff --git a/source/Tools.CorHelper/CorHelper-vs2019.vcxproj.filters b/source/native/Tools.CorHelper/CorHelper-vs2019.vcxproj.filters
similarity index 100%
rename from source/Tools.CorHelper/CorHelper-vs2019.vcxproj.filters
rename to source/native/Tools.CorHelper/CorHelper-vs2019.vcxproj.filters
diff --git a/source/Tools.CorHelper/CorHelper.vcproj b/source/native/Tools.CorHelper/CorHelper.vcproj
similarity index 100%
rename from source/Tools.CorHelper/CorHelper.vcproj
rename to source/native/Tools.CorHelper/CorHelper.vcproj
diff --git a/source/Tools.CorHelper/CorHelper.vcxproj b/source/native/Tools.CorHelper/CorHelper.vcxproj
similarity index 90%
rename from source/Tools.CorHelper/CorHelper.vcxproj
rename to source/native/Tools.CorHelper/CorHelper.vcxproj
index 4c1e41f8..60676b47 100644
--- a/source/Tools.CorHelper/CorHelper.vcxproj
+++ b/source/native/Tools.CorHelper/CorHelper.vcxproj
@@ -62,7 +62,7 @@
Disabled
- ..\Tools.MetaDataProcessor;..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
+ ..\Tools.MetaDataProcessor;..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
true
EnableFastChecks
@@ -80,7 +80,7 @@
MaxSpeed
OnlyExplicitInline
true
- ..\Tools.MetaDataProcessor;..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
+ ..\Tools.MetaDataProcessor;..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
true
MultiThreadedDLL
diff --git a/source/Tools.CorHelper/CorHelper.vcxproj.filters b/source/native/Tools.CorHelper/CorHelper.vcxproj.filters
similarity index 100%
rename from source/Tools.CorHelper/CorHelper.vcxproj.filters
rename to source/native/Tools.CorHelper/CorHelper.vcxproj.filters
diff --git a/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.command.1.tlog b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.command.1.tlog
new file mode 100644
index 00000000..5e317af6
Binary files /dev/null and b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.command.1.tlog differ
diff --git a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.read.1.tlog b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.read.1.tlog
similarity index 96%
rename from source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.read.1.tlog
rename to source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.read.1.tlog
index bfd3ebd5..994a84b8 100644
Binary files a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.read.1.tlog and b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.read.1.tlog differ
diff --git a/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.write.1.tlog b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.write.1.tlog
new file mode 100644
index 00000000..b2fdf23f
Binary files /dev/null and b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/CL.write.1.tlog differ
diff --git a/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.read.1.tlog b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.read.1.tlog
new file mode 100644
index 00000000..5f54e52d
Binary files /dev/null and b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.read.1.tlog differ
diff --git a/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.write.1.tlog b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.write.1.tlog
new file mode 100644
index 00000000..60824f5b
Binary files /dev/null and b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib-link.write.1.tlog differ
diff --git a/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib.command.1.tlog b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib.command.1.tlog
new file mode 100644
index 00000000..b7dffefb
Binary files /dev/null and b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Lib.command.1.tlog differ
diff --git a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Tools.Lib.CorHelper.lastbuildstate b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Tools.Lib.CorHelper.lastbuildstate
similarity index 70%
rename from source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Tools.Lib.CorHelper.lastbuildstate
rename to source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Tools.Lib.CorHelper.lastbuildstate
index 34f2059c..d9067f79 100644
--- a/source/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Tools.Lib.CorHelper.lastbuildstate
+++ b/source/native/Tools.CorHelper/Debug/Tools.Li.079E1BC1.tlog/Tools.Lib.CorHelper.lastbuildstate
@@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
-Debug|Win32|E:\GitHub\nf-tool-metadata-processor\source\|
+Debug|Win32|E:\GitHub\nf-tool-metadata-processor\source\native\|
diff --git a/source/native/Tools.CorHelper/Debug/Tools.Lib.CorHelper.idb b/source/native/Tools.CorHelper/Debug/Tools.Lib.CorHelper.idb
new file mode 100644
index 00000000..f17fb8a1
Binary files /dev/null and b/source/native/Tools.CorHelper/Debug/Tools.Lib.CorHelper.idb differ
diff --git a/source/Tools.CorHelper/corhlpr.cpp b/source/native/Tools.CorHelper/corhlpr.cpp
similarity index 100%
rename from source/Tools.CorHelper/corhlpr.cpp
rename to source/native/Tools.CorHelper/corhlpr.cpp
diff --git a/source/Tools.CorHelper/dotNetMF.proj b/source/native/Tools.CorHelper/dotNetMF.proj
similarity index 100%
rename from source/Tools.CorHelper/dotNetMF.proj
rename to source/native/Tools.CorHelper/dotNetMF.proj
diff --git a/source/Tools.CorHelper/stdafx.cpp b/source/native/Tools.CorHelper/stdafx.cpp
similarity index 100%
rename from source/Tools.CorHelper/stdafx.cpp
rename to source/native/Tools.CorHelper/stdafx.cpp
diff --git a/source/Tools.CorHelper/stdafx.h b/source/native/Tools.CorHelper/stdafx.h
similarity index 100%
rename from source/Tools.CorHelper/stdafx.h
rename to source/native/Tools.CorHelper/stdafx.h
diff --git a/source/Tools.MetaDataProcessor/AssemblyParser.h b/source/native/Tools.MetaDataProcessor/AssemblyParser.h
similarity index 99%
rename from source/Tools.MetaDataProcessor/AssemblyParser.h
rename to source/native/Tools.MetaDataProcessor/AssemblyParser.h
index 93620f9c..01f88596 100644
--- a/source/Tools.MetaDataProcessor/AssemblyParser.h
+++ b/source/native/Tools.MetaDataProcessor/AssemblyParser.h
@@ -418,6 +418,7 @@ namespace MetaData
FieldDef(Parser* holder);
bool SetValue(const void* ptr, int len);
+ bool SetEmptyString(const void* ptr);
};
struct MethodDef
diff --git a/source/Tools.MetaDataProcessor/AssemblyReparser.h b/source/native/Tools.MetaDataProcessor/AssemblyReparser.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/AssemblyReparser.h
rename to source/native/Tools.MetaDataProcessor/AssemblyReparser.h
diff --git a/source/Tools.MetaDataProcessor/HAL_Windows.h b/source/native/Tools.MetaDataProcessor/HAL_Windows.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/HAL_Windows.h
rename to source/native/Tools.MetaDataProcessor/HAL_Windows.h
diff --git a/source/Tools.MetaDataProcessor/Info_Win32.cpp b/source/native/Tools.MetaDataProcessor/Info_Win32.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/Info_Win32.cpp
rename to source/native/Tools.MetaDataProcessor/Info_Win32.cpp
diff --git a/source/Tools.MetaDataProcessor/ManagedElementTypes_Win32.cpp b/source/native/Tools.MetaDataProcessor/ManagedElementTypes_Win32.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/ManagedElementTypes_Win32.cpp
rename to source/native/Tools.MetaDataProcessor/ManagedElementTypes_Win32.cpp
diff --git a/source/Tools.MetaDataProcessor/ManagedElementTypes_Win32.h b/source/native/Tools.MetaDataProcessor/ManagedElementTypes_Win32.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/ManagedElementTypes_Win32.h
rename to source/native/Tools.MetaDataProcessor/ManagedElementTypes_Win32.h
diff --git a/source/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj b/source/native/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj
similarity index 77%
rename from source/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj
rename to source/native/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj
index 61f3f668..4b2144ce 100644
--- a/source/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj
+++ b/source/native/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj
@@ -99,7 +99,7 @@
Level3
Disabled
WIN32;METADATAPROCESSOR;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;..\..\nf-interpreter\src\CLR\Core;..\..\nf-interpreter\src\CLR\Helpers\Base64;%(AdditionalIncludeDirectories)
+ ..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;..\nf-interpreter\src\CLR\Core;..\nf-interpreter\src\CLR\Helpers\Base64;%(AdditionalIncludeDirectories)
MultiThreadedDebugDLL
@@ -113,7 +113,7 @@
Level3
Disabled
_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;..\..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
+ ..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
Console
@@ -127,7 +127,7 @@
false
true
WIN32;METADATAPROCESSOR;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;..\..\nf-interpreter\src\CLR\Core;..\..\nf-interpreter\src\CLR\Helpers\Base64;%(AdditionalIncludeDirectories)
+ ..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;..\nf-interpreter\src\CLR\Core;..\nf-interpreter\src\CLR\Helpers\Base64;%(AdditionalIncludeDirectories)
MultiThreadedDLL
@@ -146,7 +146,7 @@
true
true
NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;..\..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
+ ..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
Console
@@ -168,15 +168,15 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -196,28 +196,28 @@
-
+
{89cf8bdb-9c8a-4d18-bc3e-4312c5bd34b1}
-
+
{5d50772e-dac8-407d-972f-37deb4450b72}
-
+
{d32ee397-7e49-452d-ac95-afcb3c962e3d}
-
+
{ed4c887a-ec09-465b-b5d9-075450adc52d}
-
+
{16bf6131-a3b8-4b97-b867-e45669fb48bd}
-
+
{58e950cc-2ff6-423c-b006-a70a19272f20}
-
+
{a5e9ae41-f4fa-40ce-ad82-a7861eba007b}
-
+
{131001e3-0201-451f-a87b-951d1c5c3eee}
diff --git a/source/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj.filters b/source/native/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj.filters
similarity index 80%
rename from source/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj.filters
rename to source/native/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj.filters
index 679f8d9e..cc8cdd93 100644
--- a/source/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj.filters
+++ b/source/native/Tools.MetaDataProcessor/MetaDataProcessor-vs2019.vcxproj.filters
@@ -56,7 +56,7 @@
Source Files
-
+
Source Files
@@ -65,16 +65,16 @@
Source Files
-
+
Source Files
Source Files
-
+
Source Files
-
+
Source Files
@@ -89,16 +89,16 @@
Source Files
-
+
Source Files
-
+
Source Files
-
+
Source Files
-
+
Source Files
@@ -107,7 +107,7 @@
Source Files
-
+
Source Files
diff --git a/source/Tools.MetaDataProcessor/MetaDataProcessor.cpp b/source/native/Tools.MetaDataProcessor/MetaDataProcessor.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/MetaDataProcessor.cpp
rename to source/native/Tools.MetaDataProcessor/MetaDataProcessor.cpp
diff --git a/source/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj b/source/native/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj
similarity index 79%
rename from source/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj
rename to source/native/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj
index 7a508e8c..1f8037b6 100644
--- a/source/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj
+++ b/source/native/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj
@@ -95,7 +95,7 @@
Level3
Disabled
WIN32;METADATAPROCESSOR;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;..\..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
+ ..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
MultiThreadedDebugDLL
@@ -109,7 +109,7 @@
Level3
Disabled
_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;..\..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
+ ..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
Console
@@ -123,7 +123,7 @@
false
true
WIN32;METADATAPROCESSOR;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;..\..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
+ ..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
MultiThreadedDLL
@@ -142,7 +142,7 @@
true
true
NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;..\..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
+ ..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;..\nf-interpreter\src\CLR\Core;%(AdditionalIncludeDirectories)
Console
@@ -164,15 +164,15 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -192,28 +192,28 @@
-
+
{89cf8bdb-9c8a-4d18-bc3e-4312c5bd34b1}
-
+
{5d50772e-dac8-407d-972f-37deb4450b72}
-
+
{d32ee397-7e49-452d-ac95-afcb3c962e3d}
-
+
{ed4c887a-ec09-465b-b5d9-075450adc52d}
-
+
{16bf6131-a3b8-4b97-b867-e45669fb48bd}
-
+
{58e950cc-2ff6-423c-b006-a70a19272f20}
-
+
{a5e9ae41-f4fa-40ce-ad82-a7861eba007b}
-
+
{131001e3-0201-451f-a87b-951d1c5c3eee}
diff --git a/source/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj.filters b/source/native/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj.filters
similarity index 80%
rename from source/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj.filters
rename to source/native/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj.filters
index 6593fece..3ab4e416 100644
--- a/source/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj.filters
+++ b/source/native/Tools.MetaDataProcessor/MetaDataProcessor.vcxproj.filters
@@ -56,7 +56,7 @@
Source Files
-
+
Source Files
@@ -65,16 +65,16 @@
Source Files
-
+
Source Files
Source Files
-
+
Source Files
-
+
Source Files
@@ -89,16 +89,16 @@
Source Files
-
+
Source Files
-
+
Source Files
-
+
Source Files
-
+
Source Files
@@ -107,7 +107,7 @@
Source Files
-
+
Source Files
diff --git a/source/Tools.MetaDataProcessor/ParseOptions_Win32.cpp b/source/native/Tools.MetaDataProcessor/ParseOptions_Win32.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/ParseOptions_Win32.cpp
rename to source/native/Tools.MetaDataProcessor/ParseOptions_Win32.cpp
diff --git a/source/Tools.MetaDataProcessor/StubWinHal.cpp b/source/native/Tools.MetaDataProcessor/StubWinHal.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/StubWinHal.cpp
rename to source/native/Tools.MetaDataProcessor/StubWinHal.cpp
diff --git a/source/Tools.MetaDataProcessor/Time_stubs.cpp b/source/native/Tools.MetaDataProcessor/Time_stubs.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/Time_stubs.cpp
rename to source/native/Tools.MetaDataProcessor/Time_stubs.cpp
diff --git a/source/Tools.MetaDataProcessor/Various.cpp b/source/native/Tools.MetaDataProcessor/Various.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/Various.cpp
rename to source/native/Tools.MetaDataProcessor/Various.cpp
diff --git a/source/Tools.MetaDataProcessor/WatchAssemblyBuilder.h b/source/native/Tools.MetaDataProcessor/WatchAssemblyBuilder.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/WatchAssemblyBuilder.h
rename to source/native/Tools.MetaDataProcessor/WatchAssemblyBuilder.h
diff --git a/source/Tools.MetaDataProcessor/XmlUtil.cpp b/source/native/Tools.MetaDataProcessor/XmlUtil.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/XmlUtil.cpp
rename to source/native/Tools.MetaDataProcessor/XmlUtil.cpp
diff --git a/source/Tools.MetaDataProcessor/cor.h b/source/native/Tools.MetaDataProcessor/cor.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/cor.h
rename to source/native/Tools.MetaDataProcessor/cor.h
diff --git a/source/Tools.MetaDataProcessor/corerror.h b/source/native/Tools.MetaDataProcessor/corerror.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/corerror.h
rename to source/native/Tools.MetaDataProcessor/corerror.h
diff --git a/source/Tools.MetaDataProcessor/corhdr.h b/source/native/Tools.MetaDataProcessor/corhdr.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/corhdr.h
rename to source/native/Tools.MetaDataProcessor/corhdr.h
diff --git a/source/Tools.MetaDataProcessor/corhlpr.h b/source/native/Tools.MetaDataProcessor/corhlpr.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/corhlpr.h
rename to source/native/Tools.MetaDataProcessor/corhlpr.h
diff --git a/source/Tools.MetaDataProcessor/corlib_native.cpp b/source/native/Tools.MetaDataProcessor/corlib_native.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/corlib_native.cpp
rename to source/native/Tools.MetaDataProcessor/corlib_native.cpp
diff --git a/source/Tools.MetaDataProcessor/corsym.h b/source/native/Tools.MetaDataProcessor/corsym.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/corsym.h
rename to source/native/Tools.MetaDataProcessor/corsym.h
diff --git a/source/Tools.MetaDataProcessor/minheap.cpp b/source/native/Tools.MetaDataProcessor/minheap.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/minheap.cpp
rename to source/native/Tools.MetaDataProcessor/minheap.cpp
diff --git a/source/Tools.MetaDataProcessor/mintime.cpp b/source/native/Tools.MetaDataProcessor/mintime.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/mintime.cpp
rename to source/native/Tools.MetaDataProcessor/mintime.cpp
diff --git a/source/Tools.MetaDataProcessor/nanoFramework.Tools.MetaDataProcessor.sln b/source/native/Tools.MetaDataProcessor/nanoFramework.Tools.MetaDataProcessor.sln
similarity index 100%
rename from source/Tools.MetaDataProcessor/nanoFramework.Tools.MetaDataProcessor.sln
rename to source/native/Tools.MetaDataProcessor/nanoFramework.Tools.MetaDataProcessor.sln
diff --git a/source/native/Tools.MetaDataProcessor/nanoFramework.Tools.MetaDataProcessor.targets b/source/native/Tools.MetaDataProcessor/nanoFramework.Tools.MetaDataProcessor.targets
new file mode 100644
index 00000000..ebda3f9c
--- /dev/null
+++ b/source/native/Tools.MetaDataProcessor/nanoFramework.Tools.MetaDataProcessor.targets
@@ -0,0 +1,10 @@
+
+
+
+ MSBuild
+ nanoFramework\v1.0\
+ Always
+ true
+
+
+
diff --git a/source/Tools.MetaDataProcessor/nanoHAL_Watchdog_stubs.cpp b/source/native/Tools.MetaDataProcessor/nanoHAL_Watchdog_stubs.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/nanoHAL_Watchdog_stubs.cpp
rename to source/native/Tools.MetaDataProcessor/nanoHAL_Watchdog_stubs.cpp
diff --git a/source/Tools.MetaDataProcessor/package.nuspec b/source/native/Tools.MetaDataProcessor/package.nuspec
similarity index 100%
rename from source/Tools.MetaDataProcessor/package.nuspec
rename to source/native/Tools.MetaDataProcessor/package.nuspec
diff --git a/source/Tools.MetaDataProcessor/packages.config b/source/native/Tools.MetaDataProcessor/packages.config
similarity index 100%
rename from source/Tools.MetaDataProcessor/packages.config
rename to source/native/Tools.MetaDataProcessor/packages.config
diff --git a/source/Tools.MetaDataProcessor/stdafx.cpp b/source/native/Tools.MetaDataProcessor/stdafx.cpp
similarity index 100%
rename from source/Tools.MetaDataProcessor/stdafx.cpp
rename to source/native/Tools.MetaDataProcessor/stdafx.cpp
diff --git a/source/Tools.MetaDataProcessor/stdafx.h b/source/native/Tools.MetaDataProcessor/stdafx.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/stdafx.h
rename to source/native/Tools.MetaDataProcessor/stdafx.h
diff --git a/source/Tools.MetaDataProcessor/targetver.h b/source/native/Tools.MetaDataProcessor/targetver.h
similarity index 100%
rename from source/Tools.MetaDataProcessor/targetver.h
rename to source/native/Tools.MetaDataProcessor/targetver.h
diff --git a/source/Tools.Parser/AssemblyParser.cpp b/source/native/Tools.Parser/AssemblyParser.cpp
similarity index 99%
rename from source/Tools.Parser/AssemblyParser.cpp
rename to source/native/Tools.Parser/AssemblyParser.cpp
index 548f6bb5..2e38c873 100644
--- a/source/Tools.Parser/AssemblyParser.cpp
+++ b/source/native/Tools.Parser/AssemblyParser.cpp
@@ -825,6 +825,13 @@ bool MetaData::FieldDef::SetValue( const void* ptr, int len )
return true;
}
+bool MetaData::FieldDef::SetEmptyString(const void* ptr)
+{
+ m_value.resize(0);
+
+ return true;
+}
+
MetaData::MethodDef::MethodDef( Parser* holder ) : m_method(holder), m_vars(holder)
{
m_td = mdTypeDefNil; // mdTypeDef m_td;
@@ -1630,9 +1637,24 @@ HRESULT MetaData::Parser::GetTypeField( mdFieldDef fd )
}
if(pValue)
- {
- _ASSERTE(len > 0);
- db.SetValue( pValue, len );
+ {
+ // only ASSERT for non strings because it's acceptable to have strings with 0 length
+ if (db.m_attr == ELEMENT_TYPE_STRING)
+ {
+ if (len == 0)
+ {
+ db.SetEmptyString(pValue);
+ }
+ else
+ {
+ db.SetValue(pValue, len);
+ }
+ }
+ else
+ {
+ _ASSERTE(len > 0);
+ db.SetValue(pValue, len);
+ }
}
m_mapDef_Field.insert( FieldDefMap::value_type( fd, db ) );
diff --git a/source/Tools.Parser/AssemblyParserDump.cpp b/source/native/Tools.Parser/AssemblyParserDump.cpp
similarity index 100%
rename from source/Tools.Parser/AssemblyParserDump.cpp
rename to source/native/Tools.Parser/AssemblyParserDump.cpp
diff --git a/source/Tools.Parser/AssemblyReparser.cpp b/source/native/Tools.Parser/AssemblyReparser.cpp
similarity index 100%
rename from source/Tools.Parser/AssemblyReparser.cpp
rename to source/native/Tools.Parser/AssemblyReparser.cpp
diff --git a/source/Tools.Parser/ByteCodeParser.cpp b/source/native/Tools.Parser/ByteCodeParser.cpp
similarity index 100%
rename from source/Tools.Parser/ByteCodeParser.cpp
rename to source/native/Tools.Parser/ByteCodeParser.cpp
diff --git a/source/Tools.Parser/ByteCodeParser_Load.cpp b/source/native/Tools.Parser/ByteCodeParser_Load.cpp
similarity index 100%
rename from source/Tools.Parser/ByteCodeParser_Load.cpp
rename to source/native/Tools.Parser/ByteCodeParser_Load.cpp
diff --git a/source/Tools.Parser/ByteCodeParser_Save.cpp b/source/native/Tools.Parser/ByteCodeParser_Save.cpp
similarity index 100%
rename from source/Tools.Parser/ByteCodeParser_Save.cpp
rename to source/native/Tools.Parser/ByteCodeParser_Save.cpp
diff --git a/source/native/Tools.Parser/Debug/Tools.Lib.Parser.idb b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.idb
new file mode 100644
index 00000000..1218f0e3
Binary files /dev/null and b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.idb differ
diff --git a/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.command.1.tlog b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.command.1.tlog
new file mode 100644
index 00000000..bf0e7c27
Binary files /dev/null and b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.command.1.tlog differ
diff --git a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.read.1.tlog b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.read.1.tlog
similarity index 84%
rename from source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.read.1.tlog
rename to source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.read.1.tlog
index bb6c169e..c95bb788 100644
Binary files a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.read.1.tlog and b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.read.1.tlog differ
diff --git a/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.write.1.tlog b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.write.1.tlog
new file mode 100644
index 00000000..e220eaa6
Binary files /dev/null and b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/CL.write.1.tlog differ
diff --git a/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.read.1.tlog b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.read.1.tlog
new file mode 100644
index 00000000..63bac243
Binary files /dev/null and b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.read.1.tlog differ
diff --git a/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.write.1.tlog b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.write.1.tlog
new file mode 100644
index 00000000..28d0cf25
Binary files /dev/null and b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib-link.write.1.tlog differ
diff --git a/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib.command.1.tlog b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib.command.1.tlog
new file mode 100644
index 00000000..0f724b67
Binary files /dev/null and b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Lib.command.1.tlog differ
diff --git a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Tools.Lib.Parser.lastbuildstate b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Tools.Lib.Parser.lastbuildstate
similarity index 70%
rename from source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Tools.Lib.Parser.lastbuildstate
rename to source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Tools.Lib.Parser.lastbuildstate
index 34f2059c..d9067f79 100644
--- a/source/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Tools.Lib.Parser.lastbuildstate
+++ b/source/native/Tools.Parser/Debug/Tools.Lib.Parser.tlog/Tools.Lib.Parser.lastbuildstate
@@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
-Debug|Win32|E:\GitHub\nf-tool-metadata-processor\source\|
+Debug|Win32|E:\GitHub\nf-tool-metadata-processor\source\native\|
diff --git a/source/Tools.Parser/FileStore_Win32.cpp b/source/native/Tools.Parser/FileStore_Win32.cpp
similarity index 100%
rename from source/Tools.Parser/FileStore_Win32.cpp
rename to source/native/Tools.Parser/FileStore_Win32.cpp
diff --git a/source/Tools.Parser/Linker.cpp b/source/native/Tools.Parser/Linker.cpp
similarity index 100%
rename from source/Tools.Parser/Linker.cpp
rename to source/native/Tools.Parser/Linker.cpp
diff --git a/source/Tools.Parser/Parser-vs2019.vcxproj b/source/native/Tools.Parser/Parser-vs2019.vcxproj
similarity index 91%
rename from source/Tools.Parser/Parser-vs2019.vcxproj
rename to source/native/Tools.Parser/Parser-vs2019.vcxproj
index c96e0a27..389c3213 100644
--- a/source/Tools.Parser/Parser-vs2019.vcxproj
+++ b/source/native/Tools.Parser/Parser-vs2019.vcxproj
@@ -58,7 +58,7 @@
Disabled
- ..\Tools.MetaDataProcessor;..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
+ ..\Tools.MetaDataProcessor;..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
true
EnableFastChecks
@@ -76,7 +76,7 @@
MaxSpeed
OnlyExplicitInline
true
- ..\Tools.MetaDataProcessor;..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
+ ..\Tools.MetaDataProcessor;..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
true
MultiThreadedDLL
diff --git a/source/Tools.Parser/Parser-vs2019.vcxproj.filters b/source/native/Tools.Parser/Parser-vs2019.vcxproj.filters
similarity index 100%
rename from source/Tools.Parser/Parser-vs2019.vcxproj.filters
rename to source/native/Tools.Parser/Parser-vs2019.vcxproj.filters
diff --git a/source/Tools.Parser/Parser.vcxproj b/source/native/Tools.Parser/Parser.vcxproj
similarity index 91%
rename from source/Tools.Parser/Parser.vcxproj
rename to source/native/Tools.Parser/Parser.vcxproj
index 66d6f637..2a1e56f5 100644
--- a/source/Tools.Parser/Parser.vcxproj
+++ b/source/native/Tools.Parser/Parser.vcxproj
@@ -58,7 +58,7 @@
Disabled
- ..\Tools.MetaDataProcessor;..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
+ ..\Tools.MetaDataProcessor;..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
true
EnableFastChecks
@@ -76,7 +76,7 @@
MaxSpeed
OnlyExplicitInline
true
- ..\Tools.MetaDataProcessor;..\Tools.Parser;..\..\nf-interpreter\src\CLR\CorLib;..\..\nf-interpreter\targets\os\win32\Include;..\..\nf-interpreter\src\PAL\Include;..\..\nf-interpreter\src\HAL\Include;..\..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
+ ..\Tools.MetaDataProcessor;..\Tools.Parser;..\nf-interpreter\src\CLR\CorLib;..\nf-interpreter\targets\os\win32\Include;..\nf-interpreter\src\PAL\Include;..\nf-interpreter\src\HAL\Include;..\nf-interpreter\src\CLR\Include;%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
true
MultiThreadedDLL
diff --git a/source/Tools.Parser/Parser.vcxproj.filters b/source/native/Tools.Parser/Parser.vcxproj.filters
similarity index 100%
rename from source/Tools.Parser/Parser.vcxproj.filters
rename to source/native/Tools.Parser/Parser.vcxproj.filters
diff --git a/source/Tools.Parser/Support.cpp b/source/native/Tools.Parser/Support.cpp
similarity index 100%
rename from source/Tools.Parser/Support.cpp
rename to source/native/Tools.Parser/Support.cpp
diff --git a/source/Tools.Parser/dotNetMF.proj b/source/native/Tools.Parser/dotNetMF.proj
similarity index 100%
rename from source/Tools.Parser/dotNetMF.proj
rename to source/native/Tools.Parser/dotNetMF.proj
diff --git a/source/Tools.Parser/stdafx.cpp b/source/native/Tools.Parser/stdafx.cpp
similarity index 100%
rename from source/Tools.Parser/stdafx.cpp
rename to source/native/Tools.Parser/stdafx.cpp
diff --git a/source/Tools.Parser/stdafx.h b/source/native/Tools.Parser/stdafx.h
similarity index 100%
rename from source/Tools.Parser/stdafx.h
rename to source/native/Tools.Parser/stdafx.h
diff --git a/source/native/nanoFramework.Tools.MetadataProcessor.sln b/source/native/nanoFramework.Tools.MetadataProcessor.sln
new file mode 100644
index 00000000..c4c770e9
--- /dev/null
+++ b/source/native/nanoFramework.Tools.MetadataProcessor.sln
@@ -0,0 +1,206 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27130.2027
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MetaDataProcessor", "MetaDataProcessor", "{FCCC9596-0809-4BB4-ACC2-3615EEC264C7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "nf-interpreter\src\CLR\Core\Core.vcxproj", "{89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CorLib", "nf-interpreter\src\CLR\CorLib\CorLib.vcxproj", "{58E950CC-2FF6-423C-B006-A70A19272F20}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Diagnostics", "nf-interpreter\src\CLR\Diagnostics\Diagnostics.vcxproj", "{A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tools.Lib.Parser", "Tools.Parser\Parser.vcxproj", "{AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Serialization", "nf-interpreter\src\CLR\Core\Serialization\Serialization.vcxproj", "{16BF6131-A3B8-4B97-B867-E45669FB48BD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RPC", "nf-interpreter\src\CLR\Core\RPC\RPC.vcxproj", "{ED4C887A-EC09-465B-B5D9-075450ADC52D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Messaging", "nf-interpreter\src\CLR\Messaging\Messaging.vcxproj", "{131001E3-0201-451F-A87B-951D1C5C3EEE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WireProtocol", "nf-interpreter\src\CLR\WireProtocol\WireProtocol.vcxproj", "{2337C4A4-3AB4-4014-9C29-9EBE32F4510E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hardware", "nf-interpreter\src\CLR\Core\Hardware\Hardware.vcxproj", "{5D50772E-DAC8-407D-972F-37DEB4450B72}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tools.Lib.CorHelper", "Tools.CorHelper\CorHelper.vcxproj", "{079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InterruptHandler", "nf-interpreter\src\CLR\Core\InterruptHandler\InterruptHandler.vcxproj", "{D32EE397-7E49-452D-AC95-AFCB3C962E3D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tools.MetaDataProcessor", "Tools.MetaDataProcessor\MetaDataProcessor.vcxproj", "{80209A7E-B9F0-4143-BCD1-B1891236A3CF}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|Any CPU.Build.0 = Debug|Win32
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|x64.ActiveCfg = Debug|x64
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|x64.Build.0 = Debug|x64
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|x86.ActiveCfg = Debug|Win32
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Debug|x86.Build.0 = Debug|Win32
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|Any CPU.ActiveCfg = Release|Win32
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|Any CPU.Build.0 = Release|Win32
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|x64.ActiveCfg = Release|x64
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|x64.Build.0 = Release|x64
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|x86.ActiveCfg = Release|Win32
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1}.Release|x86.Build.0 = Release|Win32
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|Any CPU.Build.0 = Debug|Win32
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|x64.ActiveCfg = Debug|x64
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|x64.Build.0 = Debug|x64
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|x86.ActiveCfg = Debug|Win32
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Debug|x86.Build.0 = Debug|Win32
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|Any CPU.ActiveCfg = Release|Win32
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|Any CPU.Build.0 = Release|Win32
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|x64.ActiveCfg = Release|x64
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|x64.Build.0 = Release|x64
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|x86.ActiveCfg = Release|Win32
+ {58E950CC-2FF6-423C-B006-A70A19272F20}.Release|x86.Build.0 = Release|Win32
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|Any CPU.Build.0 = Debug|Win32
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|x64.ActiveCfg = Debug|x64
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|x64.Build.0 = Debug|x64
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|x86.ActiveCfg = Debug|Win32
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Debug|x86.Build.0 = Debug|Win32
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|Any CPU.ActiveCfg = Release|Win32
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|Any CPU.Build.0 = Release|Win32
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|x64.ActiveCfg = Release|x64
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|x64.Build.0 = Release|x64
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|x86.ActiveCfg = Release|Win32
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B}.Release|x86.Build.0 = Release|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|Any CPU.Build.0 = Debug|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|x64.ActiveCfg = Debug|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|x64.Build.0 = Debug|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|x86.ActiveCfg = Debug|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Debug|x86.Build.0 = Debug|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|Any CPU.ActiveCfg = Release|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|Any CPU.Build.0 = Release|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|x64.ActiveCfg = Release|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|x64.Build.0 = Release|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|x86.ActiveCfg = Release|Win32
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC}.Release|x86.Build.0 = Release|Win32
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|Any CPU.Build.0 = Debug|Win32
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|x64.ActiveCfg = Debug|x64
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|x64.Build.0 = Debug|x64
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|x86.ActiveCfg = Debug|Win32
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Debug|x86.Build.0 = Debug|Win32
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|Any CPU.ActiveCfg = Release|Win32
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|Any CPU.Build.0 = Release|Win32
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|x64.ActiveCfg = Release|x64
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|x64.Build.0 = Release|x64
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|x86.ActiveCfg = Release|Win32
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD}.Release|x86.Build.0 = Release|Win32
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|Any CPU.Build.0 = Debug|Win32
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|x64.ActiveCfg = Debug|x64
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|x64.Build.0 = Debug|x64
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|x86.ActiveCfg = Debug|Win32
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Debug|x86.Build.0 = Debug|Win32
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|Any CPU.ActiveCfg = Release|Win32
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|Any CPU.Build.0 = Release|Win32
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|x64.ActiveCfg = Release|x64
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|x64.Build.0 = Release|x64
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|x86.ActiveCfg = Release|Win32
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D}.Release|x86.Build.0 = Release|Win32
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|Any CPU.Build.0 = Debug|Win32
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|x64.ActiveCfg = Debug|x64
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|x64.Build.0 = Debug|x64
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|x86.ActiveCfg = Debug|Win32
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Debug|x86.Build.0 = Debug|Win32
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|Any CPU.ActiveCfg = Release|Win32
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|Any CPU.Build.0 = Release|Win32
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|x64.ActiveCfg = Release|x64
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|x64.Build.0 = Release|x64
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|x86.ActiveCfg = Release|Win32
+ {131001E3-0201-451F-A87B-951D1C5C3EEE}.Release|x86.Build.0 = Release|Win32
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|Any CPU.Build.0 = Debug|Win32
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|x64.ActiveCfg = Debug|x64
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|x64.Build.0 = Debug|x64
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|x86.ActiveCfg = Debug|Win32
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Debug|x86.Build.0 = Debug|Win32
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|Any CPU.ActiveCfg = Release|Win32
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|Any CPU.Build.0 = Release|Win32
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|x64.ActiveCfg = Release|x64
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|x64.Build.0 = Release|x64
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|x86.ActiveCfg = Release|Win32
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E}.Release|x86.Build.0 = Release|Win32
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|Any CPU.Build.0 = Debug|Win32
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|x64.ActiveCfg = Debug|x64
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|x64.Build.0 = Debug|x64
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|x86.ActiveCfg = Debug|Win32
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Debug|x86.Build.0 = Debug|Win32
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|Any CPU.ActiveCfg = Release|Win32
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|Any CPU.Build.0 = Release|Win32
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|x64.ActiveCfg = Release|x64
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|x64.Build.0 = Release|x64
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|x86.ActiveCfg = Release|Win32
+ {5D50772E-DAC8-407D-972F-37DEB4450B72}.Release|x86.Build.0 = Release|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|Any CPU.Build.0 = Debug|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|x64.ActiveCfg = Debug|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|x64.Build.0 = Debug|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|x86.ActiveCfg = Debug|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Debug|x86.Build.0 = Debug|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|Any CPU.ActiveCfg = Release|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|Any CPU.Build.0 = Release|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|x64.ActiveCfg = Release|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|x64.Build.0 = Release|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|x86.ActiveCfg = Release|Win32
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11}.Release|x86.Build.0 = Release|Win32
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|Any CPU.Build.0 = Debug|Win32
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|x64.ActiveCfg = Debug|x64
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|x64.Build.0 = Debug|x64
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|x86.ActiveCfg = Debug|Win32
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Debug|x86.Build.0 = Debug|Win32
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|Any CPU.ActiveCfg = Release|Win32
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|Any CPU.Build.0 = Release|Win32
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|x64.ActiveCfg = Release|x64
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|x64.Build.0 = Release|x64
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|x86.ActiveCfg = Release|Win32
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D}.Release|x86.Build.0 = Release|Win32
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|Any CPU.Build.0 = Debug|Win32
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|x64.ActiveCfg = Debug|x64
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|x64.Build.0 = Debug|x64
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|x86.ActiveCfg = Debug|Win32
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Debug|x86.Build.0 = Debug|Win32
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|Any CPU.ActiveCfg = Release|Win32
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|Any CPU.Build.0 = Release|Win32
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|x64.ActiveCfg = Release|x64
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|x64.Build.0 = Release|x64
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|x86.ActiveCfg = Release|Win32
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {89CF8BDB-9C8A-4D18-BC3E-4312C5BD34B1} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {58E950CC-2FF6-423C-B006-A70A19272F20} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {A5E9AE41-F4FA-40CE-AD82-A7861EBA007B} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {AB1ED6AC-5C7F-49CD-A84B-4B7362D355BC} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {16BF6131-A3B8-4B97-B867-E45669FB48BD} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {ED4C887A-EC09-465B-B5D9-075450ADC52D} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {131001E3-0201-451F-A87B-951D1C5C3EEE} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {2337C4A4-3AB4-4014-9C29-9EBE32F4510E} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {5D50772E-DAC8-407D-972F-37DEB4450B72} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {079E1BC1-3B21-46E8-B1BA-AEDB68CCDC11} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {D32EE397-7E49-452D-AC95-AFCB3C962E3D} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ {80209A7E-B9F0-4143-BCD1-B1891236A3CF} = {FCCC9596-0809-4BB4-ACC2-3615EEC264C7}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {5DF99A8C-CA3C-451A-ABC1-4D862154708B}
+ EndGlobalSection
+EndGlobal
diff --git a/source/native/nf-interpreter/.github/FUNDING.yml b/source/native/nf-interpreter/.github/FUNDING.yml
new file mode 100644
index 00000000..d2b838f9
--- /dev/null
+++ b/source/native/nf-interpreter/.github/FUNDING.yml
@@ -0,0 +1,2 @@
+#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+open_collective: nanoframework
diff --git a/source/native/nf-interpreter/.github/ISSUE_TEMPLATE.md b/source/native/nf-interpreter/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 00000000..ce54f609
--- /dev/null
+++ b/source/native/nf-interpreter/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,4 @@
+# Please **DO NOT** open issues in this repository.
+
+
+We are now using the Home repository for centralized issue management.
diff --git a/source/native/nf-interpreter/.github/PULL_REQUEST_TEMPLATE.md b/source/native/nf-interpreter/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 00000000..0f768fce
--- /dev/null
+++ b/source/native/nf-interpreter/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,36 @@
+
+
+## Description
+
+
+## Motivation and Context
+
+
+- Fixes/Closes/Resolves nanoFramework/Home#NNNN
+
+## How Has This Been Tested?
+
+
+
+
+## Screenshots
+
+## Types of changes
+
+- [ ] Improvement (non-breaking change that improves a feature, code or algorithm)
+- [ ] Bug fix (non-breaking change which fixes an issue)
+- [ ] New feature (non-breaking change which adds functionality)
+- [ ] Breaking change (fix or feature that would cause existing functionality to change)
+
+## Checklist:
+
+
+- [ ] My code follows the code style of this project.
+- [ ] My change requires a change to the documentation.
+- [ ] I have updated the documentation accordingly.
+- [ ] I have read the **CONTRIBUTING** document.
+- [ ] I have added tests to cover my changes.
+- [ ] All new and existing tests passed.
+
+
+Signed-off-by: GITHUB_USER
diff --git a/source/native/nf-interpreter/.github/stale.yml b/source/native/nf-interpreter/.github/stale.yml
new file mode 100644
index 00000000..8cf7da36
--- /dev/null
+++ b/source/native/nf-interpreter/.github/stale.yml
@@ -0,0 +1,19 @@
+# Number of days of inactivity before an issue becomes stale
+daysUntilStale: 60
+
+# Number of days of inactivity before a stale issue is closed
+daysUntilClose: 7
+
+# Issues with these labels will never be considered stale
+exemptLabels:
+ - :pushpin: pinned
+ - security
+
+# Label to use when marking an issue as stale
+staleLabel: stale
+
+# Comment to post when marking an issue as stale. Set to `false` to disable
+markComment: >
+ This issue has been automatically marked as stale because it has not had
+ recent activity. It will be closed if no further activity occurs. Thank you
+ for your contributions.
diff --git a/source/native/nf-interpreter/.github_changelog_generator b/source/native/nf-interpreter/.github_changelog_generator
new file mode 100644
index 00000000..f39e1766
--- /dev/null
+++ b/source/native/nf-interpreter/.github_changelog_generator
@@ -0,0 +1,14 @@
+user=nanoframework
+project=nf-interpreter
+issues=true
+add_issues_wo_labels=false
+add_pr_wo_labels=false
+add_issues_wo_labels=false
+filter_issues_by_milestone=false
+exclude_labels=Area: Config-and-Build,Area: Infrastructure-and-Organization,reverted
+enhancement_labels=Type: enhancement
+bug_labels=Type: bug
+merge_prefix=**Documentation and other chores:**
+unreleased_label=**Changes available only in 'Preview' images:**
+issue_line_labels=Area: ESP32,Area: STM32-ChibiOS,Area: WIN32,Area: Interpreter,Area: Common libs,Breaking-Change,documentation
+author=false
diff --git a/source/native/nf-interpreter/.gitignore b/source/native/nf-interpreter/.gitignore
new file mode 100644
index 00000000..f279299b
--- /dev/null
+++ b/source/native/nf-interpreter/.gitignore
@@ -0,0 +1,63 @@
+# ignore all ZIP files
+*.zip
+/zips/
+
+# ignore build folder
+/build/
+/build/.gitkeep
+
+# ignore cmake-variants file (will change frequently per user/board setup, use should derive content from cmake-variants.TEMPLATE.json)
+cmake-variants.json
+
+# ignore any content inside the Interop assemblies folder
+InteropAssemblies/*
+!InteropAssemblies/CLR_RT_InteropAssembliesTable.cpp.in
+!InteropAssemblies/README.md
+
+# Visual Studio Code
+# ignore C/C++ launch file (will change frequently per user/board setup, use should derive content from launch.TEMPLATE.json)
+.vscode/launch.json
+.vscode/.cmaketools.json
+.vscode/settings.json
+.vscode/tasks.json
+.vscode/extensions.json
+.vscode/c_cpp_properties.json
+.vscode/cmake-kits.json
+.vscode/ipch
+
+# ignore CMake modules for Interop assemblies
+CMake/Modules/FindINTEROP*.cmake
+
+# Visual Studio
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.suo
+*.user
+
+# Build results
+[Dd]ebug/
+[Rr]elease/
+[Rr]eleases/
+[Bb]in/
+[Oo]bj/
+
+# Visual Studio cache/options directory contents but not the example launch.vs.json
+!.vs/
+.vs/*
+!.vs/launch.vs.SAMPLE.json
+!.vs/tasks.vs.SAMPLE.json
+**/ipch/*
+
+# Visual C++ cache files
+*.VC.db
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
diff --git a/source/native/nf-interpreter/.gitmodules b/source/native/nf-interpreter/.gitmodules
new file mode 100644
index 00000000..c8fe6c8e
--- /dev/null
+++ b/source/native/nf-interpreter/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "targets-community"]
+ path = targets-community
+ url = https://github.com/nanoframework/nf-Community-Targets
diff --git a/source/native/nf-interpreter/.vs/launch.vs.SAMPLE.json b/source/native/nf-interpreter/.vs/launch.vs.SAMPLE.json
new file mode 100644
index 00000000..c945015d
--- /dev/null
+++ b/source/native/nf-interpreter/.vs/launch.vs.SAMPLE.json
@@ -0,0 +1,90 @@
+{
+ "version": "0.2.1",
+ "defaults": {},
+ "configurations": [
+ {
+ "type": "cppdbg",
+ "name": "ESP32 nanoCLR - Segger JLink",
+ "project": "Build/ESP32/nanoCLR.elf",
+ "cwd": "${workspaceRoot}",
+ "program": "Build/ESP32/nanoCLR.elf",
+ "MIMode": "gdb",
+ "stopAtEntry": false,
+ "externalConsole": true,
+ "miDebuggerPath": "C:/Esp32_Tools/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe",
+ "setupCommands": [
+ {
+ "text": "set logging on"
+ },
+ {
+ "text": "!${workspaceRoot}/startocd.bat ESP32_JLINK"
+ },
+ {
+ "text": "target extended-remote localhost:3333"
+ },
+ {
+ "text": "-file-exec-and-symbols C:/usr/src/NanoFramework/nf-interpreter/build/ESP32/nanoCLR.elf"
+ },
+ {
+ "text": "set remote hardware-watchpoint-limit 2"
+ },
+ {
+ "text": "monitor reset halt"
+ },
+ {
+ "text": "flushregs"
+ },
+ {
+ "text": "thb app_main"
+ }
+ ],
+ "launchCompleteCommand": "None",
+ "serverStarted": "Info : .*Tensilica.*0x1.",
+ "filterStderr": true,
+ "filterStdout": true
+ },
+ {
+ "type": "cppdbg",
+ "name": "STM769IDiscovery nanobooter.elf",
+ "project": "Build\\STM769IDiscovery\\nanobooter.elf",
+ "cwd": "${workspaceRoot}",
+ "program": "${workspaceRoot}\\BUILD\\STM769IDiscovery\\nanobooter.elf",
+ "MIMode": "gdb",
+ "externalConsole": true,
+ "miDebuggerPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Linux\\gcc_arm\\bin\\arm-none-eabi-gdb.exe",
+ "setupCommands": [
+ {
+ "text": "-environment-cd ${workspaceRoot}\\Build"
+ },
+ {
+ "text": "!${workspaceRoot}/startocd.bat STM32_STLINK"
+ },
+ {
+ "text": "target extended-remote localhost:3333"
+ },
+ {
+ "text": "-file-exec-and-symbols C:/usr/src/NanoFramework/nf-interpreter/build/STM769IDiscovery/nanobooter.elf"
+ },
+ {
+ "text": "-enable-pretty-printing",
+ "ignoreFailures": true
+ },
+ {
+ "text": "monitor reset_config none separate"
+ },
+ {
+ "text": "monitor reset halt"
+ }
+ ],
+ "serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
+ "filterStderr": true,
+ "filterStdout": true
+ },
+ {
+ "type": "default",
+ "project": "CMakeLists.txt",
+ "projectTarget": "nanoCLR.elf",
+ "name": "nanoCLR.elf"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/source/native/nf-interpreter/.vs/tasks.vs.SAMPLE.json b/source/native/nf-interpreter/.vs/tasks.vs.SAMPLE.json
new file mode 100644
index 00000000..8f5031ca
--- /dev/null
+++ b/source/native/nf-interpreter/.vs/tasks.vs.SAMPLE.json
@@ -0,0 +1,76 @@
+{
+ "version": "0.2.1",
+ "outDir": "Build\\${cpp.activeConfiguration}",
+ "port": "\"COM3\"",
+ "esptool": "python ${env.ESP32_IDF_PATH}/components/esptool_py/esptool/esptool.py",
+ "comment": "This is a comment",
+ "tasks": [
+ {
+ "taskLabel": "task-CMakeLists",
+ "appliesTo": "CMakeLists.txt",
+ "type": "launch"
+ },
+ {
+ "taskLabel": "task-nf-interpreter",
+ "appliesTo": "/",
+ "type": "launch"
+ },
+ {
+ "taskLabel": "Print Output Directory",
+ "appliesTo": "*",
+ "type": "default",
+ "command": "${env.COMSPEC}",
+ "args": [
+ "echo Output Directory: ${outDir} "
+ ]
+ },
+ {
+ "taskLabel": "Erase Flash ESP32 on port ${port}",
+ "appliesTo": "*",
+ "type": "default",
+ "command": "${env.COMSPEC}",
+ "args": [
+ "start \"Erasing Flash ESP32 on ${port}\" /wait runcmd -5",
+ "${esptool} --chip esp32 --port ${port} --baud 115200 --before \"default_reset\" --after \"hard_reset\" erase_flash"
+ ]
+ },
+ {
+ "taskLabel": "Flash nanoCLR ESP32 on port ${port}",
+ "appliesTo": "*",
+ "type": "default",
+ "command": "${env.COMSPEC}",
+ "args": [
+ "start \"ESP32 - Flashing nanoCLR ESP32 on port ${port}\" /wait runcmd -5",
+ "${esptool} --chip esp32 --port ${port} --baud 921600 --before \"default_reset\" --after \"hard_reset\" write_flash -z --flash_mode \"dio\" --flash_freq \"40m\" --flash_size detect 0x1000 ${env.ESP32_LIBS_PATH}/bootloader.bin 0x10000 ${outDir}/nanoCLR.bin 0x8000 ${outDir}/partitions_4mb.bin"
+ ]
+ },
+ {
+ "taskLabel": "Erase Flash ESP32 port ${port} (Working auto-program)",
+ "appliesTo": "*",
+ "type": "default",
+ "command": "${env.COMSPEC}",
+ "args": [
+ "${esptool} --chip esp32 --port ${port} --baud 921600 --before \"default_reset\" --after \"hard_reset\" erase_flash"
+ ]
+ },
+ {
+ "taskLabel": "task-GetShortPath",
+ "appliesTo": "GetShortPath.bat",
+ "type": "launch"
+ },
+ {
+ "taskName": "task-README",
+ "appliesTo": "README.md",
+ "type": "launch"
+ },
+ {
+ "taskName": "task-SetNFRoot",
+ "appliesTo": "SetNFRoot.bat",
+ "type": "default",
+ "command": "${env.COMSPEC}",
+ "args": [
+ "SetNFRoot.bat"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/source/native/nf-interpreter/.vscode/cmake-kits.TEMPLATE-ESP32.json b/source/native/nf-interpreter/.vscode/cmake-kits.TEMPLATE-ESP32.json
new file mode 100644
index 00000000..cbcba892
--- /dev/null
+++ b/source/native/nf-interpreter/.vscode/cmake-kits.TEMPLATE-ESP32.json
@@ -0,0 +1,6 @@
+[
+ {
+ "name": "ESP32 Tools",
+ "toolchainFile": "CMake/toolchain.FreeRtos.ESP32.GCC.cmake"
+ }
+]
\ No newline at end of file
diff --git a/source/native/nf-interpreter/.vscode/launch.TEMPLATE-ESP32.json b/source/native/nf-interpreter/.vscode/launch.TEMPLATE-ESP32.json
new file mode 100644
index 00000000..c5a8ed25
--- /dev/null
+++ b/source/native/nf-interpreter/.vscode/launch.TEMPLATE-ESP32.json
@@ -0,0 +1,76 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "ESP32 nanoCLR - OLimex OCD-H",
+ "type": "cppdbg",
+ "request": "launch",
+ "MIMode": "gdb",
+ "miDebuggerPath": "/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe",
+ "stopAtEntry":true,
+ "program": "/nanoCLR.elf",
+
+ "setupCommands": [
+ {"description":"" , "text" : "set logging on"},
+ {"description":"" , "text" : "target extended-remote localhost:3333"},
+ {"description":"" , "text" : "file /nanoCLR.elf"},
+ {"description":"" , "text" : "monitor reset halt"},
+ {"description":"" , "text" : "thb app_main"},
+ {"description":"" , "text" : "x $a1=0"}
+ ],
+
+ "launchCompleteCommand": "exec-run",
+ "debugServerPath": "/bin/openocd.exe",
+ "debugServerArgs": "-s \"/share/openocd/scripts/\" -f interface/ftdi/olimex-arm-usb-ocd-h.cfg -f target/esp32.cfg -c \"adapter_khz 3000\" " ,
+ "serverStarted": "Info : .*Tensilica.*0x1.",
+ "filterStderr": true,
+ "externalConsole": true,
+ "cwd": "${cwd}",
+
+ "logging": {
+ "trace": true,
+ "traceResponse": true,
+ "engineLogging": true,
+ "programOutput": true,
+ "exceptions": true,
+ "moduleLoad": true
+ }
+ },
+ {
+ "name": "ESP32 nanoCLR - Wrover",
+ "type": "cppdbg",
+ "request": "launch",
+ "MIMode": "gdb",
+ "miDebuggerPath": "/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe",
+ "stopAtEntry":true,
+ "program": "/nanoCLR.elf",
+
+ "setupCommands": [
+ {"description":"" , "text" : "set logging on"},
+ {"description":"" , "text" : "target extended-remote localhost:3333"},
+ {"description":"" , "text" : "file /nanoCLR.elf"},
+ {"description":"" , "text" : "monitor reset halt"},
+ {"description":"" , "text" : "thb app_main"},
+ {"description":"" , "text" : "x $a1=0"}
+ ],
+
+ "launchCompleteCommand": "exec-run",
+ "debugServerPath": "/bin/openocd.exe",
+ "debugServerArgs": "-s \"/share/openocd/scripts/\" -f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32.cfg -c \"adapter_khz 2000\" " ,
+ "serverStarted": "Info : .*Tensilica.*0x1.",
+ "filterStderr": true,
+ "externalConsole": true,
+ "cwd": "${cwd}",
+
+ "logging": {
+ "trace": true,
+ "traceResponse": true,
+ "engineLogging": true,
+ "programOutput": true,
+ "exceptions": true,
+ "moduleLoad": true
+ }
+ }
+
+ ]
+}
diff --git a/source/native/nf-interpreter/.vscode/launch.TEMPLATE.json b/source/native/nf-interpreter/.vscode/launch.TEMPLATE.json
new file mode 100644
index 00000000..12bd0344
--- /dev/null
+++ b/source/native/nf-interpreter/.vscode/launch.TEMPLATE.json
@@ -0,0 +1,103 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "name the launch configuration 1 (booter) here",
+ "type": "cppdbg",
+ "request": "launch",
+ "miDebuggerPath": "",
+ "targetArchitecture": "ARM",
+ "program": "/nanoBooter.elf",
+
+ "setupCommands": [
+ {"description":"" , "text" : "target extended-remote localhost:3333"},
+ {"description":"" , "text" : "monitor reset_config none separate"},
+ {"description":"" , "text" : "monitor reset halt"},
+ {"description":"" , "text" : "monitor flash write_image erase \"/nanoBooter.hex\" "},
+ {"description":"" , "text" : "file /nanoBooter.elf"},
+ {"description":"" , "text" : "monitor reset halt"}
+ ],
+
+ "customLaunchSetupCommands": [
+ {"description":"" , "text" : "monitor reset_config none separate"},
+ {"description":"" , "text" : "monitor reset halt"}
+ ],
+
+ "launchCompleteCommand": "exec-continue",
+ "debugServerPath": "/bin/openocd.exe",
+ "debugServerArgs": "-s \"/share/openocd/scripts/\" -f interface/.cfg -f board/.cfg",
+ "serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
+ "filterStderr": true,
+ "externalConsole": true,
+ "cwd": "${cwd}",
+ // Enable the following to debug GDB
+ //"logging": {
+ // "engineLogging": true,
+ // "traceResponse": true
+ //},
+ },
+
+ {
+ "name": "name the launch configuration 2 (CLR) here",
+ "type": "cppdbg",
+ "request": "launch",
+ "miDebuggerPath": "",
+ "targetArchitecture": "ARM",
+ "program": "/nanoCLR.elf",
+
+ "setupCommands": [
+ {"description":"" , "text" : "target extended-remote localhost:3333"},
+ {"description":"" , "text" : "monitor reset_config none separate"},
+ {"description":"" , "text" : "monitor reset halt"},
+ {"description":"" , "text" : "monitor flash write_image erase \"/nanoCLR.hex\" "},
+ {"description":"" , "text" : "file /nanoCLR.elf"},
+ {"description":"" , "text" : "monitor reset halt"}
+ ],
+
+ "customLaunchSetupCommands": [
+ {"description":"" , "text" : "monitor reset_config none separate"},
+ {"description":"" , "text" : "monitor reset halt"}
+ ],
+
+ "launchCompleteCommand": "exec-continue",
+ "debugServerPath": "/bin/openocd.exe",
+ "debugServerArgs": "-s \"/share/openocd/scripts/\" -f interface/.cfg -f board/.cfg",
+ "serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
+ "filterStderr": true,
+ "externalConsole": true,
+ "cwd": "${cwd}"
+ // Enable the following to debug GDB
+ //"logging": {
+ // "engineLogging": true,
+ // "traceResponse": true
+ //},
+ },
+
+ {
+ "MIMode": "gdb",
+ "name": "CC3200 Launchpad nanoCLR TEMPLATE",
+ "type": "cppdbg",
+ "request": "launch",
+
+ "setupCommands": [
+ {"description":"" , "text" : "target remote | e:/openocd-0.10.0/bin/openocd.exe -c \"gdb_port pipe; log_output openocd.log\" -f "},
+ {"description":"" , "text" : "file /nanoCLR.elf>"},
+ {"description":"" , "text" : "load"},
+ {"description":"" , "text" : "set $sp = g_pfnVectors[0]"},
+ {"description":"" , "text" : "set $pc = g_pfnVectors[1]"},
+ {"description":"" , "text" : "break main"},
+ {"description":"" , "text" : "continue", "ignoreFailures": true }
+ ],
+
+ "miDebuggerPath": "",
+ "targetArchitecture": "ARM",
+ "program": "${workspaceRoot}/build/nanoCLR.elf",
+
+ "launchCompleteCommand": "None",
+ "serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
+ "filterStderr": true,
+ "externalConsole": true,
+ "cwd": "${cwd}"
+ }
+ ]
+}
diff --git a/source/native/nf-interpreter/.vscode/settings.TEMPLATE.json b/source/native/nf-interpreter/.vscode/settings.TEMPLATE.json
new file mode 100644
index 00000000..4a47defe
--- /dev/null
+++ b/source/native/nf-interpreter/.vscode/settings.TEMPLATE.json
@@ -0,0 +1,13 @@
+{
+ "cmake.preferredGenerators": [
+ "ninja.exe"
+ ],
+ "cmake.generator": "ninja.exe",
+ "cmake.useCMakeServer" : true,
+ "cmake.autoRestartBuild" : true,
+ "cmake.configureSettings": {
+ "CMAKE_MAKE_PROGRAM":"/ninja/ninja.exe"
+ },
+ "cmake.cmakePath": "/cmake/bin/cmake.exe",
+ "cmake.configureOnOpen": false
+}
diff --git a/source/native/nf-interpreter/.vscode/tasks.TEMPLATE-ESP32.json b/source/native/nf-interpreter/.vscode/tasks.TEMPLATE-ESP32.json
new file mode 100644
index 00000000..58d72280
--- /dev/null
+++ b/source/native/nf-interpreter/.vscode/tasks.TEMPLATE-ESP32.json
@@ -0,0 +1,47 @@
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "taskName": "Flash nanoCLR ",
+ "type": "shell",
+ "command": "python /components/esptool_py/esptool/esptool.py --chip esp32 --port \"\" --baud 921600 --before \"default_reset\" --after \"hard_reset\" write_flash -z --flash_mode \"dio\" --flash_freq \"40m\" --flash_size detect 0x1000 /bootloader.bin 0x10000 /nanoCLR.bin 0x8000 /partitions_4mb.bin",
+ "presentation": {
+ "reveal": "always",
+ "panel": "shared"
+ },
+ "problemMatcher": []
+ },
+ {
+ "taskName": "Erase flash ",
+ "type": "shell",
+ "command": "python /components/esptool_py/esptool/esptool.py --chip esp32 --port \"\" --baud 115200 --before \"default_reset\" --after \"hard_reset\" erase_flash",
+ "presentation": {
+ "reveal": "always",
+ "panel": "shared"
+ },
+ "problemMatcher": []
+ },
+ {
+ "taskName": "Flash nanoCLR Wrover ",
+ "type": "shell",
+ "command": "python /components/esptool_py/esptool/esptool.py --chip esp32 --port \"\" --baud 921600 --before \"default_reset\" --after \"hard_reset\" write_flash -z --flash_mode \"dio\" --flash_freq \"40m\" --flash_size detect 0x1000 /bootloader.bin 0x10000 /nanoCLR.bin 0x8000 /partitions_4mb.bin",
+ "presentation": {
+ "reveal": "always",
+ "panel": "shared"
+ },
+ "problemMatcher": []
+ },
+ {
+ "taskName": "Flash nanoCLR ESP32-EVB ",
+ "type": "shell",
+ "command": "python /components/esptool_py/esptool/esptool.py --chip esp32 --port \"\" --baud 921600 --before \"default_reset\" --after \"hard_reset\" write_flash -z --flash_mode \"dio\" --flash_freq \"40m\" --flash_size detect 0x1000 /bootloader.bin 0x10000 /nanoCLR.bin 0x8000 /partitions_4mb.bin",
+ "presentation": {
+ "reveal": "always",
+ "panel": "shared"
+ },
+ "problemMatcher": []
+ }
+ ]
+}
\ No newline at end of file
diff --git a/source/native/nf-interpreter/CHANGELOG.md b/source/native/nf-interpreter/CHANGELOG.md
new file mode 100644
index 00000000..5bfc6717
--- /dev/null
+++ b/source/native/nf-interpreter/CHANGELOG.md
@@ -0,0 +1,517 @@
+# Change Log
+
+## [**Changes available only in 'Preview' images:**](https://github.com/nanoframework/nf-interpreter/tree/HEAD)
+
+[Full Changelog](https://github.com/nanoframework/nf-interpreter/compare/v1.0.1...HEAD)
+
+**Implemented enhancements:**
+
+- Socket changes and fixes for HTTP [\#955](https://github.com/nanoframework/nf-interpreter/pull/955) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Rework inclusion of UART declarations in STM32 [\#951](https://github.com/nanoframework/nf-interpreter/pull/951) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add native support for Hardware.Stm32 class lib [\#935](https://github.com/nanoframework/nf-interpreter/pull/935) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Implemented Base64 encoding/decoding [\#934](https://github.com/nanoframework/nf-interpreter/pull/934) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+
+**Fixed bugs:**
+
+- Fix mscorlib native checksum for 1.0.6-preview-001 [\#969](https://github.com/nanoframework/nf-interpreter/pull/969) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Socket changes and fixes for HTTP [\#955](https://github.com/nanoframework/nf-interpreter/pull/955) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix UART4 setting for Windows.Device.SerialCommunication [\#950](https://github.com/nanoframework/nf-interpreter/pull/950) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fixes for issue \#416 [\#933](https://github.com/nanoframework/nf-interpreter/pull/933) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+
+**Documentation and other chores:**
+
+- Update nanoFramework.Hardware.Esp32 version to 1.0.2-preview-009 [\#980](https://github.com/nanoframework/nf-interpreter/pull/980)
+- Update Windows.Devices.Gpio version to 1.0.2-preview-008 [\#979](https://github.com/nanoframework/nf-interpreter/pull/979)
+- Update Windows.Devices.SerialCommunication version to 1.0.2-preview-009 [\#978](https://github.com/nanoframework/nf-interpreter/pull/978)
+- Update Windows.Devices.Spi version to 1.0.2-preview-007 [\#977](https://github.com/nanoframework/nf-interpreter/pull/977)
+- Update Windows.Devices.I2c version to 1.0.2-preview-007 [\#976](https://github.com/nanoframework/nf-interpreter/pull/976)
+- Update declaration of Windows.Devices.Gpio [\#973](https://github.com/nanoframework/nf-interpreter/pull/973)
+- Update declaration for Windows.Devices.Spi [\#972](https://github.com/nanoframework/nf-interpreter/pull/972)
+- Update declaration for Windows.Devices.SerialCommunication [\#971](https://github.com/nanoframework/nf-interpreter/pull/971)
+- Update Windows.Devices.I2c declaration [\#970](https://github.com/nanoframework/nf-interpreter/pull/970)
+- Update nanoFramework.Hardware.Esp32 version to 1.0.2-preview-004 [\#968](https://github.com/nanoframework/nf-interpreter/pull/968)
+- Update Windows.Devices.SerialCommunication version to 1.0.2-preview-004 [\#967](https://github.com/nanoframework/nf-interpreter/pull/967)
+- Update Windows.Devices.WiFi version to 1.0.2-preview-004 [\#966](https://github.com/nanoframework/nf-interpreter/pull/966)
+- Update nanoFramework.System.Net version to 1.0.2-preview-001 [\#965](https://github.com/nanoframework/nf-interpreter/pull/965)
+- Update Windows.Devices.Spi version to 1.0.2-preview-004 [\#964](https://github.com/nanoframework/nf-interpreter/pull/964)
+- Update Windows.Devices.Gpio version to 1.0.2-preview-004 [\#963](https://github.com/nanoframework/nf-interpreter/pull/963)
+- Update nanoFramework.Hardware.Stm32 version to 1.0.2-preview-004 [\#962](https://github.com/nanoframework/nf-interpreter/pull/962)
+- Update nanoFramework.Networking.Sntp version to 1.0.2-preview-005 [\#961](https://github.com/nanoframework/nf-interpreter/pull/961)
+- Update Windows.Devices.I2c version to 1.0.2-preview-004 [\#960](https://github.com/nanoframework/nf-interpreter/pull/960)
+- Update Windows.Devices.Adc version to 1.0.2-preview-004 [\#959](https://github.com/nanoframework/nf-interpreter/pull/959)
+- Update nanoFramework.Runtime.Native version to 1.0.2-preview-004 [\#958](https://github.com/nanoframework/nf-interpreter/pull/958)
+- Update nanoFramework.Runtime.Events version to 1.0.2-preview-004 [\#957](https://github.com/nanoframework/nf-interpreter/pull/957)
+- Update nanoFramework.CorLib version to 1.0.6-preview-001 [\#956](https://github.com/nanoframework/nf-interpreter/pull/956)
+- Update nanoFramework.Networking.Sntp version to 1.0.2-preview-002 [\#954](https://github.com/nanoframework/nf-interpreter/pull/954)
+- Move System.Math to it's own class lib [\#948](https://github.com/nanoframework/nf-interpreter/pull/948)
+
+## [v1.0.1](https://github.com/nanoframework/nf-interpreter/tree/v1.0.1) (2018-10-18)
+[Full Changelog](https://github.com/nanoframework/nf-interpreter/compare/v1.0.0...v1.0.1)
+
+## [v1.0.0](https://github.com/nanoframework/nf-interpreter/tree/v1.0.0) (2018-10-18)
+[Full Changelog](https://github.com/nanoframework/nf-interpreter/compare/v0.0.0...v1.0.0)
+
+**Implemented enhancements:**
+
+- Work on config block [\#904](https://github.com/nanoframework/nf-interpreter/pull/904) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add support for GetCustomAttributes [\#865](https://github.com/nanoframework/nf-interpreter/pull/865) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix for issue \#402: Type.GetInterfaces doesn't return the inherited interfaces [\#851](https://github.com/nanoframework/nf-interpreter/pull/851) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix: Unable to start debug session on ESP32 when using SerialCommunication [\#846](https://github.com/nanoframework/nf-interpreter/pull/846) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Fix for string.LastIndexOf\(char, int\) and string.LastIndexOf\(string, int\) should search toward the beginning of the string \#400 [\#845](https://github.com/nanoframework/nf-interpreter/pull/845) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Add native implementation of resource utility [\#844](https://github.com/nanoframework/nf-interpreter/pull/844) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- SNTP fixes for ESP32 [\#838](https://github.com/nanoframework/nf-interpreter/pull/838) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Fix WiFi version [\#834](https://github.com/nanoframework/nf-interpreter/pull/834) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Move CLR\_SETTINGS to targets [\#832](https://github.com/nanoframework/nf-interpreter/pull/832) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)] [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Implemented WatchChar in ESP32 [\#831](https://github.com/nanoframework/nf-interpreter/pull/831) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Improve posting of managed events [\#830](https://github.com/nanoframework/nf-interpreter/pull/830) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add back GenericPort\_Write to ESP32 [\#829](https://github.com/nanoframework/nf-interpreter/pull/829) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Rework system math implementation [\#823](https://github.com/nanoframework/nf-interpreter/pull/823) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Merge watchdog branch [\#819](https://github.com/nanoframework/nf-interpreter/pull/819) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Independent watchdog skeleton definitions [\#808](https://github.com/nanoframework/nf-interpreter/pull/808) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on mbed TLS parse certificate [\#807](https://github.com/nanoframework/nf-interpreter/pull/807) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Add new Guid and random for Esp32 [\#804](https://github.com/nanoframework/nf-interpreter/pull/804) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)] [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Clean-up messaging class [\#799](https://github.com/nanoframework/nf-interpreter/pull/799) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)] [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)] [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Correct comment about heap for STM32 targets [\#794](https://github.com/nanoframework/nf-interpreter/pull/794) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update ChibiOS config files for STM32F091RC target [\#793](https://github.com/nanoframework/nf-interpreter/pull/793) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Move booter blinker thread code to main loop [\#790](https://github.com/nanoframework/nf-interpreter/pull/790) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Updates required by ChibiOS fixes [\#787](https://github.com/nanoframework/nf-interpreter/pull/787) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add support for target reporting if it has nanoBooter [\#785](https://github.com/nanoframework/nf-interpreter/pull/785) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)] [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Add support for configurable Wire Protocol packet size [\#784](https://github.com/nanoframework/nf-interpreter/pull/784) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Fix required for build with RelWithDebInfo [\#774](https://github.com/nanoframework/nf-interpreter/pull/774) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Update native implementation of serial comm [\#767](https://github.com/nanoframework/nf-interpreter/pull/767) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add managed event on serial communication [\#766](https://github.com/nanoframework/nf-interpreter/pull/766) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)] [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add native support for runtime.native.power [\#762](https://github.com/nanoframework/nf-interpreter/pull/762) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Work native implementation of Runtime.Native.Rtc [\#761](https://github.com/nanoframework/nf-interpreter/pull/761) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)] [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update native code for nanoFramework.Runtime.Native [\#760](https://github.com/nanoframework/nf-interpreter/pull/760) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Housekeeping on ESP32 code base [\#758](https://github.com/nanoframework/nf-interpreter/pull/758) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Work string to value conversion implementation [\#756](https://github.com/nanoframework/nf-interpreter/pull/756) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Review ESP32 compiler options to enable warnings as errors [\#754](https://github.com/nanoframework/nf-interpreter/pull/754) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)] [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Update TimeSpan native declarations [\#747](https://github.com/nanoframework/nf-interpreter/pull/747) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Add support to String.Format [\#744](https://github.com/nanoframework/nf-interpreter/pull/744) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Rework several RAM assignment for STM32 targets [\#741](https://github.com/nanoframework/nf-interpreter/pull/741) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on compiler warnings 🚧 [\#739](https://github.com/nanoframework/nf-interpreter/pull/739) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix ADC declaration on all targets 🚧 [\#736](https://github.com/nanoframework/nf-interpreter/pull/736) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix Debugging\_Execution\_BreakpointDef [\#735](https://github.com/nanoframework/nf-interpreter/pull/735) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Fix ChibiOS usbcfg code on all STM32 targets 🚧 [\#732](https://github.com/nanoframework/nf-interpreter/pull/732) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Remove unused code from nanoBooter main 🚧 [\#730](https://github.com/nanoframework/nf-interpreter/pull/730) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improvements on BlockStorage declarations 🚧 [\#728](https://github.com/nanoframework/nf-interpreter/pull/728) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Change OS Task priority for ReceiverThread [\#724](https://github.com/nanoframework/nf-interpreter/pull/724) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Remove unused exception [\#721](https://github.com/nanoframework/nf-interpreter/pull/721) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Removed all IRAM\_ATTR attributes [\#718](https://github.com/nanoframework/nf-interpreter/pull/718) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- GLOBAL\_LOCK / GLOBAL\_UNLOCK implemented [\#716](https://github.com/nanoframework/nf-interpreter/pull/716) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Update corlib to support Timeout.InfiniteTimeSpan [\#715](https://github.com/nanoframework/nf-interpreter/pull/715) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Move command to list native interop assemblies to QueryCLRCapabilities [\#714](https://github.com/nanoframework/nf-interpreter/pull/714) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Add WP command to list interop native assemblies [\#710](https://github.com/nanoframework/nf-interpreter/pull/710) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Update board.h [\#708](https://github.com/nanoframework/nf-interpreter/pull/708) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update win\_dev\_gpio\_native\_Windows\_Devices\_Gpio\_GpioPin.cpp [\#704](https://github.com/nanoframework/nf-interpreter/pull/704) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Update GPIO to add support for toggle [\#699](https://github.com/nanoframework/nf-interpreter/pull/699) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Remove UpdateTime from Engine [\#698](https://github.com/nanoframework/nf-interpreter/pull/698) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Improvements GC [\#697](https://github.com/nanoframework/nf-interpreter/pull/697) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Improvements on Time\_Uninitialize [\#696](https://github.com/nanoframework/nf-interpreter/pull/696) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on scheduler, CLR events and sys time related code [\#695](https://github.com/nanoframework/nf-interpreter/pull/695) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improvements with timers from ChibiOS API [\#694](https://github.com/nanoframework/nf-interpreter/pull/694) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add performance counters stubs [\#692](https://github.com/nanoframework/nf-interpreter/pull/692) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on PAL events and PAL time [\#690](https://github.com/nanoframework/nf-interpreter/pull/690) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- General improvements in STM32 USB code [\#689](https://github.com/nanoframework/nf-interpreter/pull/689) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improvements in STM32 I2C class lib code [\#685](https://github.com/nanoframework/nf-interpreter/pull/685) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Implement RTC SetSystemTime [\#684](https://github.com/nanoframework/nf-interpreter/pull/684) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Improvements in ChibiOS SPI native [\#679](https://github.com/nanoframework/nf-interpreter/pull/679) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on STM32 SPI implementation [\#677](https://github.com/nanoframework/nf-interpreter/pull/677) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improvements in STM32 I2C native implementation [\#671](https://github.com/nanoframework/nf-interpreter/pull/671) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Implement ADC feature for ST\_NUCLEO\_F746ZG board [\#667](https://github.com/nanoframework/nf-interpreter/pull/667) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- adc-feature-for-stm32f429i-discovery [\#666](https://github.com/nanoframework/nf-interpreter/pull/666) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add ADC helper class for STM32F769I [\#665](https://github.com/nanoframework/nf-interpreter/pull/665) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Enable external SRAM for STM32F769I-DISCO [\#664](https://github.com/nanoframework/nf-interpreter/pull/664) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix to ADC last change to managed code [\#663](https://github.com/nanoframework/nf-interpreter/pull/663) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Add FSMC driver for STM32 [\#661](https://github.com/nanoframework/nf-interpreter/pull/661) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Remove left overs from previous EXT GPIO stuff [\#660](https://github.com/nanoframework/nf-interpreter/pull/660) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on ADC [\#659](https://github.com/nanoframework/nf-interpreter/pull/659) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add support for ADC in STM32F769I DISCO [\#658](https://github.com/nanoframework/nf-interpreter/pull/658) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on GPIO events [\#657](https://github.com/nanoframework/nf-interpreter/pull/657)
+- Various board updates for Netduino 3 Wifi [\#656](https://github.com/nanoframework/nf-interpreter/pull/656) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on native ADC [\#655](https://github.com/nanoframework/nf-interpreter/pull/655) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improvements in STM32 hard fault handler code [\#654](https://github.com/nanoframework/nf-interpreter/pull/654) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Implement Monitor\_FlashSectorMap for nanoBooter [\#647](https://github.com/nanoframework/nf-interpreter/pull/647) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix and update for STM32 flash driver [\#646](https://github.com/nanoframework/nf-interpreter/pull/646) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Various fixes for ESP32 [\#645](https://github.com/nanoframework/nf-interpreter/pull/645) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Work on random number generator [\#643](https://github.com/nanoframework/nf-interpreter/pull/643) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- STM32 HRNG driver [\#642](https://github.com/nanoframework/nf-interpreter/pull/642) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Support for serial on F4 Discovery board [\#638](https://github.com/nanoframework/nf-interpreter/pull/638) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Develop target specific call [\#633](https://github.com/nanoframework/nf-interpreter/pull/633) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- CRC32 in Wire Protocol is now optional [\#629](https://github.com/nanoframework/nf-interpreter/pull/629) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Networking [\#623](https://github.com/nanoframework/nf-interpreter/pull/623) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Remove "local time" stuff [\#622](https://github.com/nanoframework/nf-interpreter/pull/622) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on UNDONE FIXME [\#621](https://github.com/nanoframework/nf-interpreter/pull/621) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on GC [\#613](https://github.com/nanoframework/nf-interpreter/pull/613) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Improve reboot command execution [\#612](https://github.com/nanoframework/nf-interpreter/pull/612) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Correct implementation of Debugging\_Deployment\_Status [\#610](https://github.com/nanoframework/nf-interpreter/pull/610) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on native events [\#608](https://github.com/nanoframework/nf-interpreter/pull/608) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Add noreturn attribute to thread function [\#606](https://github.com/nanoframework/nf-interpreter/pull/606) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on Gpio [\#603](https://github.com/nanoframework/nf-interpreter/pull/603) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix vars casing to follow code guidelines [\#602](https://github.com/nanoframework/nf-interpreter/pull/602)
+- Allow events to be fired when no threads active [\#601](https://github.com/nanoframework/nf-interpreter/pull/601)
+- Add check for series definition in ChibiOS targetPAL [\#600](https://github.com/nanoframework/nf-interpreter/pull/600) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improvements on Gpio setting of alternate function [\#597](https://github.com/nanoframework/nf-interpreter/pull/597) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on serial [\#585](https://github.com/nanoframework/nf-interpreter/pull/585) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add serial feature to Nucleo F746ZG [\#584](https://github.com/nanoframework/nf-interpreter/pull/584) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add Serial support to ND3 [\#581](https://github.com/nanoframework/nf-interpreter/pull/581) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add Serial feature to F429 Discovery [\#580](https://github.com/nanoframework/nf-interpreter/pull/580) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improve serial operations [\#579](https://github.com/nanoframework/nf-interpreter/pull/579) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on CLR events [\#578](https://github.com/nanoframework/nf-interpreter/pull/578) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Implement read timeout on serial device [\#577](https://github.com/nanoframework/nf-interpreter/pull/577) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update win\_dev\_serial\_native\_Windows\_Devices\_SerialCommunication\_Seri… [\#573](https://github.com/nanoframework/nf-interpreter/pull/573) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on native support for Serial.Communication [\#569](https://github.com/nanoframework/nf-interpreter/pull/569) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improve STM32 v2 flash driver [\#565](https://github.com/nanoframework/nf-interpreter/pull/565) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improve Wire Protocol trace output [\#564](https://github.com/nanoframework/nf-interpreter/pull/564) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improvements in device information [\#563](https://github.com/nanoframework/nf-interpreter/pull/563) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Revert "Rework System.DateTime \(\#553\)" [\#560](https://github.com/nanoframework/nf-interpreter/pull/560) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Add pwm support for STM32F407 [\#559](https://github.com/nanoframework/nf-interpreter/pull/559) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Rework System.DateTime [\#553](https://github.com/nanoframework/nf-interpreter/pull/553) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Drivemode "Alternate" [\#552](https://github.com/nanoframework/nf-interpreter/pull/552) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- FatFS Integration [\#551](https://github.com/nanoframework/nf-interpreter/pull/551) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Clean-up type system [\#544](https://github.com/nanoframework/nf-interpreter/pull/544) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Remove ExtendedWeakReference [\#543](https://github.com/nanoframework/nf-interpreter/pull/543) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Update nanoCLR project [\#542](https://github.com/nanoframework/nf-interpreter/pull/542)
+- Rework bool functions and args [\#539](https://github.com/nanoframework/nf-interpreter/pull/539) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on Debugger conditions in CLR\_RT\_ExecutionEngine [\#538](https://github.com/nanoframework/nf-interpreter/pull/538) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Improvements in Wire Protocol responsivness [\#536](https://github.com/nanoframework/nf-interpreter/pull/536) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+
+**Fixed bugs:**
+
+- Fix bug with infinite timeout handling [\#906](https://github.com/nanoframework/nf-interpreter/pull/906) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Work on config block [\#904](https://github.com/nanoframework/nf-interpreter/pull/904) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fixes to SPI for half duplex/TransferSequential [\#872](https://github.com/nanoframework/nf-interpreter/pull/872) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Fix STM32 series defines throughout the code [\#862](https://github.com/nanoframework/nf-interpreter/pull/862) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix enumeration of config blocks when device has no config block [\#857](https://github.com/nanoframework/nf-interpreter/pull/857) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix Convert::NativeToInt64 for multiple base conversions [\#855](https://github.com/nanoframework/nf-interpreter/pull/855) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix for issue \#390: object.GetHashCode not working [\#852](https://github.com/nanoframework/nf-interpreter/pull/852) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix for issue \\#402: Type.GetInterfaces doesn't return the inherited interfaces [\#851](https://github.com/nanoframework/nf-interpreter/pull/851) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix for issue \#409: NativeToDouble doesn't support the "e"/"E" exponential char [\#850](https://github.com/nanoframework/nf-interpreter/pull/850) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix for issue 403: type.GetMethods returns also static methods of the base class [\#849](https://github.com/nanoframework/nf-interpreter/pull/849) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- The format for 64bit values is "ll" not "l" [\#848](https://github.com/nanoframework/nf-interpreter/pull/848) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Uncommented the CLR\_RT\_TypeSystem::FindTypeDef functionality [\#847](https://github.com/nanoframework/nf-interpreter/pull/847) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix for string.LastIndexOf\\(char, int\\) and string.LastIndexOf\\(string, int\\) should search toward the beginning of the string \\#400 [\#845](https://github.com/nanoframework/nf-interpreter/pull/845) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix for double.ToString\(\) and float.ToString\(\) [\#841](https://github.com/nanoframework/nf-interpreter/pull/841) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix Random.Next returns negative numbers \#405 [\#840](https://github.com/nanoframework/nf-interpreter/pull/840) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix Math.Round [\#839](https://github.com/nanoframework/nf-interpreter/pull/839) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix DateTime.DaysInMonth [\#837](https://github.com/nanoframework/nf-interpreter/pull/837) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix single precision Truncate\_\_\_STATIC\_\_R4\_\_R4 [\#836](https://github.com/nanoframework/nf-interpreter/pull/836) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Rework math calls [\#827](https://github.com/nanoframework/nf-interpreter/pull/827) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Rework system math implementation [\#823](https://github.com/nanoframework/nf-interpreter/pull/823) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Config changes [\#818](https://github.com/nanoframework/nf-interpreter/pull/818) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Fix number conversion [\#816](https://github.com/nanoframework/nf-interpreter/pull/816) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix ToString for doubles and floats [\#815](https://github.com/nanoframework/nf-interpreter/pull/815) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix tiny printf implementation [\#813](https://github.com/nanoframework/nf-interpreter/pull/813) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)] [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix I2c issues [\#803](https://github.com/nanoframework/nf-interpreter/pull/803) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Remove debug code on SSL Network timeouts [\#802](https://github.com/nanoframework/nf-interpreter/pull/802) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Flash erase fix [\#801](https://github.com/nanoframework/nf-interpreter/pull/801) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Fix ChibiOS ADCv2 config struct [\#789](https://github.com/nanoframework/nf-interpreter/pull/789) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix typo in function name [\#786](https://github.com/nanoframework/nf-interpreter/pull/786) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Fix LaunchCLR to detect valid image [\#780](https://github.com/nanoframework/nf-interpreter/pull/780) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix declaration for build config RelWithDebInfo [\#779](https://github.com/nanoframework/nf-interpreter/pull/779) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fixes required for STM32F0 series [\#778](https://github.com/nanoframework/nf-interpreter/pull/778) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improve code in CheckValidCLRImage [\#776](https://github.com/nanoframework/nf-interpreter/pull/776) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix time methods as per \#350 \#351 [\#770](https://github.com/nanoframework/nf-interpreter/pull/770) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fixes with declarations for SMT32L0 series [\#757](https://github.com/nanoframework/nf-interpreter/pull/757) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improved code to remove compiler warning [\#749](https://github.com/nanoframework/nf-interpreter/pull/749) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix format specifier for double printf [\#743](https://github.com/nanoframework/nf-interpreter/pull/743) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix issue with CLR\_RT\_UnicodeHelper::ConvertFromUTF8 [\#742](https://github.com/nanoframework/nf-interpreter/pull/742) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Various fixes with Devices.Gpio [\#740](https://github.com/nanoframework/nf-interpreter/pull/740) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix System.Math.Truncate [\#734](https://github.com/nanoframework/nf-interpreter/pull/734) [[Area: Common libs](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Common%20libs)]
+- Fix wrong field declaration in System\_String [\#727](https://github.com/nanoframework/nf-interpreter/pull/727) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Improvement on Serial NativeRead [\#722](https://github.com/nanoframework/nf-interpreter/pull/722) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Correct ConstraintException in type system lookup table [\#720](https://github.com/nanoframework/nf-interpreter/pull/720) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Corrected the device selector string for the ESP32 serial ports [\#717](https://github.com/nanoframework/nf-interpreter/pull/717) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- SPI: Use the max clock frequency if unset \(\#327\) [\#711](https://github.com/nanoframework/nf-interpreter/pull/711) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Fix bug with unwanted read or write after I2C operation [\#709](https://github.com/nanoframework/nf-interpreter/pull/709) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix ESP32 Gpio toggle [\#703](https://github.com/nanoframework/nf-interpreter/pull/703) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Fix issues with ESP32 time and event functions [\#700](https://github.com/nanoframework/nf-interpreter/pull/700) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Work on STM32 SPI [\#686](https://github.com/nanoframework/nf-interpreter/pull/686) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Correct calls to cache helpers for STM32 targets [\#676](https://github.com/nanoframework/nf-interpreter/pull/676) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix error introduced in last ESP32 I2C change [\#674](https://github.com/nanoframework/nf-interpreter/pull/674) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Improve debug session start [\#669](https://github.com/nanoframework/nf-interpreter/pull/669) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on GPIO events [\#657](https://github.com/nanoframework/nf-interpreter/pull/657)
+- Added header for ESP32 to define uint8\_t etc [\#649](https://github.com/nanoframework/nf-interpreter/pull/649) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Fix and update for STM32 flash driver [\#646](https://github.com/nanoframework/nf-interpreter/pull/646) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Various fixes for ESP32 [\#645](https://github.com/nanoframework/nf-interpreter/pull/645) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Correct code writing single bytes to flash [\#644](https://github.com/nanoframework/nf-interpreter/pull/644) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix var name for config block [\#641](https://github.com/nanoframework/nf-interpreter/pull/641) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix STM32F7 loader files [\#640](https://github.com/nanoframework/nf-interpreter/pull/640) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix wrong button check in booter \(STM32F4 disco\) [\#636](https://github.com/nanoframework/nf-interpreter/pull/636) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Correct code reading Gpio value [\#635](https://github.com/nanoframework/nf-interpreter/pull/635) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Rework code for Serial ouput stream Store [\#607](https://github.com/nanoframework/nf-interpreter/pull/607) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix serial com Store\(\) delay [\#605](https://github.com/nanoframework/nf-interpreter/pull/605) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix Wire Protocol comm issues [\#596](https://github.com/nanoframework/nf-interpreter/pull/596) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Fix inclusion of target source file for serial API [\#587](https://github.com/nanoframework/nf-interpreter/pull/587) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on serial [\#585](https://github.com/nanoframework/nf-interpreter/pull/585) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update win\_dev\_serial\_native\_Windows\_Devices\_SerialCommunication\_Seri… [\#574](https://github.com/nanoframework/nf-interpreter/pull/574) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix UART definition requried for serial support [\#572](https://github.com/nanoframework/nf-interpreter/pull/572)
+- Correct UART\_INIT macro for F4 and F0 targets [\#570](https://github.com/nanoframework/nf-interpreter/pull/570)
+- Correct CRT heap size for nanoBooter [\#556](https://github.com/nanoframework/nf-interpreter/pull/556) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Change Spi Full-duplex buffer size [\#546](https://github.com/nanoframework/nf-interpreter/pull/546) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Amend comparison size of assembly marker [\#541](https://github.com/nanoframework/nf-interpreter/pull/541) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Correct missing call to wait debugger commands [\#537](https://github.com/nanoframework/nf-interpreter/pull/537) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix managed heap initialization [\#534](https://github.com/nanoframework/nf-interpreter/pull/534) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+
+**Documentation and other chores:**
+
+- Merge back changes from Release 1.0.0 [\#928](https://github.com/nanoframework/nf-interpreter/pull/928)
+- Merge 'develop' for Release 1.0.0 [\#927](https://github.com/nanoframework/nf-interpreter/pull/927)
+- Update nanoFramework.CorLib version to 1.0.4 [\#918](https://github.com/nanoframework/nf-interpreter/pull/918)
+- normalize line endings [\#900](https://github.com/nanoframework/nf-interpreter/pull/900)
+- Update nanoFramework.CorLib version to 1.0.1-preview118 [\#898](https://github.com/nanoframework/nf-interpreter/pull/898)
+- High Res Timer added to Nanoframework.Hardware.Esp32 [\#866](https://github.com/nanoframework/nf-interpreter/pull/866)
+- remove obsolete parameter BOARD\_NAME [\#861](https://github.com/nanoframework/nf-interpreter/pull/861)
+- Getting the MinSizeRel build working for the ESP32 [\#796](https://github.com/nanoframework/nf-interpreter/pull/796)
+- Changed build back to Debug [\#783](https://github.com/nanoframework/nf-interpreter/pull/783)
+- Updated the ESP32 build documentation [\#755](https://github.com/nanoframework/nf-interpreter/pull/755)
+- Add FP information about STM32 targets to readme [\#753](https://github.com/nanoframework/nf-interpreter/pull/753) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix for timeout errors on I2C introduced with 3.0 release. [\#746](https://github.com/nanoframework/nf-interpreter/pull/746)
+- Initial ESP32 native hardware support [\#712](https://github.com/nanoframework/nf-interpreter/pull/712)
+- Improvements in ESP32 related docs [\#691](https://github.com/nanoframework/nf-interpreter/pull/691) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Updated the setup procedure for the ESP32 development [\#682](https://github.com/nanoframework/nf-interpreter/pull/682) [[Area: ESP32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20ESP32)]
+- Fix issues that stopped ESP32 build after change to events [\#611](https://github.com/nanoframework/nf-interpreter/pull/611)
+- ESP32 Gpio update to support SetAlternateFunction [\#598](https://github.com/nanoframework/nf-interpreter/pull/598)
+- Update sub module community targets @1d0bc8b0 [\#575](https://github.com/nanoframework/nf-interpreter/pull/575)
+- Update target\_windows\_devices\_serialcommunication\_config.cpp [\#571](https://github.com/nanoframework/nf-interpreter/pull/571)
+- Include community board in select clause for I2C [\#567](https://github.com/nanoframework/nf-interpreter/pull/567)
+- PWM - Add more MCUs [\#558](https://github.com/nanoframework/nf-interpreter/pull/558)
+- PWM support initial commit [\#557](https://github.com/nanoframework/nf-interpreter/pull/557)
+- Update corlib\_native\_System\_Number.cpp [\#550](https://github.com/nanoframework/nf-interpreter/pull/550)
+- Update corlib\_native\_System\_Number.cpp [\#549](https://github.com/nanoframework/nf-interpreter/pull/549)
+- Update targetHAL\_Time.cpp [\#548](https://github.com/nanoframework/nf-interpreter/pull/548)
+
+## [v0.0.0](https://github.com/nanoframework/nf-interpreter/tree/v0.0.0) (2017-09-26)
+**Implemented enhancements:**
+
+- Add exception handlers for debug [\#488](https://github.com/nanoframework/nf-interpreter/pull/488) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update Devces.Gpio native code for 1.0.0.22 [\#470](https://github.com/nanoframework/nf-interpreter/pull/470) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add CR+LF to improve output [\#463](https://github.com/nanoframework/nf-interpreter/pull/463) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add more SetResult\_\* methods [\#460](https://github.com/nanoframework/nf-interpreter/pull/460) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on System.Convert [\#459](https://github.com/nanoframework/nf-interpreter/pull/459) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Enhanced 16bit support [\#457](https://github.com/nanoframework/nf-interpreter/pull/457) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Enable SPI5 \(this is used in the board mems sensor\) [\#453](https://github.com/nanoframework/nf-interpreter/pull/453) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update test app for nanoCLR [\#450](https://github.com/nanoframework/nf-interpreter/pull/450) [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Update native code for System.Globalization [\#446](https://github.com/nanoframework/nf-interpreter/pull/446) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on events [\#441](https://github.com/nanoframework/nf-interpreter/pull/441) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on Events [\#440](https://github.com/nanoframework/nf-interpreter/pull/440) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Improve assembly loading [\#439](https://github.com/nanoframework/nf-interpreter/pull/439) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Correct types in declarations of Async Process calls [\#437](https://github.com/nanoframework/nf-interpreter/pull/437) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Add native code for System.Console [\#431](https://github.com/nanoframework/nf-interpreter/pull/431) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- SPI native code [\#429](https://github.com/nanoframework/nf-interpreter/pull/429) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on Devices.Spi [\#428](https://github.com/nanoframework/nf-interpreter/pull/428) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Move CLRStartup to its own OS thread [\#425](https://github.com/nanoframework/nf-interpreter/pull/425) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on Devices.Spi native [\#424](https://github.com/nanoframework/nf-interpreter/pull/424) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on Devices.Gpio [\#418](https://github.com/nanoframework/nf-interpreter/pull/418) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Rename NativeEvents native code [\#409](https://github.com/nanoframework/nf-interpreter/pull/409) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update nanoCLR test solution [\#406](https://github.com/nanoframework/nf-interpreter/pull/406) [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Minor fixes [\#401](https://github.com/nanoframework/nf-interpreter/pull/401)
+- Fix flash driver for use in SMT32F7 series [\#400](https://github.com/nanoframework/nf-interpreter/pull/400) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Various fixes for MBN\_QUAIL [\#395](https://github.com/nanoframework/nf-interpreter/pull/395) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on Execution [\#375](https://github.com/nanoframework/nf-interpreter/pull/375) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)] [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Update test app in nanoCLR [\#374](https://github.com/nanoframework/nf-interpreter/pull/374) [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Initial work on Events [\#373](https://github.com/nanoframework/nf-interpreter/pull/373) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improve ContiguousBlockAssemblies [\#371](https://github.com/nanoframework/nf-interpreter/pull/371) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Remove endianess checking of assemblies [\#368](https://github.com/nanoframework/nf-interpreter/pull/368) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Aligned CorLib declarations with managed stubs [\#367](https://github.com/nanoframework/nf-interpreter/pull/367) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Fix issues with assemblies loading at startup [\#365](https://github.com/nanoframework/nf-interpreter/pull/365) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Remove addresses from Debugging\_Deployment\_Status [\#362](https://github.com/nanoframework/nf-interpreter/pull/362) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Add error code to reply of access memory commands [\#361](https://github.com/nanoframework/nf-interpreter/pull/361) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Enable IncrementalDeployment in capabilites [\#360](https://github.com/nanoframework/nf-interpreter/pull/360) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on Debugging\_Deployment\_Status [\#359](https://github.com/nanoframework/nf-interpreter/pull/359) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Improvements in flash driver [\#358](https://github.com/nanoframework/nf-interpreter/pull/358) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Work on DeviceBlockInfo\_FindRegionFromAddress [\#357](https://github.com/nanoframework/nf-interpreter/pull/357) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on Debugging\_Deployment\_Status [\#356](https://github.com/nanoframework/nf-interpreter/pull/356) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Sync flags with debugger library code [\#350](https://github.com/nanoframework/nf-interpreter/pull/350) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Remove unsupported c\_Monitor\_SignatureKeyUpdate [\#349](https://github.com/nanoframework/nf-interpreter/pull/349) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Work on ChibiOS v17 USB code [\#344](https://github.com/nanoframework/nf-interpreter/pull/344) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Second try on Windows.Devices.Gpio [\#329](https://github.com/nanoframework/nf-interpreter/pull/329) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update Nuget packages [\#318](https://github.com/nanoframework/nf-interpreter/pull/318) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Update documentation to include API option [\#317](https://github.com/nanoframework/nf-interpreter/pull/317)
+- Add native code for base class library \(mscolib\) [\#310](https://github.com/nanoframework/nf-interpreter/pull/310) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Include support for ChibiOS syscalls to use newlib stuff [\#309](https://github.com/nanoframework/nf-interpreter/pull/309)
+- Add declaration for MDP [\#301](https://github.com/nanoframework/nf-interpreter/pull/301) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Add Interop feature to CLR [\#299](https://github.com/nanoframework/nf-interpreter/pull/299) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- removed unused include for nanoHAL.h [\#298](https://github.com/nanoframework/nf-interpreter/pull/298) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Remove legacy functions [\#293](https://github.com/nanoframework/nf-interpreter/pull/293) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Update Nuget for MSBuild System [\#291](https://github.com/nanoframework/nf-interpreter/pull/291) [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Add code to output to VS console [\#290](https://github.com/nanoframework/nf-interpreter/pull/290) [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Update Nuget packages [\#289](https://github.com/nanoframework/nf-interpreter/pull/289) [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Replace path for mscorlib.pe [\#288](https://github.com/nanoframework/nf-interpreter/pull/288) [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Improve error reporting detail [\#286](https://github.com/nanoframework/nf-interpreter/pull/286) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Fix ComputeAssemblyHash [\#279](https://github.com/nanoframework/nf-interpreter/pull/279) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Moved nanoCLR\_ParseOptions file to src folder [\#277](https://github.com/nanoframework/nf-interpreter/pull/277) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Enable Target\_GetReleaseInfo [\#267](https://github.com/nanoframework/nf-interpreter/pull/267) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Enable GetClrReleaseInfo in Debugger [\#266](https://github.com/nanoframework/nf-interpreter/pull/266) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Revert types to well known defined types [\#251](https://github.com/nanoframework/nf-interpreter/pull/251)
+- Replace types with standard C [\#250](https://github.com/nanoframework/nf-interpreter/pull/250) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Correct declaration to use standard types [\#249](https://github.com/nanoframework/nf-interpreter/pull/249)
+- Replace attributes with define [\#248](https://github.com/nanoframework/nf-interpreter/pull/248) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Complete work on \#195 [\#240](https://github.com/nanoframework/nf-interpreter/pull/240) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Rework code base to have a single debugger and messaging port [\#238](https://github.com/nanoframework/nf-interpreter/pull/238) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Rename ReplyCommand in WireProtocol C implementation [\#236](https://github.com/nanoframework/nf-interpreter/pull/236) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Further work on BlockStorage [\#235](https://github.com/nanoframework/nf-interpreter/pull/235) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Update build-instructions.md [\#229](https://github.com/nanoframework/nf-interpreter/pull/229)
+- Moved linker symbols to targetHAL [\#218](https://github.com/nanoframework/nf-interpreter/pull/218) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update documentation on contributions [\#217](https://github.com/nanoframework/nf-interpreter/pull/217)
+- Add GetSector in STM32 flash driver [\#214](https://github.com/nanoframework/nf-interpreter/pull/214) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- First implement of Monitor\_CheckMemory logic. [\#211](https://github.com/nanoframework/nf-interpreter/pull/211) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Implement Monitor\_MemoryMap command [\#207](https://github.com/nanoframework/nf-interpreter/pull/207) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add flash driver for STM32F7 series [\#200](https://github.com/nanoframework/nf-interpreter/pull/200) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Rework HAL time functions [\#160](https://github.com/nanoframework/nf-interpreter/pull/160) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Cleaned up unused,obsolete and unsupported platforms and toolchains [\#99](https://github.com/nanoframework/nf-interpreter/pull/99) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- WP test app over USB CDC [\#65](https://github.com/nanoframework/nf-interpreter/pull/65) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Implement Wire Protocol in plain C [\#56](https://github.com/nanoframework/nf-interpreter/pull/56) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Moved CLR folder up one level [\#50](https://github.com/nanoframework/nf-interpreter/pull/50)
+- Add test app for mBed RTOS [\#16](https://github.com/nanoframework/nf-interpreter/pull/16)
+- Add demo app for FreeRTOS [\#15](https://github.com/nanoframework/nf-interpreter/pull/15)
+- Add support for specifing RTOS for build [\#14](https://github.com/nanoframework/nf-interpreter/pull/14)
+
+**Fixed bugs:**
+
+- Add missing defines in mcuconf header of ST\_STM32F769I\_DISCOVERY [\#487](https://github.com/nanoframework/nf-interpreter/pull/487) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix linker file for ST\_STM32F769I\_DISCOVERY [\#486](https://github.com/nanoframework/nf-interpreter/pull/486) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Remove references to removed source files [\#447](https://github.com/nanoframework/nf-interpreter/pull/447) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Correct wrong declation of argument in Interop code [\#417](https://github.com/nanoframework/nf-interpreter/pull/417)
+- Correct issue with flash driver for STM32F4XX devices [\#415](https://github.com/nanoframework/nf-interpreter/pull/415) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix flash driver for use in SMT32F7 series [\#400](https://github.com/nanoframework/nf-interpreter/pull/400) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Various fixes for MBN\\_QUAIL [\#395](https://github.com/nanoframework/nf-interpreter/pull/395) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Various fixes in ST\_STM32F429I\_DISCOVERY [\#394](https://github.com/nanoframework/nf-interpreter/pull/394) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix debugger wait loop [\#383](https://github.com/nanoframework/nf-interpreter/pull/383) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Fix ContiguousBlockAssemblies [\#372](https://github.com/nanoframework/nf-interpreter/pull/372) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Correct submodule naming [\#256](https://github.com/nanoframework/nf-interpreter/pull/256)
+- Fixed ram0 start address on linker file [\#206](https://github.com/nanoframework/nf-interpreter/pull/206) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add missing \#ifdef for Win32 nanoCLR solution [\#175](https://github.com/nanoframework/nf-interpreter/pull/175) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+
+**Documentation and other chores:**
+
+- Fix linker files for SMT32F7 series [\#516](https://github.com/nanoframework/nf-interpreter/pull/516) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix issue \#70 [\#515](https://github.com/nanoframework/nf-interpreter/pull/515)
+- Fix compilation error for F091 with SPI [\#508](https://github.com/nanoframework/nf-interpreter/pull/508)
+- Changed I2C transmit timeout [\#507](https://github.com/nanoframework/nf-interpreter/pull/507)
+- Replace duplicate implementations of SafeSprint\* [\#506](https://github.com/nanoframework/nf-interpreter/pull/506) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Add implementation for TimeSpan.ToString\(\) [\#505](https://github.com/nanoframework/nf-interpreter/pull/505) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Remove unused vars and related code file [\#504](https://github.com/nanoframework/nf-interpreter/pull/504) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix I2C for F769I reference board [\#500](https://github.com/nanoframework/nf-interpreter/pull/500) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Increase memory for image of firmware [\#499](https://github.com/nanoframework/nf-interpreter/pull/499) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Activate channels for SPI, I2C [\#498](https://github.com/nanoframework/nf-interpreter/pull/498) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Correct include version for I2C [\#497](https://github.com/nanoframework/nf-interpreter/pull/497) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Definitive fix for I2C and SPI on F7 MCU [\#495](https://github.com/nanoframework/nf-interpreter/pull/495)
+- Work on I2C for STM32F7xx [\#492](https://github.com/nanoframework/nf-interpreter/pull/492)
+- Improve HAL EXT initialization [\#491](https://github.com/nanoframework/nf-interpreter/pull/491) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fixes exception in ToString\(\) [\#490](https://github.com/nanoframework/nf-interpreter/pull/490) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Fix ChibiOS rules [\#489](https://github.com/nanoframework/nf-interpreter/pull/489) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Dereference Unsigned shorts in SPI [\#484](https://github.com/nanoframework/nf-interpreter/pull/484) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Remove setting of PB3 for SWO [\#482](https://github.com/nanoframework/nf-interpreter/pull/482) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Improve SWO config [\#481](https://github.com/nanoframework/nf-interpreter/pull/481) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Spi f7 [\#480](https://github.com/nanoframework/nf-interpreter/pull/480) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Remove ST\_NUCLEO144\_F746ZG from nF overlay [\#476](https://github.com/nanoframework/nf-interpreter/pull/476) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Update program with SPI test code [\#474](https://github.com/nanoframework/nf-interpreter/pull/474) [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Correct assembly name [\#473](https://github.com/nanoframework/nf-interpreter/pull/473) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Update nanoCLR test app to latest Nugets [\#472](https://github.com/nanoframework/nf-interpreter/pull/472) [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Disable Gpio on F091 board [\#471](https://github.com/nanoframework/nf-interpreter/pull/471)
+- SetResult - Fix bytes return values [\#469](https://github.com/nanoframework/nf-interpreter/pull/469)
+- Update docs [\#467](https://github.com/nanoframework/nf-interpreter/pull/467)
+- I2c [\#445](https://github.com/nanoframework/nf-interpreter/pull/445)
+- Add missing file to nanoCLR [\#438](https://github.com/nanoframework/nf-interpreter/pull/438) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: WIN32](https://github.com/nanoframework/nf-interpreter/labels/Area:%20WIN32)]
+- Add documentation on using Ninja build [\#436](https://github.com/nanoframework/nf-interpreter/pull/436)
+- Improve documentation [\#426](https://github.com/nanoframework/nf-interpreter/pull/426)
+- Improve communication responsiveness [\#423](https://github.com/nanoframework/nf-interpreter/pull/423) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- refactored template to make it slightly simpler [\#410](https://github.com/nanoframework/nf-interpreter/pull/410)
+- Improvements in documentation for class libraries [\#405](https://github.com/nanoframework/nf-interpreter/pull/405)
+- Corrections for F69I \(deployment still fails\) [\#396](https://github.com/nanoframework/nf-interpreter/pull/396)
+- Fix regions on F746ZG \(\#391\) [\#392](https://github.com/nanoframework/nf-interpreter/pull/392)
+- updates to documentation \(\#386\) [\#389](https://github.com/nanoframework/nf-interpreter/pull/389)
+- fix for USB connection issues with F769I [\#388](https://github.com/nanoframework/nf-interpreter/pull/388)
+- Devices.Gpio fixes [\#387](https://github.com/nanoframework/nf-interpreter/pull/387)
+- F746 device id \(\#380\) [\#384](https://github.com/nanoframework/nf-interpreter/pull/384)
+- update travis arm toolchain [\#381](https://github.com/nanoframework/nf-interpreter/pull/381)
+- update travis arm toolchain \#196 and cmake to 3.8.2 [\#379](https://github.com/nanoframework/nf-interpreter/pull/379)
+- updated documents [\#378](https://github.com/nanoframework/nf-interpreter/pull/378)
+- Add documenation about thread execution and context switching [\#376](https://github.com/nanoframework/nf-interpreter/pull/376)
+- F7 improvements and attempts at CLR RAM optimisations for some boards [\#370](https://github.com/nanoframework/nf-interpreter/pull/370)
+- clr managed heap document improvements [\#369](https://github.com/nanoframework/nf-interpreter/pull/369)
+- Add doc with explanation about deployment [\#363](https://github.com/nanoframework/nf-interpreter/pull/363)
+- Fix \#353 [\#354](https://github.com/nanoframework/nf-interpreter/pull/354) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Fix issue \#337 [\#338](https://github.com/nanoframework/nf-interpreter/pull/338)
+- Work on new DateTime native side [\#336](https://github.com/nanoframework/nf-interpreter/pull/336)
+- Fixes \#314 [\#315](https://github.com/nanoframework/nf-interpreter/pull/315)
+- Fix declaration of Interop\_Marshal\_GetField for bool type [\#295](https://github.com/nanoframework/nf-interpreter/pull/295)
+- Add stdafx.h include [\#282](https://github.com/nanoframework/nf-interpreter/pull/282) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Update Community Targets submodule [\#280](https://github.com/nanoframework/nf-interpreter/pull/280)
+- Moved nanoCLR\_ParseOptions file to src folder \(\#277\) [\#278](https://github.com/nanoframework/nf-interpreter/pull/278) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Add documentation about cmake-variants.TEMPLATE.json [\#276](https://github.com/nanoframework/nf-interpreter/pull/276)
+- Correct GNU ARM Eclipse OpenOCD link [\#273](https://github.com/nanoframework/nf-interpreter/pull/273)
+- Correct issue when checking for user button pressed [\#271](https://github.com/nanoframework/nf-interpreter/pull/271)
+- Add missing CLRStartup thread to reference boards [\#262](https://github.com/nanoframework/nf-interpreter/pull/262)
+- Fix \#259 [\#261](https://github.com/nanoframework/nf-interpreter/pull/261)
+- Correct linker scripts to aling deployment [\#260](https://github.com/nanoframework/nf-interpreter/pull/260)
+- Correct button check [\#258](https://github.com/nanoframework/nf-interpreter/pull/258)
+- Correction for support of community boards [\#253](https://github.com/nanoframework/nf-interpreter/pull/253)
+- Update gitignore for VS Code [\#246](https://github.com/nanoframework/nf-interpreter/pull/246)
+- Fixes issue \#118 [\#245](https://github.com/nanoframework/nf-interpreter/pull/245)
+- Fix Quail nanoBooter main code [\#244](https://github.com/nanoframework/nf-interpreter/pull/244)
+- Update README.md [\#243](https://github.com/nanoframework/nf-interpreter/pull/243)
+- Fix \#241 [\#242](https://github.com/nanoframework/nf-interpreter/pull/242)
+- update build instructions related to launch.json [\#234](https://github.com/nanoframework/nf-interpreter/pull/234)
+- Initial implementation of Monitor\_FlashSectorMap \(\#215\) [\#223](https://github.com/nanoframework/nf-interpreter/pull/223)
+- Moved some declarations to nanoHAL\_v2 [\#204](https://github.com/nanoframework/nf-interpreter/pull/204)
+- Add dummy flash sector 11 definition [\#203](https://github.com/nanoframework/nf-interpreter/pull/203) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Implement AccessMemory function [\#198](https://github.com/nanoframework/nf-interpreter/pull/198) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Implement Monitor\_EraseMemory command [\#197](https://github.com/nanoframework/nf-interpreter/pull/197) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)] [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- HAL config was missing the USE\_SERIAL definition [\#194](https://github.com/nanoframework/nf-interpreter/pull/194)
+- Add Travis CI badge to readme [\#193](https://github.com/nanoframework/nf-interpreter/pull/193)
+- Correct filename case [\#190](https://github.com/nanoframework/nf-interpreter/pull/190)
+- Correct file name case [\#189](https://github.com/nanoframework/nf-interpreter/pull/189)
+- Change filename case [\#187](https://github.com/nanoframework/nf-interpreter/pull/187)
+- update Travis file [\#183](https://github.com/nanoframework/nf-interpreter/pull/183)
+- Add Travis file [\#180](https://github.com/nanoframework/nf-interpreter/pull/180)
+- Aligned CMakes for reference boards [\#179](https://github.com/nanoframework/nf-interpreter/pull/179)
+- Enable WireProtocol in nanoBooter [\#177](https://github.com/nanoframework/nf-interpreter/pull/177)
+- Quail board support again [\#168](https://github.com/nanoframework/nf-interpreter/pull/168)
+- Fix mcu configs for NUCLEO901 in nanoCLR [\#167](https://github.com/nanoframework/nf-interpreter/pull/167) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Uncomment line that was causing issues with nanoCLR image detection [\#163](https://github.com/nanoframework/nf-interpreter/pull/163)
+- Lineup the sys tick configurations on all reference boards [\#156](https://github.com/nanoframework/nf-interpreter/pull/156)
+- Add code to check for valid CLR image and launch it [\#155](https://github.com/nanoframework/nf-interpreter/pull/155)
+- Revert ChibiOS setting for using classic periodic timer [\#153](https://github.com/nanoframework/nf-interpreter/pull/153)
+- Add STM32F429I\_DISCOVERY board [\#147](https://github.com/nanoframework/nf-interpreter/pull/147) [[Area: STM32-ChibiOS](https://github.com/nanoframework/nf-interpreter/labels/Area:%20STM32-ChibiOS)]
+- Implement HAL\_Time\_TicksToTimeMilliSec [\#145](https://github.com/nanoframework/nf-interpreter/pull/145)
+- Moved include of target\_board header to targetHAL [\#144](https://github.com/nanoframework/nf-interpreter/pull/144)
+- Deleted nanoCLR.VC.db [\#138](https://github.com/nanoframework/nf-interpreter/pull/138)
+- Fixes \#81 [\#137](https://github.com/nanoframework/nf-interpreter/pull/137)
+- Resolves \#133 [\#135](https://github.com/nanoframework/nf-interpreter/pull/135)
+- Rename FLASH in HAL\_SYSTEM\_CONFIG struct [\#129](https://github.com/nanoframework/nf-interpreter/pull/129) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Add logo in common size \(32x32\) [\#117](https://github.com/nanoframework/nf-interpreter/pull/117)
+- Correct "source" directory references in \/CMakeLists.txt \#96 [\#111](https://github.com/nanoframework/nf-interpreter/pull/111)
+- Rename nanoCLR [\#105](https://github.com/nanoframework/nf-interpreter/pull/105)
+- Added empty line to make GitHub diff happy [\#103](https://github.com/nanoframework/nf-interpreter/pull/103)
+- Correct buffer size for ST\_NUCLEO\_F091RC [\#102](https://github.com/nanoframework/nf-interpreter/pull/102)
+- Add Monitor\_Reboot command [\#100](https://github.com/nanoframework/nf-interpreter/pull/100)
+- \[WIP\] nanoCLR [\#95](https://github.com/nanoframework/nf-interpreter/pull/95)
+- Fixed copyright notice in CMakeLists [\#94](https://github.com/nanoframework/nf-interpreter/pull/94)
+- Fixed project name [\#88](https://github.com/nanoframework/nf-interpreter/pull/88)
+- Import cmake build [\#84](https://github.com/nanoframework/nf-interpreter/pull/84)
+- Renamed keepers to maintainers, fixed links [\#75](https://github.com/nanoframework/nf-interpreter/pull/75)
+- Updated organization name nanoFramework [\#74](https://github.com/nanoframework/nf-interpreter/pull/74)
+- Updated copyright notice header format to handle partial content [\#66](https://github.com/nanoframework/nf-interpreter/pull/66)
+- Fix 58 [\#63](https://github.com/nanoframework/nf-interpreter/pull/63) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Fix variable names in WireProtocol\_Receiver [\#60](https://github.com/nanoframework/nf-interpreter/pull/60) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- Added Developer Certificate of Origin documentation [\#52](https://github.com/nanoframework/nf-interpreter/pull/52)
+- Updated copyright notice header format [\#49](https://github.com/nanoframework/nf-interpreter/pull/49)
+- Add official logo files [\#36](https://github.com/nanoframework/nf-interpreter/pull/36)
+- Updated README-s [\#34](https://github.com/nanoframework/nf-interpreter/pull/34)
+- \[WIP\] nanoBooter mbed-os sample implementation [\#32](https://github.com/nanoframework/nf-interpreter/pull/32) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- \[WIP\] Wire protocol proof-of-concept [\#31](https://github.com/nanoframework/nf-interpreter/pull/31) [[Area: Interpreter](https://github.com/nanoframework/nf-interpreter/labels/Area:%20Interpreter)]
+- cosmetic changes in doc [\#29](https://github.com/nanoframework/nf-interpreter/pull/29)
+- add preliminary versions of documentation [\#25](https://github.com/nanoframework/nf-interpreter/pull/25)
+- update information about build deliverables [\#24](https://github.com/nanoframework/nf-interpreter/pull/24)
+- Small correction on typos [\#17](https://github.com/nanoframework/nf-interpreter/pull/17)
+- Add support for STM32F0 series [\#13](https://github.com/nanoframework/nf-interpreter/pull/13)
+- Add readme file to perform as documentation index [\#12](https://github.com/nanoframework/nf-interpreter/pull/12)
+- Add preliminary version of documentation with build and VS Code debug instructions [\#11](https://github.com/nanoframework/nf-interpreter/pull/11)
+- Initial works on CMake build and debug for VS Code [\#10](https://github.com/nanoframework/nf-interpreter/pull/10)
+- Added README-s, LICENSE and CONTRIBUTORS [\#1](https://github.com/nanoframework/nf-interpreter/pull/1)
+
+
+
+\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\ No newline at end of file
diff --git a/source/native/nf-interpreter/CMake/ChibiOS-Contrib.CMakeLists.cmake.in b/source/native/nf-interpreter/CMake/ChibiOS-Contrib.CMakeLists.cmake.in
new file mode 100644
index 00000000..e0e66965
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/ChibiOS-Contrib.CMakeLists.cmake.in
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 2.8.2)
+
+project(ChibiOS-Contrib-download NONE)
+
+include(ExternalProject)
+
+# download ChibiOS Community contributions source from GitHub repo
+# need to specify nanoframework as the active branch
+ExternalProject_Add(
+ ChibiOS-Contrib
+ PREFIX ChibiOS-Contrib
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/ChibiOS-Contrib_Source
+ GIT_REPOSITORY https://github.com/nanoframework/ChibiOS-Contrib
+ GIT_TAG nanoframework # target specified branch
+ GIT_SHALLOW 1 # download only the tip of the branch, not the complete history
+ TIMEOUT 10
+ LOG_DOWNLOAD 1
+ # Disable all other steps
+ INSTALL_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+)
diff --git a/source/native/nf-interpreter/CMake/ChibiOS.CMakeLists.cmake.in b/source/native/nf-interpreter/CMake/ChibiOS.CMakeLists.cmake.in
new file mode 100644
index 00000000..eaf0b167
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/ChibiOS.CMakeLists.cmake.in
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 2.8.2)
+
+project(ChibiOS-download NONE)
+
+include(ExternalProject)
+
+# download ChibiOS source from official SVN repo
+ExternalProject_Add(
+ ChibiOS
+ PREFIX ChibiOS
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/ChibiOS_Source
+ GIT_REPOSITORY https://github.com/nanoframework/chibios
+ GIT_TAG ${CHIBIOS_GIT_TAG} # target specified branch
+ GIT_SHALLOW 1 # download only the tip of the branch, not the complete history
+ TIMEOUT 10
+ LOG_DOWNLOAD 1
+ # Disable all other steps
+ INSTALL_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+)
diff --git a/source/native/nf-interpreter/CMake/ChibiOS_target_os.h.in b/source/native/nf-interpreter/CMake/ChibiOS_target_os.h.in
new file mode 100644
index 00000000..1621ff73
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/ChibiOS_target_os.h.in
@@ -0,0 +1,33 @@
+//
+// Copyright (c) 2017 The nanoFramework project contributors
+// See LICENSE file in the project root for full license information.
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// This file was automatically generated by a tool. //
+// Any changes you make here will be overwritten when it's generated again. //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef _TARGET_OS_H_
+#define _TARGET_OS_H_
+
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+
+#define VERSION_MAJOR @nanoFramework_VERSION_MAJOR@U
+#define VERSION_MINOR @nanoFramework_VERSION_MINOR@U
+#define VERSION_BUILD @nanoFramework_VERSION_PATCH@U
+#define VERSION_REVISION @nanoFramework_VERSION_TWEAK@U
+
+#define NANOCLR_LIGHT_MATH @TARGET_LIGHT_MATH@
+#define DP_FLOATINGPOINT @TARGET_DP_FLOATINGPOINT@
+
+#define SUPPORT_ANY_BASE_CONVERSION @TARGET_SUPPORT_ANY_BASE_CONVERSION@
+
+#define HAS_CONFIG_BLOCK @TARGET_HAS_CONFIG_BLOCK@
+
+#define NANOCLR_REFLECTION @TARGET_NANOCLR_REFLECTION@
+
+#define NANOCLR_SYSTEM_COLLECTIONS @TARGET_SYSTEM_COLLECTIONS@
+
+#endif /* _TARGET_OS_H_ */
diff --git a/source/native/nf-interpreter/CMake/ESP32_target_os.h.in b/source/native/nf-interpreter/CMake/ESP32_target_os.h.in
new file mode 100644
index 00000000..1ae5bc75
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/ESP32_target_os.h.in
@@ -0,0 +1,30 @@
+//
+// Copyright (c) 2017 The nanoFramework project contributors
+// See LICENSE file in the project root for full license information.
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// This file was automatically generated by a tool. //
+// Any changes you make here will be overwritten when it's generated again. //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef _TARGET_OS_H_
+#define _TARGET_OS_H_
+
+#define VERSION_MAJOR @nanoFramework_VERSION_MAJOR@U
+#define VERSION_MINOR @nanoFramework_VERSION_MINOR@U
+#define VERSION_BUILD @nanoFramework_VERSION_PATCH@U
+#define VERSION_REVISION @nanoFramework_VERSION_TWEAK@U
+
+#define NANOCLR_LIGHT_MATH @TARGET_LIGHT_MATH@
+#define DP_FLOATINGPOINT @TARGET_DP_FLOATINGPOINT@
+
+#define SUPPORT_ANY_BASE_CONVERSION @TARGET_SUPPORT_ANY_BASE_CONVERSION@
+
+#define HAS_CONFIG_BLOCK @TARGET_HAS_CONFIG_BLOCK@
+
+#define NANOCLR_REFLECTION @TARGET_NANOCLR_REFLECTION@
+
+#define NANOCLR_SYSTEM_COLLECTIONS @TARGET_SYSTEM_COLLECTIONS@
+
+#endif /* _TARGET_OS_H_ */
diff --git a/source/native/nf-interpreter/CMake/FreeRTOS.CMakeLists.cmake.in b/source/native/nf-interpreter/CMake/FreeRTOS.CMakeLists.cmake.in
new file mode 100644
index 00000000..ac289de6
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/FreeRTOS.CMakeLists.cmake.in
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 2.8.2)
+
+project(FreeRTOS-download NONE)
+
+include(ExternalProject)
+
+# download FreeRTOS source from official Amazon GitHub repo
+ExternalProject_Add(
+ FreeRTOS
+ PREFIX FreeRTOS
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/FreeRTOS_Source
+ GIT_REPOSITORY https://github.com/aws/amazon-freertos.git
+ GIT_TAG ${FREERTOS_VERSION_TAG} # target specified branch
+ GIT_SHALLOW 1 # download only the tip of the branch, not the complete history
+ TIMEOUT 10
+ LOG_DOWNLOAD 1
+ # Disable all other steps
+ INSTALL_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+)
diff --git a/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F0xx_GCC_options.cmake b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F0xx_GCC_options.cmake
new file mode 100644
index 00000000..7b89de2b
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F0xx_GCC_options.cmake
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+#################################################################
+# WHEN ADDING A NEW SERIES add the appropriate GCC options below
+#################################################################
+
+# need to specify this for assembler
+set(CMAKE_ASM_FLAGS " -mthumb -mcpu=cortex-m0 -mfloat-abi=soft -mabi=aapcs -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
+
+# need to specify linker flags here
+set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -Wl,--print-memory-usage -mthumb -mcpu=cortex-m0 -mfloat-abi=soft -mabi=aapcs -nostartfiles " CACHE INTERNAL "executable linker flags")
+
+
+function(NF_SET_COMPILER_OPTIONS TARGET)
+
+ # include any extra options coming from any extra args?
+ target_compile_options(${TARGET} PUBLIC ${ARGN} -mthumb -mcpu=cortex-m0 -mabi=aapcs -nostdlib -Wall -Wextra -Werror -ffunction-sections -fshort-wchar -falign-functions=16 -fdata-sections -fno-builtin -fno-common -fomit-frame-pointer -mlong-calls -fdollars-in-identifiers -fno-exceptions -fno-unroll-loops -frounding-math -fsignaling-nans -ffloat-store -fno-math-errno -ftree-vectorize -fcheck-new )
+
+ # this series doesn't have FPU
+ target_compile_definitions(${TARGET} PUBLIC -DCORTEX_USE_FPU=FALSE)
+
+endfunction()
+
+
+function(NF_SET_LINKER_OPTIONS TARGET)
+
+ # request specs from newlib nano
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " --specs=nano.specs ")
+
+ # set extra linker flags
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${ARGN}")
+
+ # set optimization linker flags for RELEASE and MinSizeRel
+ if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-linker-plugin -Os")
+ endif()
+
+ # set optimization flags
+ nf_set_optimization_options(${TARGET})
+
+ # set link map
+ nf_set_link_map(${TARGET})
+
+endfunction()
diff --git a/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F0xx_sources.cmake b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F0xx_sources.cmake
new file mode 100644
index 00000000..86a435fc
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F0xx_sources.cmake
@@ -0,0 +1,138 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# from startup_stm32f0xx.mk
+# List of the ChibiOS generic STM32F0xx startup and CMSIS files.
+
+################################################################################
+# WHEN ADDING A NEW BOARD add the source code file for the STM32F0xx\platform.mk
+################################################################################
+
+set(CHIBIOS_PORT_SRCS
+ # startup code
+ crt1.c
+ vectors.S
+ crt0_v6m.S
+
+ nvic.c
+ stm32_isr.c
+ hal_lld.c
+
+ hal_adc_lld.c
+ hal_can_lld.c
+ hal_dac_lld.c
+ stm32_dma.c
+ stm32_exti.c
+ hal_pal_lld.c
+ hal_i2c_lld.c
+ hal_rtc_lld.c
+
+ hal_i2s_lld.c
+ hal_spi_lld.c
+
+ hal_st_lld.c
+ hal_gpt_lld.c
+ hal_icu_lld.c
+ hal_pwm_lld.c
+
+ hal_serial_lld.c
+ hal_uart_lld.c
+
+ hal_usb_lld.c
+
+ hal_wdg_lld.c
+
+ # RT
+ chcore.c
+ chcore_v6m.c
+ chcoreasm_v6m.S
+)
+
+foreach(SRC_FILE ${CHIBIOS_PORT_SRCS})
+ set(CHIBIOS_F0_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(CHIBIOS_F0_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx/compilers/GCC
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/common/ARMCMx
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/STM32F0xx
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/ADCv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CANv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DACv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DMAv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/EXTIv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/GPIOv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SPIv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/TIMv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USARTv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USBv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/xWDGv1
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${CHIBIOS_F0_SRC_FILE}") # debug helper
+ list(APPEND CHIBIOS_SOURCES ${CHIBIOS_F0_SRC_FILE})
+endforeach()
+
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/portability/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/devices/STM32F0xx)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/ARM/CMSIS/Core/Include)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/ST/STM32F0xx)
+
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/ADCv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CANv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DACv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DMAv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/EXTIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/GPIOv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SPIv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/TIMv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USARTv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USBv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/xWDGv1)
+
+
+####################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the include directory(ies) below
+####################################################################################
+# component STM32_FLASH
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FLASHv1)
+# component STM32_CRC
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/CRCv1)
+# component STM32_ONEWIRE
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1)
+
+###############################################################################################################################
+# Add above the required include directory(ies) for a new nanoFramework overlay component that you are adding
+# following the template below.
+#
+# list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/)
+###############################################################################################################################
+
+
+####################################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the source file(s) specific to this series below
+####################################################################################################
+# component STM32_FLASH
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FLASHv1/flash_lld.c)
+# component STM32_CRC
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/CRCv1/crc_lld.c)
+# component STM32_ONEWIRE
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c)
+
+##########################################################################################################################
+# Add above ALL the source code file(s) low level driver specif for a series required for a new nanoFramework
+# overlay component that you are adding following the template below.
+#
+# list(APPEND CHIBIOS_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/)
+##########################################################################################################################
diff --git a/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F4xx_GCC_options.cmake b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F4xx_GCC_options.cmake
new file mode 100644
index 00000000..a7d444ba
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F4xx_GCC_options.cmake
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+#################################################################
+# WHEN ADDING A NEW SERIES add the appropriate GCC options below
+#################################################################
+
+# need to specify this for assembler
+set(CMAKE_ASM_FLAGS " -mthumb -mcpu=cortex-m4 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
+
+# need to specify linker flags here
+set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -Wl,--print-memory-usage -mthumb -mcpu=cortex-m4 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mabi=aapcs -nostartfiles " CACHE INTERNAL "executable linker flags")
+
+
+function(NF_SET_COMPILER_OPTIONS TARGET)
+
+ # include any extra options coming from any extra args?
+ target_compile_options(${TARGET} PUBLIC ${ARGN} -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mabi=aapcs -nostdlib -Wall -Wextra -Werror -ffunction-sections -fshort-wchar -falign-functions=16 -fdata-sections -fno-builtin -fno-common -fomit-frame-pointer -mlong-calls -fdollars-in-identifiers -fno-exceptions -fno-unroll-loops -frounding-math -fsignaling-nans -ffloat-store -fno-math-errno -ftree-vectorize -fcheck-new )
+
+ # this series has FPU
+ target_compile_definitions(${TARGET} PUBLIC -DCORTEX_USE_FPU=TRUE)
+
+endfunction()
+
+
+function(NF_SET_LINKER_OPTIONS TARGET)
+
+ # request specs from newlib nano
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " --specs=nano.specs ")
+
+ # set extra linker flags
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${ARGN}")
+
+ # set optimization linker flags for RELEASE and MinSizeRel
+ if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-linker-plugin -Os")
+ endif()
+
+ # set optimization flags
+ nf_set_optimization_options(${TARGET})
+
+ # set link map
+ nf_set_link_map(${TARGET})
+
+endfunction()
diff --git a/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F4xx_sources.cmake b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F4xx_sources.cmake
new file mode 100644
index 00000000..8a25d5ea
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F4xx_sources.cmake
@@ -0,0 +1,166 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# from startup_stm32f4xx.mk
+# List of the ChibiOS generic STM32F4xx startup and CMSIS files.
+
+################################################################################################
+# WHEN ADDING A NEW BOARD add the source code file for the hal/ports/STM32/STM32F4xx/platform.mk
+################################################################################################
+
+set(CHIBIOS_PORT_SRCS
+ # startup code
+ crt1.c
+ vectors.S
+ crt0_v7m.S
+
+ nvic.c
+ stm32_isr.c
+ hal_lld.c
+
+ hal_adc_lld.c
+ hal_can_lld.c
+ hal_crypto_lld.c
+ hal_dac_lld.c
+ stm32_dma.c
+ stm32_exti.c
+ hal_pal_lld.c
+ hal_i2c_lld.c
+ hal_mac_lld.c
+ hal_usb_lld.c
+ hal_wspi_lld.c
+ hal_trng_lld.c
+ hal_rtc_lld.c
+ hal_sdc_lld.c
+
+ hal_i2s_lld.c
+ hal_spi_lld.c
+
+ hal_st_lld.c
+ hal_gpt_lld.c
+ hal_icu_lld.c
+ hal_pwm_lld.c
+
+ hal_serial_lld.c
+ hal_uart_lld.c
+
+ hal_wdg_lld.c
+
+ # RT
+ chcore.c
+ chcore_v7m.c
+ chcoreasm_v7m.S
+)
+
+foreach(SRC_FILE ${CHIBIOS_PORT_SRCS})
+ set(CHIBIOS_F4_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(CHIBIOS_F4_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx/compilers/GCC
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/common/ARMCMx
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/STM32F4xx
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/ADCv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CANv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CRYPv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DACv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DMAv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/EXTIv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/GPIOv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/MACv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/OTGv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/QUADSPIv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RNGv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SDIOv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SPIv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/TIMv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USARTv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/xWDGv1
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${CHIBIOS_F4_SRC_FILE}") # debug helper
+ list(APPEND CHIBIOS_SOURCES ${CHIBIOS_F4_SRC_FILE})
+endforeach()
+
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/portability/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/devices/STM32F4xx)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/ARM/CMSIS/Core/Include)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/ST/STM32F4xx)
+
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/ADCv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CANv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CRYPv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DACv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DMAv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/EXTIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/GPIOv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/MACv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/OTGv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/QUADSPIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RNGv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SDIOv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SPIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/TIMv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USARTv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/xWDGv1)
+
+
+####################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the include directory(ies) below
+####################################################################################
+# component STM32_FLASH
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FLASHv2)
+# component STM32_CRC
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/CRCv1)
+# component STM32_RNG
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/RNGv1)
+# component STM32_FSMC (Flexible Memory Controller)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1)
+# component STM32_ONEWIRE (One Wire driver)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1)
+# component STM32_QSPI (Quad-SPI)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/QSPIv1)
+
+###############################################################################################################################
+# Add above the required include directory(ies) for a new nanoFramework overlay component that you are adding
+# following the template below.
+#
+# list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/)
+###############################################################################################################################
+
+
+####################################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the source file(s) specific to this series below
+####################################################################################################
+# component STM32_FLASH
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FLASHv2/flash_lld.c)
+# component STM32_CRC
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/CRCv1/crc_lld.c)
+# component STM32_RNG
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/RNGv1/rng_lld.c)
+# component STM32_FSMC (Flexible Memory Controller)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1/fsmc_nand_lld.c)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1/fsmc_sdram_lld.c)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1/fsmc_sram_lld.c)
+# component STM32_ONEWIRE
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c)
+# component STM32_QSPI (Quad-SPI)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/QSPIv1/qspi_lld.c)
+
+##########################################################################################################################
+# Add above ALL the source code file(s) low level driver specif for a series required for a new nanoFramework
+# overlay component that you are adding following the template below.
+#
+# list(APPEND CHIBIOS_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/)
+##########################################################################################################################
diff --git a/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F7xx_GCC_options.cmake b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F7xx_GCC_options.cmake
new file mode 100644
index 00000000..5c901ec9
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F7xx_GCC_options.cmake
@@ -0,0 +1,48 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+#################################################################
+# WHEN ADDING A NEW SERIES add the appropriate GCC options below
+#################################################################
+
+# need to specify this for assembler
+set(CMAKE_ASM_FLAGS " -mthumb -mcpu=cortex-m7 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
+
+# need to specify linker flags here
+set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -Wl,--print-memory-usage -mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mabi=aapcs -nostartfiles " CACHE INTERNAL "executable linker flags")
+
+
+function(NF_SET_COMPILER_OPTIONS TARGET)
+
+ # include any extra options coming from any extra args?
+ # STMF7 cores have SP and DP, the default is SP. DP can be set if developer realy needs that.
+ target_compile_options(${TARGET} PUBLIC ${ARGN} -mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mabi=aapcs -nostdlib -Wall -Wextra -Werror -ffunction-sections -fshort-wchar -falign-functions=16 -fdata-sections -fno-builtin -fno-common -fomit-frame-pointer -mlong-calls -fdollars-in-identifiers -fno-exceptions -fno-unroll-loops -frounding-math -fsignaling-nans -ffloat-store -fno-math-errno -ftree-vectorize -fcheck-new )
+
+ # this series has FPU
+ target_compile_definitions(${TARGET} PUBLIC -DCORTEX_USE_FPU=TRUE)
+
+endfunction()
+
+
+function(NF_SET_LINKER_OPTIONS TARGET)
+
+ # request specs from newlib nano
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " --specs=nano.specs ")
+
+ # set extra linker flags
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${ARGN}")
+
+ # set optimization linker flags for RELEASE and MinSizeRel
+ if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-linker-plugin -Os")
+ endif()
+
+ # set optimization flags
+ nf_set_optimization_options(${TARGET})
+
+ # set link map
+ nf_set_link_map(${TARGET})
+
+endfunction()
diff --git a/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F7xx_sources.cmake b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F7xx_sources.cmake
new file mode 100644
index 00000000..f3b2ff2c
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32F7xx_sources.cmake
@@ -0,0 +1,168 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# from startup_stm32f7xx.mk
+# List of the ChibiOS generic STM32F7xx startup and CMSIS files.
+
+################################################################################################
+# WHEN ADDING A NEW BOARD add the source code file for the hal/ports/STM32/STM32F7xx/platform.mk
+################################################################################################
+
+set(CHIBIOS_PORT_SRCS
+ # startup code
+ crt1.c
+ vectors.S
+ crt0_v7m.S
+
+ nvic.c
+ stm32_isr.c
+ hal_lld.c
+
+ hal_adc_lld.c
+ hal_can_lld.c
+ hal_crypto_lld.c
+ hal_dac_lld.c
+ stm32_dma.c
+ stm32_exti.c
+ hal_pal_lld.c
+ hal_i2c_lld.c
+ hal_mac_lld.c
+ hal_usb_lld.c
+ hal_wspi_lld.c
+ hal_trng_lld.c
+ hal_rtc_lld.c
+ hal_sdc_lld.c
+
+ hal_i2s_lld.c
+ hal_spi_lld.c
+
+ hal_st_lld.c
+ hal_gpt_lld.c
+ hal_icu_lld.c
+ hal_pwm_lld.c
+
+ hal_serial_lld.c
+ hal_uart_lld.c
+
+ hal_wdg_lld.c
+
+ # RT
+ chcore.c
+ chcore_v7m.c
+ chcoreasm_v7m.S
+)
+
+foreach(SRC_FILE ${CHIBIOS_PORT_SRCS})
+ set(CHIBIOS_F7_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(CHIBIOS_F7_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx/compilers/GCC
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/common/ARMCMx
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/STM32F7xx
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/ADCv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CANv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CRYPv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DACv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DMAv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/EXTIv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/GPIOv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/MACv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/OTGv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/QUADSPIv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RNGv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SDMMCv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SPIv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/TIMv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USARTv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/xWDGv1
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${CHIBIOS_F7_SRC_FILE}") # debug helper
+ list(APPEND CHIBIOS_SOURCES ${CHIBIOS_F7_SRC_FILE})
+endforeach()
+
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/portability/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/devices/STM32F7xx)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/ARM/CMSIS/Core/Include)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/ST/STM32F7xx)
+
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/ADCv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CANv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CRYPv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DACv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DMAv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/EXTIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/GPIOv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/MACv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/OTGv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/QUADSPIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RNGv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SDMMCv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SPIv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/TIMv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USARTv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/xWDGv1)
+
+
+####################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the include directory(ies) below
+####################################################################################
+# component STM32_FLASH
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FLASHv2)
+# component STM32_CRC
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/CRCv1)
+# component STM32_RNG
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/RNGv1)
+# component STM32_FSMC (Flexible Memory Controller)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1)
+# component STM32_ONEWIRE
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1)
+# component STM32_QSPI (Quad-SPI)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/QSPIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/STM32_CubePackage_Source/Drivers/STM32F7xx_HAL_Driver/Inc")
+
+###############################################################################################################################
+# Add above the required include directory(ies) for a new nanoFramework overlay component that you are adding
+# following the template below.
+#
+# list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/)
+###############################################################################################################################
+
+
+####################################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the source file(s) specific to this series below
+####################################################################################################
+# component STM32_FLASH
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FLASHv2/flash_lld.c)
+# component STM32_CRC
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/CRCv1/crc_lld.c)
+# component STM32_RNG
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/RNGv1/rng_lld.c)
+# component STM32_FSMC (Flexible Memory Controller)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1/fsmc_nand_lld.c)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1/fsmc_sdram_lld.c)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1/fsmc_sram_lld.c)
+# component STM32_ONEWIRE
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c)
+# component STM32_QSPI (Quad-SPI)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/QSPIv1/qspi_lld.c)
+
+##########################################################################################################################
+# Add above ALL the source code file(s) low level driver specif for a series required for a new nanoFramework
+# overlay component that you are adding following the template below.
+#
+# list(APPEND CHIBIOS_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/)
+##########################################################################################################################
diff --git a/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32H7xx_GCC_options.cmake b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32H7xx_GCC_options.cmake
new file mode 100644
index 00000000..5c901ec9
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32H7xx_GCC_options.cmake
@@ -0,0 +1,48 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+#################################################################
+# WHEN ADDING A NEW SERIES add the appropriate GCC options below
+#################################################################
+
+# need to specify this for assembler
+set(CMAKE_ASM_FLAGS " -mthumb -mcpu=cortex-m7 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
+
+# need to specify linker flags here
+set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -Wl,--print-memory-usage -mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mabi=aapcs -nostartfiles " CACHE INTERNAL "executable linker flags")
+
+
+function(NF_SET_COMPILER_OPTIONS TARGET)
+
+ # include any extra options coming from any extra args?
+ # STMF7 cores have SP and DP, the default is SP. DP can be set if developer realy needs that.
+ target_compile_options(${TARGET} PUBLIC ${ARGN} -mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mabi=aapcs -nostdlib -Wall -Wextra -Werror -ffunction-sections -fshort-wchar -falign-functions=16 -fdata-sections -fno-builtin -fno-common -fomit-frame-pointer -mlong-calls -fdollars-in-identifiers -fno-exceptions -fno-unroll-loops -frounding-math -fsignaling-nans -ffloat-store -fno-math-errno -ftree-vectorize -fcheck-new )
+
+ # this series has FPU
+ target_compile_definitions(${TARGET} PUBLIC -DCORTEX_USE_FPU=TRUE)
+
+endfunction()
+
+
+function(NF_SET_LINKER_OPTIONS TARGET)
+
+ # request specs from newlib nano
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " --specs=nano.specs ")
+
+ # set extra linker flags
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${ARGN}")
+
+ # set optimization linker flags for RELEASE and MinSizeRel
+ if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-linker-plugin -Os")
+ endif()
+
+ # set optimization flags
+ nf_set_optimization_options(${TARGET})
+
+ # set link map
+ nf_set_link_map(${TARGET})
+
+endfunction()
diff --git a/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32H7xx_sources.cmake b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32H7xx_sources.cmake
new file mode 100644
index 00000000..d31fd89e
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32H7xx_sources.cmake
@@ -0,0 +1,165 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# from os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32h7xx.mk
+# List of the ChibiOS generic STM32H7xx startup and CMSIS files.
+
+################################################################################################
+# WHEN ADDING A NEW BOARD add the source code file for the hal/ports/STM32/STM32H7xx/platform.mk
+################################################################################################
+
+set(CHIBIOS_PORT_SRCS
+ # startup code
+ crt1.c
+ vectors.S
+ crt0_v7m.S
+
+ nvic.c
+ stm32_isr.c
+ hal_lld.c
+
+ hal_adc_lld.c
+ hal_can_lld.c
+ hal_crypto_lld.c
+ hal_dac_lld.c
+ stm32_dma.c
+ stm32_exti.c
+ hal_pal_lld.c
+ hal_i2c_lld.c
+ hal_mac_lld.c
+ hal_usb_lld.c
+ hal_wspi_lld.c
+ hal_trng_lld.c
+ hal_rtc_lld.c
+ hal_sdc_lld.c
+
+ hal_i2s_lld.c
+ hal_spi_lld.c
+
+ hal_st_lld.c
+ hal_gpt_lld.c
+ hal_icu_lld.c
+ hal_pwm_lld.c
+
+ hal_serial_lld.c
+ hal_uart_lld.c
+
+ hal_wdg_lld.c
+
+ # RT
+ chcore.c
+ chcore_v7m.c
+ chcoreasm_v7m.S
+)
+
+foreach(SRC_FILE ${CHIBIOS_PORT_SRCS})
+ set(CHIBIOS_H7_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(CHIBIOS_H7_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx/compilers/GCC
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/common/ARMCMx
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/STM32H7xx
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/ADCv4
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CANv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CRYPv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DACv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DMAv3
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/EXTIv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/GPIOv3
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv3
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/MACv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/OTGv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/QUADSPIv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RNGv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SDMMCv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SPIv3
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/TIMv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USARTv2
+ # ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USBv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/xWDGv1
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${CHIBIOS_H7_SRC_FILE}") # debug helper
+ list(APPEND CHIBIOS_SOURCES ${CHIBIOS_H7_SRC_FILE})
+endforeach()
+
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/portability/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/devices/STM32H7xx)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/ARM/CMSIS/Core/Include)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/ST/STM32H7xx)
+
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/ADCv4)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CANv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CRYPv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DACv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DMAv3)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/EXTIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/GPIOv3)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv3)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/MACv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/OTGv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/QUADSPIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RNGv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SDMMCv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SPIv3)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/TIMv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USARTv2)
+# list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USBv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/xWDGv1)
+
+
+####################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the include directory(ies) below
+####################################################################################
+# component STM32_FLASH
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FLASHv2)
+# component STM32_CRC
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/CRCv1)
+# component STM32_RNG
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/RNGv1)
+# component STM32_FSMC (Flexible Memory Controller)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1)
+# component STM32_ONEWIRE
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1)
+
+###############################################################################################################################
+# Add above the required include directory(ies) for a new nanoFramework overlay component that you are adding
+# following the template below.
+#
+# list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/)
+###############################################################################################################################
+
+
+####################################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the source file(s) specific to this series below
+####################################################################################################
+# component STM32_FLASH
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FLASHv2/flash_lld.c)
+# component STM32_CRC
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/CRCv1/crc_lld.c)
+# component STM32_RNG
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/RNGv1/rng_lld.c)
+# component STM32_FSMC (Flexible Memory Controller)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1/fsmc_nand_lld.c)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1/fsmc_sdram_lld.c)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FSMCv1/fsmc_sram_lld.c)
+# component STM32_ONEWIRE
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c)
+
+##########################################################################################################################
+# Add above ALL the source code file(s) low level driver specif for a series required for a new nanoFramework
+# overlay component that you are adding following the template below.
+#
+# list(APPEND CHIBIOS_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/)
+##########################################################################################################################
diff --git a/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32L0xx_GCC_options.cmake b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32L0xx_GCC_options.cmake
new file mode 100644
index 00000000..a2bd1ea3
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32L0xx_GCC_options.cmake
@@ -0,0 +1,51 @@
+#
+# Copyright (c) 2018 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+#################################################################
+# WHEN ADDING A NEW SERIES add the appropriate GCC options below
+#################################################################
+
+# need to specify this for assembler
+#####################################################################
+# because nanoCLR is loaded the VTOR has to be init in ChibiOS CRT0
+# this define has to be placed here because it's on an assembly file
+#####################################################################
+set(CMAKE_ASM_FLAGS " -mthumb -mcpu=cortex-m0plus -mfloat-abi=soft -mabi=aapcs -mtune=cortex-m0plus -x assembler-with-cpp -DCRT0_VTOR_INIT=TRUE" CACHE INTERNAL "asm compiler flags")
+
+# need to specify linker flags here
+set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -Wl,--print-memory-usage -mthumb -mcpu=cortex-m0plus -mfloat-abi=soft -mabi=aapcs -mtune=cortex-m0plus -nostartfiles " CACHE INTERNAL "executable linker flags")
+
+
+function(NF_SET_COMPILER_OPTIONS TARGET)
+
+ # include any extra options coming from any extra args?
+ target_compile_options(${TARGET} PUBLIC ${ARGN} -mthumb -mcpu=cortex-m0plus -mfloat-abi=soft -mabi=aapcs -mtune=cortex-m0plus -nostdlib -Wall -Wextra -Werror -ffunction-sections -fshort-wchar -falign-functions=16 -fdata-sections -fno-builtin -fno-common -fomit-frame-pointer -mlong-calls -fdollars-in-identifiers -fno-exceptions -fno-unroll-loops -frounding-math -fsignaling-nans -ffloat-store -fno-math-errno -ftree-vectorize -fcheck-new )
+
+ # this series doesn't have FPU
+ target_compile_definitions(${TARGET} PUBLIC -DCORTEX_USE_FPU=FALSE)
+
+endfunction()
+
+
+function(NF_SET_LINKER_OPTIONS TARGET)
+
+ # request specs from newlib nano
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " --specs=nano.specs ")
+
+ # set extra linker flags
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${ARGN}")
+
+ # set optimization linker flags for RELEASE and MinSizeRel
+ if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-linker-plugin -Os")
+ endif()
+
+ # set optimization flags
+ nf_set_optimization_options(${TARGET})
+
+ # set link map
+ nf_set_link_map(${TARGET})
+
+endfunction()
diff --git a/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32L0xx_sources.cmake b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32L0xx_sources.cmake
new file mode 100644
index 00000000..fe07cfc4
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/CHIBIOS_STM32L0xx_sources.cmake
@@ -0,0 +1,142 @@
+#
+# Copyright (c) 2018 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# from startup_stm32l0xx.mk
+# List of the ChibiOS generic STM32L0xx startup and CMSIS files.
+
+################################################################################
+# WHEN ADDING A NEW BOARD add the source code file for the STM32L0xx\platform.mk
+################################################################################
+
+set(CHIBIOS_PORT_SRCS
+ # startup code
+ crt1.c
+ vectors.S
+ crt0_v6m.S
+
+ nvic.c
+ stm32_isr.c
+ hal_lld.c
+
+ hal_adc_lld.c
+ hal_can_lld.c
+ hal_dac_lld.c
+ stm32_dma.c
+ stm32_exti.c
+ hal_pal_lld.c
+ hal_i2c_lld.c
+ hal_rtc_lld.c
+
+ hal_i2s_lld.c
+ hal_spi_lld.c
+
+ hal_st_lld.c
+ hal_gpt_lld.c
+ hal_icu_lld.c
+ hal_pwm_lld.c
+
+ hal_serial_lld.c
+ hal_uart_lld.c
+
+ hal_usb_lld.c
+
+ hal_wdg_lld.c
+
+ # RT
+ chcore.c
+ chcore_v6m.c
+ chcoreasm_v6m.S
+)
+
+foreach(SRC_FILE ${CHIBIOS_PORT_SRCS})
+ set(CHIBIOS_L0_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(CHIBIOS_L0_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx/compilers/GCC
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/common/ARMCMx
+
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/STM32L0xx
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/ADCv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CANv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DACv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DMAv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/EXTIv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/GPIOv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SPIv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/TIMv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USARTv2
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USBv1
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/xWDGv1
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${CHIBIOS_L0_SRC_FILE}") # debug helper
+ list(APPEND CHIBIOS_SOURCES ${CHIBIOS_L0_SRC_FILE})
+endforeach()
+
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/portability/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/devices/STM32L0xx)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/ARM/CMSIS/Core/Include)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/ST/STM32L0xx)
+
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/ADCv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/CANv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DACv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/DMAv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/EXTIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/GPIOv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/RTCv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/SPIv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/TIMv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USARTv2)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/USBv1)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/xWDGv1)
+
+
+####################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the include directory(ies) below
+####################################################################################
+# component STM32_FLASH
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FLASHv3)
+# component STM32_CRC
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/CRCv1)
+# component STM32_RNG
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/RNGv1)
+# component STM32_ONEWIRE
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1)
+
+###############################################################################################################################
+# Add above the required include directory(ies) for a new nanoFramework overlay component that you are adding
+# following the template below.
+#
+# list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/)
+###############################################################################################################################
+
+
+####################################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the source file(s) specific to this series below
+####################################################################################################
+# component STM32_FLASH
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/FLASHv3/flash_lld.c)
+# component STM32_CRC
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/CRCv1/crc_lld.c)
+# component STM32_RNG
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/RNGv1/rng_lld.c)
+# component STM32_ONEWIRE
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c)
+
+##########################################################################################################################
+# Add above ALL the source code file(s) low level driver specif for a series required for a new nanoFramework
+# overlay component that you are adding following the template below.
+#
+# list(APPEND CHIBIOS_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/)
+##########################################################################################################################
diff --git a/source/native/nf-interpreter/CMake/Modules/FindBuildUtils.cmake b/source/native/nf-interpreter/CMake/Modules/FindBuildUtils.cmake
new file mode 100644
index 00000000..6373e03c
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindBuildUtils.cmake
@@ -0,0 +1,91 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+function(NF_GENERATE_DFU_PACKAGE FILE1 ADDRESS1 FILE2 ADDRESS2 OUTPUTFILENAME)
+
+ add_custom_command(
+
+ TARGET ${NANOCLR_PROJECT_NAME}.elf POST_BUILD
+
+ COMMAND ${TOOL_HEX2DFU_PREFIX}/hex2dfu
+
+ -b="${FILE1}" -a="${ADDRESS1}"
+ -b="${FILE2}" -a="${ADDRESS2}"
+ -o="${OUTPUTFILENAME}"
+
+ WORKING_DIRECTORY ${TOOL_HEX2DFU_PREFIX}
+
+ COMMENT "exporting bin files to DFU image"
+ )
+
+ # need to add a dependency of NANOCLR to NANOBOOTER because DFU util needs bin outputs of both targets
+ add_dependencies(${NANOCLR_PROJECT_NAME}.elf ${NANOBOOTER_PROJECT_NAME}.elf)
+
+endfunction()
+
+function(NF_GENERATE_BUILD_OUTPUT_FILES TARGET)
+
+ # need to remove the .elf suffix from target name
+ string(FIND ${TARGET} "." TARGET_EXTENSION_DOT_INDEX)
+ string(SUBSTRING ${TARGET} 0 ${TARGET_EXTENSION_DOT_INDEX} TARGET_SHORT)
+
+ set(TARGET_HEX_FILE ${PROJECT_BINARY_DIR}/${TARGET_SHORT}.hex)
+ set(TARGET_S19_FILE ${PROJECT_BINARY_DIR}/${TARGET_SHORT}.s19)
+ set(TARGET_BIN_FILE ${PROJECT_BINARY_DIR}/${TARGET_SHORT}.bin)
+ set(TARGET_DUMP_FILE ${PROJECT_BINARY_DIR}/${TARGET_SHORT}.lst)
+
+ if(CMAKE_BUILD_TYPE EQUAL "Release" OR CMAKE_BUILD_TYPE EQUAL "MinSizeRel")
+
+ add_custom_command(TARGET ${TARGET_SHORT}.elf POST_BUILD
+ # copy target image to other formats
+ COMMAND ${CMAKE_OBJCOPY} -Oihex $ ${TARGET_HEX_FILE}
+ COMMAND ${CMAKE_OBJCOPY} -Osrec $ ${TARGET_S19_FILE}
+ COMMAND ${CMAKE_OBJCOPY} -Obinary $ ${TARGET_BIN_FILE}
+
+ # copy target file to build folder (this is only usefull for debugging in VS Code because of path in launch.json)
+ COMMAND ${CMAKE_OBJCOPY} $ ${PROJECT_SOURCE_DIR}/build/${TARGET_SHORT}.elf
+
+ COMMENT "Generate nanoBooter HEX and BIN files for deployment")
+
+ else()
+
+ add_custom_command(TARGET ${TARGET_SHORT}.elf POST_BUILD
+ # copy target image to other formats
+ COMMAND ${CMAKE_OBJCOPY} -Oihex $ ${TARGET_HEX_FILE}
+ COMMAND ${CMAKE_OBJCOPY} -Osrec $ ${TARGET_S19_FILE}
+ COMMAND ${CMAKE_OBJCOPY} -Obinary $ ${TARGET_BIN_FILE}
+
+ # copy target file to build folder (this is only usefull for debugging in VS Code because of path in launch.json)
+ COMMAND ${CMAKE_OBJCOPY} $ ${PROJECT_SOURCE_DIR}/build/${TARGET_SHORT}.elf
+
+ # dump target image as source code listing
+ # ONLY when DEBUG info is available, this is on 'Debug' and 'RelWithDebInfo'
+ COMMAND ${CMAKE_OBJDUMP} -d -EL -S $ > ${TARGET_DUMP_FILE}
+
+ COMMENT "Generate nanoBooter HEX and BIN files for deployment, LST file for debug")
+
+ endif()
+
+ nf_add_hex_bin_dump_targets(${TARGET})
+
+ # add this to print the size of the output targets
+ nf_print_size_of_targets(${TARGET})
+
+endfunction()
+
+
+#######################################################################################################################################
+# this function sets the linker options AND a specific linker file (full path and name, including extension)
+function(NF_SET_LINKER_OPTIONS_AND_FILE TARGET LINKER_FILE_NAME)
+
+ get_target_property(TARGET_LD_FLAGS ${TARGET} LINK_FLAGS)
+ if(TARGET_LD_FLAGS)
+ set(TARGET_LD_FLAGS "-T${LINKER_FILE_NAME} ${TARGET_LD_FLAGS}")
+ else()
+ set(TARGET_LD_FLAGS "-T${LINKER_FILE_NAME}")
+ endif()
+ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS ${TARGET_LD_FLAGS})
+
+endfunction()
diff --git a/source/native/nf-interpreter/CMake/Modules/FindCHIBIOS.cmake b/source/native/nf-interpreter/CMake/Modules/FindCHIBIOS.cmake
new file mode 100644
index 00000000..41fca7de
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindCHIBIOS.cmake
@@ -0,0 +1,181 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+###################################################################################################################################
+# WHEN ADDING A NEW SERIES, add the respective name to the list below along with the CMake files with GCC options and source files
+###################################################################################################################################
+
+# check if the series name is supported
+
+set(CHIBIOS_STM_SUPPORTED_SERIES "STM32F0xx" "STM32F4xx" "STM32F7xx" "STM32H7xx" "TICC3200" CACHE INTERNAL "supported STM series names for ChibiOS")
+set(CHIBIOS_TI_SUPPORTED_SERIES "TICC3200" CACHE INTERNAL "supported TI series names for ChibiOS")
+
+list(FIND CHIBIOS_STM_SUPPORTED_SERIES ${TARGET_SERIES} TARGET_SERIES_NAME_INDEX)
+if(TARGET_SERIES_NAME_INDEX EQUAL -1)
+ # series is NOT supported by STM
+ # try TI
+ list(FIND CHIBIOS_TI_SUPPORTED_SERIES ${TARGET_SERIES} TARGET_SERIES_NAME_INDEX)
+ if(TARGET_SERIES_NAME_INDEX EQUAL -1)
+ message(FATAL_ERROR "\n\nSorry but the ${TARGET_SERIES} is not supported at this time...\nYou can wait for it to be added, or you might want to contribute by working on a PR for it.\n\n")
+ else()
+ # series is supported by TI
+ set(TARGET_VENDOR "TI" CACHE INTERNAL "target vendor is TI")
+ endif()
+else()
+ # series is supported by STM
+ set(TARGET_VENDOR "STM" CACHE INTERNAL "target vendor is STM")
+endif()
+
+# including here the CMake files for the source files specific to the target series
+include(CHIBIOS_${TARGET_SERIES}_sources)
+# and here the GCC options tuned for the target series
+include(CHIBIOS_${TARGET_SERIES}_GCC_options)
+
+# message("ChibiOS board series is ${TARGET_SERIES}") # debug helper
+
+# set include directories for ChibiOS
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/license)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/common/ARMCMx)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/include)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/boards/${CHIBIOS_BOARD})
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/osal/rt)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/oslib/include)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/rt/include)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/${TARGET_SERIES})
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ports/ARMCMx/compilers/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/abstractions/cmsis_os)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/startup/ARMCMx/compilers/GCC)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/CMSIS/include)
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/ext/CMSIS/ST/${TARGET_SERIES})
+
+# append dummy include directory when not using ChibiOS-Contrib
+if(NOT CHIBIOS_CONTRIB_REQUIRED)
+ list(APPEND CHIBIOS_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include/dummy_includes")
+endif()
+
+# append include directory for boards in the nanoFramework ChibiOS 'overlay'
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/boards/${CHIBIOS_BOARD})
+
+# append include directory for boards in the nanoFramework ChibiOS 'overlay' provideded by the community
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets-community/CMSIS-OS/ChibiOS/nf-overlay/os/hal/boards/${CHIBIOS_BOARD})
+
+#
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/common/ext/CMSIS/TI/${TARGET_SERIES})
+list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/common/startup/ARMCMx/devices/${TARGET_SERIES})
+
+
+# source files and GCC options according to target vendor and series
+
+# source files for ChibiOS
+set(CHIBIOS_SRCS
+ # HAL-OSAL files
+ hal.c
+ hal_st.c
+
+ hal_buffers.c
+ hal_queues.c
+ hal_mmcsd.c
+
+ hal_adc.c
+ hal_can.c
+ hal_crypto.c
+ hal_dac.c
+ hal_gpt.c
+ hal_i2c.c
+ hal_i2s.c
+ hal_icu.c
+ hal_mac.c
+ hal_mmc_spi.c
+ hal_pal.c
+ hal_pwm.c
+ hal_rtc.c
+ hal_sdc.c
+ hal_serial.c
+ hal_serial_usb.c
+ hal_sio.c
+ hal_spi.c
+ hal_trng.c
+ hal_uart.c
+ hal_usb.c
+ hal_wdg.c
+ hal_wspi.c
+
+ # OSAL RT
+ osal.c
+
+ # RT
+ chsys.c
+ chdebug.c
+ chtrace.c
+ chvt.c
+ chschd.c
+ chthreads.c
+ chtm.c
+ chstats.c
+ chregistry.c
+ chsem.c
+ chmtx.c
+ chcond.c
+ chevents.c
+ chmsg.c
+ chdynamic.c
+
+ chmboxes.c
+ chmemcore.c
+ chmemheaps.c
+ chmempools.c
+ chpipes.c
+ chfactory.c
+
+ # required to use malloc and other newlib stuff
+ syscalls.c
+
+ # CMSIS
+ cmsis_os.c
+
+ # board file(s)
+ board.c
+
+)
+
+foreach(SRC_FILE ${CHIBIOS_SRCS})
+ set(CHIBIOS_SRC_FILE SRC_FILE -NOTFOUND)
+ find_file(CHIBIOS_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/src
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/osal/rt
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/rt/src
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/oslib/src
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/common/abstractions/cmsis_os
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/various
+
+ # the following hint order is for the board.c file, it has to match the search order of the main CMake otherwise we'll pick one that is the pair
+ # this path hint is for OEM boards for which the board file(s) are probably located directly in the "target" folder along with remaining files
+ ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD}
+
+ # this path hint is for the alternative boards folder in the nanoFramework ChibiOS 'overlay'
+ ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/boards/${CHIBIOS_BOARD}
+
+ # this path hint is for the usual location of the board.c file
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/boards/${CHIBIOS_BOARD}
+
+ # this path hint is for the alternative boards folder in the nanoFramework ChibiOS 'overlay' provideded by the community
+ ${PROJECT_SOURCE_DIR}/targets-community/CMSIS-OS/ChibiOS/nf-overlay/os/hal/boards/${CHIBIOS_BOARD}
+
+ # this path hint is for Community provided boards that are located directly in the "targets-community" folder
+ ${PROJECT_SOURCE_DIR}/targets-community/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD}
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ #message("${SRC_FILE} >> ${CHIBIOS_SRC_FILE}") # debug helper
+ list(APPEND CHIBIOS_SOURCES ${CHIBIOS_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CHIBIOS DEFAULT_MSG CHIBIOS_INCLUDE_DIRS CHIBIOS_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindCHIBIOS_FATFS.cmake b/source/native/nf-interpreter/CMake/Modules/FindCHIBIOS_FATFS.cmake
new file mode 100644
index 00000000..1b2ae5e4
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindCHIBIOS_FATFS.cmake
@@ -0,0 +1,64 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar xvf ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/fatfs-0.13_patched.7z
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/
+)
+
+
+# List of the required FatFs include files.
+list(APPEND CHIBIOS_FATFS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/fatfs/src)
+
+
+set(FATFS_SRCS
+ # bindings
+ fatfs_syscall.c
+
+ # fatfs
+ ff.c
+ ffunicode.c
+)
+
+foreach(SRC_FILE ${FATFS_SRCS})
+ set(FATFS_SRC_FILE SRC_FILE -NOTFOUND)
+ find_file(FATFS_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/various/fatfs_bindings
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/fatfs/src
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${FATFS_SRC_FILE}") # debug helper
+ list(APPEND CHIBIOS_FATFS_SOURCES ${FATFS_SRC_FILE})
+endforeach()
+
+# fatfs_diskio is hacked because of USB Host, so we need to use the source from the appropriate location
+if(NF_FEATURE_HAS_USB_MSD)
+ # get it from ChibiOS contribution
+ list(APPEND CHIBIOS_FATFS_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/various/fatfs_bindings/fatfs_diskio.c)
+else()
+ # get it from standard ChibiOS
+ list(APPEND CHIBIOS_FATFS_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/various/fatfs_bindings/fatfs_diskio.c)
+endif()
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CHIBIOS_FATFS DEFAULT_MSG CHIBIOS_FATFS_INCLUDE_DIRS CHIBIOS_FATFS_SOURCES)
+
+# setup target to unzip ChibiOS external filesystem components
+add_custom_target( CHIBIOS_FILESYSTEM_COMPONENTS ALL )
+
+add_custom_command(TARGET CHIBIOS_FILESYSTEM_COMPONENTS
+PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E tar xvf ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/fatfs-0.13_patched.7z
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/
+ DEPENDS ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/fatfs-0.13_patched.7z
+
+ VERBATIM
+)
+
+# this depends on ChibiOS target being already downloaded
+add_dependencies(CHIBIOS_FILESYSTEM_COMPONENTS ChibiOS)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindCHIBIOS_LWIP.cmake b/source/native/nf-interpreter/CMake/Modules/FindCHIBIOS_LWIP.cmake
new file mode 100644
index 00000000..18c34782
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindCHIBIOS_LWIP.cmake
@@ -0,0 +1,233 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# extract LwIP source files
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar xvf ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip-2.0.3-patched.7z
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/
+)
+
+# List of the required lwIp include files.
+list(APPEND CHIBIOS_LWIP_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/Lwip)
+list(APPEND CHIBIOS_LWIP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/various)
+list(APPEND CHIBIOS_LWIP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/various/lwip_bindings)
+list(APPEND CHIBIOS_LWIP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/include)
+list(APPEND CHIBIOS_LWIP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/include/lwip)
+list(APPEND CHIBIOS_LWIP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/include/netif)
+list(APPEND CHIBIOS_LWIP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/include/posix)
+list(APPEND CHIBIOS_LWIP_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/DeviceInterfaces/Networking.Sntp)
+
+set(LWIP_SRCS
+
+ # sys_arch.c
+
+ # core
+ init.c
+ def.c
+ dns.c
+ inet_chksum.c
+ ip.c
+ mem.c
+ memp.c
+ netif.c
+ pbuf.c
+ raw.c
+ stats.c
+ sys.c
+ tcp.c
+ tcp_in.c
+ tcp_out.c
+ timeouts.c
+ udp.c
+
+ # ipv4
+ autoip.c
+ dhcp.c
+ etharp.c
+ icmp.c
+ igmp.c
+ ip4_frag.c
+ ip4.c
+ ip4_addr.c
+
+ # ip6
+ dhcp6.c
+ ethip6.c
+ icmp6.c
+ inet6.c
+ ip6.c
+ ip6_addr.c
+ ip6_frag.c
+ mld6.c
+ nd6.c
+
+ # api
+ api_lib.c
+ # api_msg.c
+ err.c
+ netbuf.c
+ netdb.c
+ netifapi.c
+ # sockets.c
+ tcpip.c
+
+ # api patched files for nanoframework
+ nf_api_msg.c
+ nf_sockets.c
+ nf_sys_arch.c
+
+ # bindings
+ nf_lwipthread.c
+
+ # platform implementations
+ platform_sys_arch.c
+
+ #extras
+ evtimer.c
+
+ # netif
+ ethernet.c
+ slipif.c
+
+ # 6LoWPAN
+ # lowpan6.c
+
+ # PPP
+ auth.c
+ ccp.c
+ chap-md5.c
+ chap_ms.c
+ chap-new.c
+ demand.c
+ eap.c
+ ecp.c
+ eui64.c
+ fsm.c
+ ipcp.c
+ ipv6cp.c
+ lcp.c
+ magic.c
+ mppe.c
+ multilink.c
+ ppp.c
+ pppapi.c
+ pppcrypt.c
+ pppoe.c
+ pppol2tp.c
+ pppos.c
+ upap.c
+ utils.c
+ vj.c
+
+ # PPP SSL
+ arc4.c
+ des.c
+ md4.c
+ md5.c
+ sha1.c
+
+ # APPS!
+
+ # SNMPv2c agent
+ # snmp_asn1.c
+ # snmp_core.c
+ # snmp_mib2.c
+ # snmp_mib2_icmp.c
+ # snmp_mib2_interfaces.c
+ # snmp_mib2_ip.c
+ # snmp_mib2_snmp.c
+ # snmp_mib2_system.c
+ # snmp_mib2_tcp.c
+ # snmp_mib2_udp.c
+ # snmp_msg.c
+ # snmpv3.c
+ # snmp_netconn.c
+ # snmp_pbuf_stream.c
+ # snmp_raw.c
+ # snmp_scalar.c
+ # snmp_table.c
+ # snmp_threadsync.c
+ # snmp_traps.c
+ # snmpv3_mbedtls.c
+ # snmpv3_dummy.c
+
+ # http server
+ # fs.c
+ # httpd.c
+
+ # iperf server
+ # lwiperf.c
+
+ # SNTP client
+ # this one is added below if NF_NETWORKING_SNTP option is ON
+ # sntp.c
+
+ # MDNS responder
+ mdns.c
+
+ # NetBIOS server
+ # netbiosns.c
+
+ # TFTP server
+ # tftp_server.c
+
+ # MQTT client
+ # mqtt.c
+)
+
+if(NF_NETWORKING_SNTP)
+ list(APPEND LWIP_SRCS sntp.c)
+endif()
+
+foreach(SRC_FILE ${LWIP_SRCS})
+ set(LWIP_SRC_FILE SRC_FILE -NOTFOUND)
+ find_file(LWIP_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/various
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/core
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/core/ipv4
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/core/ipv6
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/api
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/netif
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/netif/ppp
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/netif/ppp/polarssl
+
+ ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/Lwip
+ ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/Lwip
+
+ # APPS:
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/apps/snmp
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/apps/httpd
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/apps/lwiperf
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/apps/sntp
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/apps/mdns
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/apps/netbiosns
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/apps/tftp
+ ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/apps/mqtt
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${LWIP_SRC_FILE}") # debug helper
+ list(APPEND CHIBIOS_LWIP_SOURCES ${LWIP_SRC_FILE})
+endforeach()
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CHIBIOS_LWIP DEFAULT_MSG CHIBIOS_LWIP_INCLUDE_DIRS CHIBIOS_LWIP_SOURCES)
+
+# setup target to unzip ChibiOS external network components
+add_custom_target( CHIBIOS_NETWORK_COMPONENTS ALL )
+
+add_custom_command(TARGET CHIBIOS_NETWORK_COMPONENTS
+PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E tar xvf ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip-2.0.3-patched.7z
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/
+ DEPENDS ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip-2.0.3-patched.7z
+
+ VERBATIM
+)
+
+# this depends on ChibiOS target being already downloaded
+add_dependencies(CHIBIOS_NETWORK_COMPONENTS ChibiOS)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindChibiOS-Contrib.cmake b/source/native/nf-interpreter/CMake/Modules/FindChibiOS-Contrib.cmake
new file mode 100644
index 00000000..69c5d9ac
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindChibiOS-Contrib.cmake
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories for ChibiOS-Contrib
+
+# the path is one folder UP from the includes directory to allow a selective inclusion of our own hal_community.h
+list(APPEND CHIBIOS_CONTRIB_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/include)
+
+####################################################################################
+# WHEN ADDING A NEW ChibiOS-Contrib component add the include directory(ies) below
+####################################################################################
+# component IMACOMPONENT
+#list(APPEND CHIBIOS_CONTRIB_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/include/IMACOMPONENT)
+
+# USB Host v1
+list(APPEND CHIBIOS_CONTRIB_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/ports/STM32/LLD/USBHv1)
+
+
+####################################################################################################################################
+# Because we've "hacked" ChibiOS overlay mechanism used by the community contributions we can't add the "official" hal_community.c #
+# Instead we have to add the required and equivalent calls that exist in the official source file #
+# in our hal_community.c @ targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/hal_community.c #
+# the include paths are to be added to our hal_community.h @ targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include/hal_community.h #
+####################################################################################################################################
+
+
+####################################################################################################
+# WHEN ADDING A NEW ChibiOS-Contrib component add the source file(s) specific to it below
+####################################################################################################
+# component IMACOMPONENT
+# list(APPEND CHIBIOS_CONTRIB_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/src/IMACOMPONENT/source-file-1.c)
+# list(APPEND CHIBIOS_CONTRIB_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/src/IMACOMPONENT/source-file-2.c)
+# list(APPEND CHIBIOS_CONTRIB_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/src/IMACOMPONENT/source-file-3.c)
+
+# USB Host v1
+list(APPEND CHIBIOS_CONTRIB_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/src/hal_usbh.c)
+list(APPEND CHIBIOS_CONTRIB_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/src/usbh/hal_usbh_msd.c)
+list(APPEND CHIBIOS_CONTRIB_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/src/usbh/hal_usbh_desciter.c)
+list(APPEND CHIBIOS_CONTRIB_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/src/usbh/hal_usbh_hub.c)
+list(APPEND CHIBIOS_CONTRIB_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/src/hal_usb_msd.c)
+list(APPEND CHIBIOS_CONTRIB_SOURCES ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CHIBIOS_CONTRIB DEFAULT_MSG CHIBIOS_CONTRIB_INCLUDE_DIRS CHIBIOS_CONTRIB_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindChibiOSnfOverlay.cmake b/source/native/nf-interpreter/CMake/Modules/FindChibiOSnfOverlay.cmake
new file mode 100644
index 00000000..82aabec2
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindChibiOSnfOverlay.cmake
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories for ChibiOS nanoFramework Overlay
+list(APPEND ChibiOSnfOverlay_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include)
+
+####################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the include directory(ies) below
+####################################################################################
+# component STM32_FLASH
+list(APPEND ChibiOSnfOverlay_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include/stm32_flash)
+# component STM32_CRC
+list(APPEND ChibiOSnfOverlay_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include/stm32_crc)
+# component STM32_RNG
+list(APPEND ChibiOSnfOverlay_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include/stm32_rng)
+# component STM32_FSMC (Flexible Memory Controller)
+list(APPEND ChibiOSnfOverlay_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include/stm32_fsmc)
+# component STM32_ONEWIRE (One Wire driver)
+list(APPEND ChibiOSnfOverlay_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include/stm32_onewire)
+# component STM32_QSPI (QSPI driver)
+list(APPEND ChibiOSnfOverlay_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include/stm32_qspi)
+
+##################################################################################################################################
+# Add above the required include directory(ies) for a new nanoFramework overlay component that you are adding
+# following the template below.
+#
+# If the component includes a low level driver specific to a series, make sure you add the include dirs
+# in the CHIBIOS_NNNNNN_sources.cmake
+#
+# list(APPEND ChibiOSnfOverlay_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include/)
+##################################################################################################################################
+
+
+##################################################
+# source files for ChibiOS nanoFramework Overlay
+##################################################
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/hal_community.c)
+
+####################################################################################################
+# WHEN ADDING A NEW CHIBIOS OVERLAY component add the source file(s) specific to this series below
+####################################################################################################
+# component STM32_FLASH
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_flash/hal_stm32_flash.c)
+# component STM32_CRC
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_crc/hal_stm32_crc.c)
+# component STM32_RNG
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_rng/hal_stm32_rng.c)
+# component STM32_FSMC (Flexible Memory Controller)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_fsmc/hal_stm32_fsmc.c)
+# component STM32_ONEWIRE (One Wire driver)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c)
+# component STM32_QSPI (QSPI driver)
+list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_qspi/hal_stm32_qspi.c)
+
+#########################################################################################################################
+# Add above ALL the source code file(s) required for a new nanoFramework overlay component that you are adding
+# following the template below.
+#
+# If the component includes a low level driver specific to a series, make sure you add the source files
+# in the CHIBIOS_NNNNNN_sources.cmake
+#
+# list(APPEND ChibiOSnfOverlay_SOURCES ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/)
+#########################################################################################################################
+
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ChibiOSnfOverlay DEFAULT_MSG ChibiOSnfOverlay_INCLUDE_DIRS ChibiOSnfOverlay_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindMBEDOS.cmake b/source/native/nf-interpreter/CMake/Modules/FindMBEDOS.cmake
new file mode 100644
index 00000000..65518a6b
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindMBEDOS.cmake
@@ -0,0 +1,389 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+include(JSONParser)
+
+# read mBed targets file
+file(READ "${PROJECT_BINARY_DIR}/mBedOS_Source/targets/targets.json" TARGETS_JSON)
+
+# try to find target
+string(FIND ${TARGETS_JSON} ${MBED_TARGET} FOUND_TARGET)
+
+# message(STATUS "${MBED_TARGET} @ ${FOUND_TARGET}")
+
+if(${FOUND_TARGET} GREATER -1)
+ # target found
+
+ message(STATUS "mBed target '${MBED_TARGET}' found")
+ # get substring with data
+ math(EXPR FOUND_TARGET "${FOUND_TARGET} - 1")
+
+ # because there is not an elegant way of finding the end of the json section of this target we are setting this to 1000 chars
+ # the downside is that for most target this overuns to the next target
+ string(SUBSTRING "${TARGETS_JSON}" ${FOUND_TARGET} 2000 TARGET_TENTATIVE_JSON)
+else()
+ message(FATAL_ERROR "\n\nSorry but ${MBED_TARGET} seems to be missing in the list of the mBed supported targets...\n\n")
+endif()
+
+# parse target data
+sbeParseJson(MBED_TARGET_DATA TARGET_TENTATIVE_JSON)
+
+# try to extract relevant data
+foreach(var ${MBED_TARGET_DATA})
+
+ # sanity check when json parse has overun to the next target
+ string(FIND ${var} "MBED_TARGET_DATA.${MBED_TARGET}" MBED_TARGET_NAME_FOUND)
+ if(MBED_TARGET_NAME_FOUND GREATER -1)
+
+ # seems to belong to target, extract data
+ #message("${var} : ${${var}}") # debug helper
+
+ # core
+ string(FIND ${var} "core" MBED_TARGET_CORE_INDEX)
+ if(${MBED_TARGET_CORE_INDEX} GREATER -1)
+ set(MBED_TARGET_CORE ${${var}})
+ endif()
+
+ # extra labels 0 is: target vendor
+ string(FIND ${var} "MBED_TARGET_DATA.${MBED_TARGET}.extra_labels_0" MBED_TARGET_VENDOR_INDEX)
+ if(${MBED_TARGET_VENDOR_INDEX} GREATER -1)
+ set(MBED_TARGET_VENDOR ${${var}})
+ endif()
+
+ # extra labels 1 is: target series/variant
+ string(FIND ${var} "MBED_TARGET_DATA.${MBED_TARGET}.extra_labels_1" MBED_TARGET_SERIES_INDEX)
+ if(${MBED_TARGET_SERIES_INDEX} GREATER -1)
+ set(MBED_TARGET_SERIES ${${var}})
+ endif()
+
+ # extra labels 2 is used for compiler defs
+ string(FIND ${var} "MBED_TARGET_DATA.${MBED_TARGET}.extra_labels_2" MBED_TARGET_EXTRA_LABEL2_INDEX)
+ if(${MBED_TARGET_EXTRA_LABEL2_INDEX} GREATER -1)
+ set(MBED_TARGET_EXTRA_LABEL2 ${${var}})
+ endif()
+
+ # 'macros' lists target aditional macros
+ string(FIND ${var} "MBED_TARGET_DATA.${MBED_TARGET}.macros_" MBED_TARGET_MACROS_INDEX)
+ if(${MBED_TARGET_MACROS_INDEX} GREATER -1)
+ list(APPEND MBED_TARGET_MACROS ${${var}})
+ endif()
+
+ # 'device has' lists target features
+ string(FIND ${var} "MBED_TARGET_DATA.${MBED_TARGET}.device_has_" MBED_TARGET_DEVICE_HAS_INDEX)
+ if(${MBED_TARGET_DEVICE_HAS_INDEX} GREATER -1)
+ list(APPEND MBED_TARGET_FEATURES ${${var}})
+ endif()
+
+ # 'supported form factors' lists supported form factors for board
+ string(FIND ${var} "MBED_TARGET_DATA.${MBED_TARGET}.supported_form_factors_" MBED_TARGET_DEVICE_FORM_FACTORS_INDEX)
+ if(${MBED_TARGET_DEVICE_FORM_FACTORS_INDEX} GREATER -1)
+ list(APPEND MBED_TARGET_DEVICE_FORM_FACTORS ${${var}})
+ endif()
+
+ endif()
+
+endforeach()
+
+message("mBed target has ${MBED_TARGET_CORE}")
+message("mBed target vendor is ${MBED_TARGET_VENDOR}")
+message("mBed target series is ${MBED_TARGET_SERIES}")
+#message("mBed target features: ${MBED_TARGET_FEATURES}")
+
+# get target core short name
+string(REPLACE "Cortex-" "" MBED_TARGET_CORE_SHORT ${MBED_TARGET_CORE} )
+
+# set compiler options (general)
+string(APPEND MBEDOS_COMPILE_OPTIONS "-D__CORTEX_${MBED_TARGET_CORE_SHORT} -D__MBED__=1 -DTARGET_LIKE_MBED -D__MBED_CMSIS_RTOS_CM -DTOOLCHAIN_object -D__CMSIS_RTOS -DTOOLCHAIN_GCC -DTARGET_CORTEX_M -DARM_MATH_C${MBED_TARGET_CORE_SHORT} -DTARGET_${MBED_TARGET_CORE_SHORT} -DTOOLCHAIN_GCC_ARM -DTARGET_RELEASE -DTARGET_LIKE_CORTEX_${MBED_TARGET_CORE_SHORT} -D__CORTEX_${MBED_TARGET_CORE_SHORT} -DTARGET_${MBED_TARGET_VENDOR} -DTARGET_${MBED_TARGET_SERIES} -DTARGET_UVISOR_UNSUPPORTED -DTARGET_${MBED_TARGET}")
+
+# extra compiler def from extra label 2
+if(MBED_TARGET_EXTRA_LABEL2)
+ string(APPEND MBEDOS_COMPILE_OPTIONS " -DTARGET_${MBED_TARGET_EXTRA_LABEL2}")
+endif()
+
+# set compiler options (target specific features)
+foreach(feature ${MBED_TARGET_FEATURES})
+ string(APPEND MBEDOS_COMPILE_OPTIONS " -DDEVICE_${feature}=1")
+endforeach()
+
+# set compiler options (form factors)
+foreach(ff ${MBED_TARGET_DEVICE_FORM_FACTORS})
+ string(APPEND MBEDOS_COMPILE_OPTIONS " -DTARGET_FF_${ff}")
+endforeach()
+
+# set compiler options (macros)
+foreach(macro ${MBED_TARGET_MACROS})
+ string(APPEND MBEDOS_COMPILE_OPTIONS " -D${macro}")
+endforeach()
+
+#message(">>MBEDOS_COMPILE_OPTIONS: ${MBEDOS_COMPILE_OPTIONS}<<") # debug helper
+
+# set include directories for mBed RTOS
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/cmsis)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/cmsis/TOOLCHAIN_GCC)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/docs)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/drivers)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/events)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/events/equeue)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/greentea-client)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/greentea-client/greentea-client)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/greentea-client/source)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/unity)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/unity/source)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/unity/unity)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/utest)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/utest/source)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/utest/utest)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/mbedtls)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/mbedtls/importer)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/mbedtls/inc)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/mbedtls/inc/mbedtls)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/mbedtls/platform)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/mbedtls/platform/inc)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/mbedtls/platform/src)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/mbedtls/src)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/nanostack)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/netsocket)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/features/storage)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/hal)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/hal/storage_abstraction)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/platform)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/rtos)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/rtos/rtx)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/rtos/rtx/TARGET_CORTEX_M)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/rtos/rtx/TARGET_CORTEX_M/TARGET_${MBED_TARGET_CORE_SHORT})
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/rtos/rtx/TARGET_CORTEX_M/TARGET_${MBED_TARGET_CORE_SHORT}/TOOLCHAIN_GCC)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/targets)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR})
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES})
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/device)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/TARGET_${MBED_TARGET})
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/TARGET_${MBED_TARGET}/device)
+list(APPEND MBEDOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/TARGET_${MBED_TARGET}/device/TOOLCHAIN_GCC_ARM)
+
+# source files and GCC options according to target vendor and series
+if("${MBED_TARGET_VENDOR}" STREQUAL "STM")
+ include(MBED_${MBED_TARGET_SERIES}_sources)
+ include(MBED_${MBED_TARGET_SERIES}_GCC_options)
+endif()
+
+# source files for RTOS
+set(MBEDRTOS_SRCS
+ # drivers
+ AnalogIn.cpp
+ BusIn.cpp
+ BusInOut.cpp
+ BusOut.cpp
+ CAN.cpp
+ Ethernet.cpp
+ FileBase.cpp
+ FileLike.cpp
+ FilePath.cpp
+ FileSystemLike.cpp
+ I2C.cpp
+ I2CSlave.cpp
+ InterruptIn.cpp
+ InterruptManager.cpp
+ LocalFileSystem.cpp
+ RawSerial.cpp
+ SPI.cpp
+ SPISlave.cpp
+ Serial.cpp
+ SerialBase.cpp
+ Stream.cpp
+ Ticker.cpp
+ Timeout.cpp
+ Timer.cpp
+ TimerEvent.cpp
+
+ # events
+ EventQueue.cpp
+ equeue.c
+ equeue_mbed.cpp
+ equeue_posix.c
+
+ # features
+ greentea_metrics.cpp
+ greentea_serial.cpp
+ test_env.cpp
+ unity.c
+ mbed-utest-shim.cpp
+ unity_handler.cpp
+ utest_case.cpp
+ utest_default_handlers.cpp
+ utest_greentea_handlers.cpp
+ utest_harness.cpp
+ utest_shim.cpp
+ utest_stack_trace.cpp
+ utest_types.cpp
+
+ # mbed tls
+ mbed_trng.c
+ aes.c
+ aesni.c
+ arc4.c
+ asn1parse.c
+ asn1write.c
+ base64.c
+ bignum.c
+ blowfish.c
+ camellia.c
+ ccm.c
+ certs.c
+ cipher.c
+ cipher_wrap.c
+ cmac.c
+ ctr_drbg.c
+ debug.c
+ des.c
+ dhm.c
+ ecdh.c
+ ecdsa.c
+ ecjpake.c
+ ecp.c
+ ecp_curves.c
+ entropy.c
+ entropy_poll.c
+ error.c
+ gcm.c
+ havege.c
+ hmac_drbg.c
+ md.c
+ md2.c
+ md4.c
+ md5.c
+ md_wrap.c
+ memory_buffer_alloc.c
+ net_sockets.c
+ oid.c
+ padlock.c
+ pem.c
+ pk.c
+ pk_wrap.c
+ pkcs11.c
+ pkcs12.c
+ pkcs5.c
+ pkparse.c
+ pkwrite.c
+ platform.c
+ ripemd160.c
+ rsa.c
+ sha1.c
+ sha256.c
+ sha512.c
+ ssl_cache.c
+ ssl_ciphersuites.c
+ ssl_cli.c
+ ssl_cookie.c
+ ssl_srv.c
+ ssl_ticket.c
+ ssl_tls.c
+ threading.c
+ timing.c
+ version.c
+ version_features.c
+ x509.c
+ x509_create.c
+ x509_crl.c
+ x509_crt.c
+ x509_csr.c
+ x509write_crt.c
+ x509write_csr.c
+ xtea.c
+
+ # net socket
+ NetworkInterface.cpp
+ NetworkStack.cpp
+ Socket.cpp
+ SocketAddress.cpp
+ TCPServer.cpp
+ TCPSocket.cpp
+ UDPSocket.cpp
+ WiFiAccessPoint.cpp
+ nsapi_dns.cpp
+
+ # mBed HAL
+ mbed_gpio.c
+ mbed_lp_ticker_api.c
+ mbed_pinmap_common.c
+ mbed_ticker_api.c
+ mbed_us_ticker_api.c
+
+ # mBed platfom
+ CallChain.cpp
+ mbed_alloc_wrappers.cpp
+ mbed_assert.c
+ mbed_board.c
+ mbed_critical.c
+ mbed_error.c
+ mbed_interface.c
+ mbed_mem_trace.c
+ mbed_rtc_time.cpp
+ mbed_semihost_api.c
+ mbed_stats.c
+ mbed_wait_api_no_rtos.c
+ mbed_wait_api_rtos.cpp
+ retarget.cpp
+
+ # RTOS
+ Mutex.cpp
+ RtosTimer.cpp
+ Semaphore.cpp
+ Thread.cpp
+ rtos_idle.c
+ HAL_CM.c
+ RTX_Conf_CM.c
+ rt_CMSIS.c
+ rt_Event.c
+ rt_List.c
+ rt_Mailbox.c
+ rt_MemBox.c
+ rt_Memory.c
+ rt_Mutex.c
+ rt_OsEventObserver.c
+ rt_Robin.c
+ rt_Semaphore.c
+ rt_System.c
+ rt_Task.c
+ rt_Time.c
+ rt_Timer.c
+)
+
+foreach(SRC_FILE ${MBEDRTOS_SRCS})
+ set(MBEDOS_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(MBEDOS_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/drivers
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/events
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/events/equeue
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/greentea-client/source
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/unity/source
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/utest
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/features/frameworks/utest/source
+
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/features/mbedtls/platform/src
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/features/mbedtls/src
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/features/netsocket
+
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/hal
+
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/platform
+
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/rtos
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/rtos/rtx
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/rtos/rtx/TARGET_CORTEX_M
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${MBEDOS_SRC_FILE}") # debug helper
+ list(APPEND MBEDOS_SOURCES ${MBEDOS_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(MBEDOS DEFAULT_MSG MBEDOS_INCLUDE_DIRS MBEDOS_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindNF_CoreCLR.cmake b/source/native/nf-interpreter/CMake/Modules/FindNF_CoreCLR.cmake
new file mode 100644
index 00000000..76cae905
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindNF_CoreCLR.cmake
@@ -0,0 +1,256 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories for nanoFramework Core, CoreLib and CLR startup
+
+# include directories for Core
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Core)
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/HAL/Include)
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Include)
+
+# include directories for CoreLib
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/CorLib)
+
+# CLR startup
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Startup)
+
+# others
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Diagnostics)
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Debugger)
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Helpers/TinyPrintf)
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Helpers/Base64)
+list(APPEND NF_CoreCLR_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/nanoFramework.Runtime.Native)
+
+# source files for nanoFramework Core, CoreLib and CLR startup
+set(NF_CoreCLR_SRCS
+
+ # Core
+ Cache.cpp
+ Checks.cpp
+ CLR_RT_DblLinkedList.cpp
+ CLR_RT_HeapBlock.cpp
+ CLR_RT_HeapBlock_Array.cpp
+ CLR_RT_HeapBlock_ArrayList.cpp
+ CLR_RT_HeapBlock_BinaryBlob.cpp
+ CLR_RT_HeapBlock_Delegate.cpp
+ CLR_RT_HeapBlock_Delegate_List.cpp
+ CLR_RT_HeapBlock_Finalizer.cpp
+ CLR_RT_HeapBlock_Lock.cpp
+ CLR_RT_HeapBlock_LockRequest.cpp
+ CLR_RT_HeapBlock_Node.cpp
+ CLR_RT_HeapBlock_String.cpp
+ CLR_RT_HeapBlock_Timer.cpp
+ CLR_RT_HeapBlock_WaitForObject.cpp
+ CLR_RT_HeapCluster.cpp
+ CLR_RT_Interop.cpp
+ CLR_RT_Memory.cpp
+ CLR_RT_ObjectToEvent_Destination.cpp
+ CLR_RT_ObjectToEvent_Source.cpp
+ CLR_RT_RuntimeMemory.cpp
+ CLR_RT_StackFrame.cpp
+ CLR_RT_SystemAssembliesTable.cpp
+ CLR_RT_UnicodeHelper.cpp
+ Core.cpp
+ Execution.cpp
+ GarbageCollector.cpp
+ GarbageCollector_Compaction.cpp
+ GarbageCollector_ComputeReachabilityGraph.cpp
+ GarbageCollector_Info.cpp
+ Interpreter.cpp
+ Random.cpp
+ Streams.cpp
+ StringTable.cpp
+ Thread.cpp
+ TypeSystemLookup.cpp
+ StringTableData.cpp
+ TypeSystem.cpp
+ nanoSupport_CRC32.c
+ nanoHAL_SystemInformation.cpp
+ # Various.cpp
+
+ # CoreLib
+ corlib_native_System_AppDomain.cpp
+ corlib_native_System_Array.cpp
+ corlib_native_System_Attribute.cpp
+ corlib_native_System_BitConverter.cpp
+ corlib_native_System_Collections_ArrayList.cpp
+ corlib_native_System_Console.cpp
+ corlib_native_System_Convert.cpp
+ corlib_native_System_DateTime.cpp
+ corlib_native_System_Delegate.cpp
+ corlib_native_System_Diagnostics_Debugger.cpp
+ corlib_native_System_Double.cpp
+ corlib_native_System_Enum.cpp
+ corlib_native_System_Exception.cpp
+ corlib_native_System_GC.cpp
+ corlib_native_System_Globalization_CultureInfo.cpp
+ corlib_native_System_Globalization_DateTimeFormat.cpp
+ corlib_native_System_Guid.cpp
+ corlib_native_System_MarshalByRefObject.cpp
+ corlib_native_System_MathInternal.cpp
+ corlib_native_System_MulticastDelegate.cpp
+ corlib_native_System_Number.cpp
+ corlib_native_System_Object.cpp
+ corlib_native_System_Random.cpp
+ corlib_native_System_Reflection_Binder.cpp
+ corlib_native_System_Reflection_MemberInfo.cpp
+ corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp
+ corlib_native_System_Runtime_Remoting_RemotingServices.cpp
+ corlib_native_System_String.cpp
+ corlib_native_System_Text_UTF8Decoder.cpp
+ corlib_native_System_Text_UTF8Encoding.cpp
+ corlib_native_System_Threading_AutoResetEvent.cpp
+ corlib_native_System_Threading_Interlocked.cpp
+ corlib_native_System_Threading_ManualResetEvent.cpp
+ corlib_native_System_Threading_Monitor.cpp
+ corlib_native_System_Threading_Thread.cpp
+ corlib_native_System_Threading_Timer.cpp
+ corlib_native_System_Threading_WaitHandle.cpp
+ corlib_native_System_TimeSpan.cpp
+ corlib_native_System_ValueType.cpp
+ corlib_native_System_WeakReference.cpp
+ corlib_native.cpp
+
+ # CLR startup
+ CLRStartup.cpp
+
+ # Messaging
+ Messaging.cpp
+
+ # Runtime.Native
+ nf_rt_native.cpp
+ nf_rt_native_nanoFramework_Runtime_Hardware_SystemInfo.cpp
+ nf_rt_native_nanoFramework_Runtime_Native_Debug.cpp
+ nf_rt_native_nanoFramework_Runtime_Native_ExecutionConstraint.cpp
+ nf_rt_native_nanoFramework_Runtime_Native_Power.cpp
+ nf_rt_native_nanoFramework_Runtime_Native_Rtc_stubs.cpp
+
+ # Core stubs
+ Hardware_stub.cpp
+ InterruptHandler_stub.cpp
+ NativeEventDispatcher_stub.cpp
+ RPC_stub.cpp
+ BinaryFormatter_stub.cpp
+
+ # CLR stubs
+ Debugger_stub.cpp
+ Diagnostics_stub.cpp
+ Messaging_stub.cpp
+
+ # Helpers
+ printf.c
+
+ # HAL
+ nanoHAL_Time.cpp
+ nanoHAL_Watchdog.c
+
+ # PAL
+ nanoPAL_BlockStorage.c
+ nanoPAL_NativeDouble.cpp
+ nanoPAL_Network_stubs.cpp
+ nanoPAL_PerformanceCounters_stubs.cpp
+
+ # PAL stubs
+ Async_stubs.cpp
+ COM_stubs.c
+ GenericPort_stubs.c
+
+ # target specifics
+ target_BlockStorage.c
+)
+
+# include System.Reflection API files depending on build option
+if(NF_FEATURE_SUPPORT_REFLECTION)
+ list(APPEND NF_CoreCLR_SRCS corlib_native_System_Reflection_Assembly.cpp)
+ list(APPEND NF_CoreCLR_SRCS corlib_native_System_Reflection_ConstructorInfo.cpp)
+ list(APPEND NF_CoreCLR_SRCS corlib_native_System_Reflection_FieldInfo.cpp)
+ list(APPEND NF_CoreCLR_SRCS corlib_native_System_Reflection_MethodBase.cpp)
+ list(APPEND NF_CoreCLR_SRCS corlib_native_System_Reflection_PropertyInfo.cpp)
+ list(APPEND NF_CoreCLR_SRCS corlib_native_System_Reflection_RuntimeFieldInfo.cpp)
+ list(APPEND NF_CoreCLR_SRCS corlib_native_System_Reflection_RuntimeMethodInfo.cpp)
+ list(APPEND NF_CoreCLR_SRCS corlib_native_System_RuntimeType.cpp)
+ list(APPEND NF_CoreCLR_SRCS corlib_native_System_Type.cpp)
+endif()
+
+# include Collection support files depending on build option
+if(API_nanoFramework.System.Collections)
+ list(APPEND NF_CoreCLR_SRCS CLR_RT_HeapBlock_Queue.cpp)
+ list(APPEND NF_CoreCLR_SRCS CLR_RT_HeapBlock_Stack.cpp)
+endif()
+
+# need a conditional include because of ESP32 building network as a library
+if(NOT USE_SECURITY_MBEDTLS_OPTION)
+ list(APPEND NF_CoreCLR_SRCS base64.c)
+endif()
+
+# include configuration manager file
+if(NF_FEATURE_HAS_CONFIG_BLOCK)
+ # feature enabled, full support
+ list(APPEND NF_CoreCLR_SRCS nanoHAL_ConfigurationManager.c)
+else()
+ # feature disabled, stubs only
+ list(APPEND NF_CoreCLR_SRCS nanoHAL_ConfigurationManager_stubs.c)
+endif()
+
+foreach(SRC_FILE ${NF_CoreCLR_SRCS})
+ set(NF_CoreCLR_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(NF_CoreCLR_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ # Core
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core
+
+ # CoreLib
+ ${PROJECT_SOURCE_DIR}/src/CLR/CorLib
+
+ # CLR startup
+ ${PROJECT_SOURCE_DIR}/src/CLR/Startup
+
+ # Runtime.Native
+ ${PROJECT_SOURCE_DIR}/src/nanoFramework.Runtime.Native
+
+ # Core stubs
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core/Hardware
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core/InterruptHandler
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core/NativeEventDispatcher
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core/RPC
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core/Serialization
+
+ # CLR stubs
+ ${PROJECT_SOURCE_DIR}/src/CLR/Debugger
+ ${PROJECT_SOURCE_DIR}/src/CLR/Diagnostics
+ ${PROJECT_SOURCE_DIR}/src/CLR/Messaging
+
+ # Helpers
+ ${PROJECT_SOURCE_DIR}/src/CLR/Helpers/TinyPrintf
+ ${PROJECT_SOURCE_DIR}/src/CLR/Helpers/Base64
+
+ # HAL
+ ${PROJECT_SOURCE_DIR}/src/HAL
+
+ # PAL
+ ${PROJECT_SOURCE_DIR}/src/PAL
+ ${PROJECT_SOURCE_DIR}/src/PAL/BlockStorage
+ ${PROJECT_SOURCE_DIR}/src/PAL/Double
+
+ # PAL stubs
+ ${PROJECT_SOURCE_DIR}/src/PAL/AsyncProcCall
+ ${PROJECT_SOURCE_DIR}/src/PAL/COM
+ ${PROJECT_SOURCE_DIR}/src/PAL/Profiler
+
+ # target
+ "${TARGET_BASE_LOCATION}"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${NF_CoreCLR_SRC_FILE}") # debug helper
+ list(APPEND NF_CoreCLR_SOURCES ${NF_CoreCLR_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NF_CoreCLR DEFAULT_MSG NF_CoreCLR_INCLUDE_DIRS NF_CoreCLR_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindNF_Debugger.cmake b/source/native/nf-interpreter/CMake/Modules/FindNF_Debugger.cmake
new file mode 100644
index 00000000..84655de4
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindNF_Debugger.cmake
@@ -0,0 +1,53 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories for nanoFramework Debugger
+list(APPEND NF_Debugger_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Debugger)
+list(APPEND NF_Debugger_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Messaging)
+list(APPEND NF_Debugger_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/WireProtocol)
+list(APPEND NF_Debugger_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+
+# source files for nanoFramework Debugger
+set(NF_Debugger_SRCS
+
+ Debugger.cpp
+
+ Messaging.cpp
+
+ WireProtocol_Message.c
+ WireProtocol_MonitorCommands.c
+ WireProtocol_HAL_Interface.c
+ WireProtocol_App_Interface.c
+
+ nanoSupport_CRC32.c
+)
+
+# add the debugger source file according to the build flavor
+if(NF_BUILD_RTM)
+ set(NF_Debugger_SRCS ${NF_Debugger_SRCS} Debugger_minimal.cpp)
+else()
+ set(NF_Debugger_SRCS ${NF_Debugger_SRCS} Debugger_full.cpp)
+endif()
+
+
+foreach(SRC_FILE ${NF_Debugger_SRCS})
+ set(NF_Debugger_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(NF_Debugger_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_SOURCE_DIR}/src/CLR/Debugger
+ ${PROJECT_SOURCE_DIR}/src/CLR/Messaging
+ ${PROJECT_SOURCE_DIR}/src/CLR/WireProtocol
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${NF_Debugger_SRC_FILE}") # debug helper
+ list(APPEND NF_Debugger_SOURCES ${NF_Debugger_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NF_Debugger DEFAULT_MSG NF_Debugger_INCLUDE_DIRS NF_Debugger_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindNF_Diagnostics.cmake b/source/native/nf-interpreter/CMake/Modules/FindNF_Diagnostics.cmake
new file mode 100644
index 00000000..a5b68c76
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindNF_Diagnostics.cmake
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories
+list(APPEND NF_Diagnostics_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Diagnostics)
+list(APPEND NF_Diagnostics_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+
+# source files
+set(NF_Diagnostics_SRCS
+
+ Info.cpp
+ Profile.cpp
+ Profiler.cpp
+)
+
+foreach(SRC_FILE ${NF_Diagnostics_SRCS})
+ set(NF_Diagnostics_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(NF_Diagnostics_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_SOURCE_DIR}/src/CLR/Diagnostics
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${NF_Diagnostics_SRC_FILE}") # debug helper
+ list(APPEND NF_Diagnostics_SOURCES ${NF_Diagnostics_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NF_Diagnostics DEFAULT_MSG NF_Diagnostics_INCLUDE_DIRS NF_Diagnostics_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindNF_Networking.cmake b/source/native/nf-interpreter/CMake/Modules/FindNF_Networking.cmake
new file mode 100644
index 00000000..281b6aa8
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindNF_Networking.cmake
@@ -0,0 +1,107 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories for nanoFramework network
+list(APPEND NF_Networking_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Com/sockets)
+list(APPEND NF_Networking_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Com/sockets/ssl)
+list(APPEND NF_Networking_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Lwip)
+list(APPEND NF_Networking_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/DeviceInterfaces/Networking.Sntp)
+
+if(USE_SECURITY_MBEDTLS_OPTION)
+ list(APPEND NF_Networking_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Com/sockets/ssl/mbedTLS)
+endif()
+
+# source files for nanoFramework Networking
+set(NF_Networking_SRCS
+
+ #pal Socket
+ sockets_lwip.cpp
+
+ #Lwip
+ LwIP_Sockets.cpp
+ LwIP_Sockets_functions.cpp
+
+)
+
+# need a conditional include because of ESP32 building network as a library
+if(NOT USE_SECURITY_MBEDTLS_OPTION)
+ list(APPEND NF_Networking_SRCS ssl_stubs.cpp)
+endif()
+
+# source files for security layer
+set(NF_Networking_Security_SRCS
+
+ ssl.cpp
+ ssl_accept_internal.cpp
+ ssl_add_cert_auth_internal.cpp
+ ssl_close_socket_internal.cpp
+ ssl_connect_internal.cpp
+ ssl_decode_private_key_internal.cpp
+ ssl_exit_context_internal.cpp
+ ssl_generic.cpp
+ ssl_generic_init_internal.cpp
+ ssl_initialize_internal.cpp
+ ssl_parse_certificate_internal.cpp
+ ssl_pending_internal.cpp
+ ssl_read_internal.cpp
+ ssl_uninitialize_internal.cpp
+ ssl_write_internal.cpp
+
+)
+
+
+if(NF_FEATURE_DEBUGGER)
+ list(APPEND NF_Networking_SRCS sockets_debugger.cpp)
+endif()
+
+# add source files in two steps
+# 1st pass: common source files
+foreach(SRC_FILE ${NF_Networking_SRCS})
+ set(NF_Networking_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(NF_Networking_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ ${PROJECT_SOURCE_DIR}/src/PAL/COM/sockets
+ ${PROJECT_SOURCE_DIR}/src/PAL/COM/sockets/ssl
+
+ ${PROJECT_SOURCE_DIR}/src/PAL/COM/sockets/ssl/mbedTLS
+
+ ${PROJECT_SOURCE_DIR}/src/PAL/Lwip
+ ${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${NF_Networking_SRC_FILE}") # debug helper
+ list(APPEND NF_Networking_SOURCES ${NF_Networking_SRC_FILE})
+endforeach()
+
+if(USE_SECURITY_MBEDTLS_OPTION)
+ set(NF_Security_Search_Path "${PROJECT_SOURCE_DIR}/src/PAL/COM/sockets/ssl/mbedTLS")
+endif()
+
+if(USE_SECURITY_MBEDTLS_OPTION)
+
+ # 2nd pass: security files if option is selected
+ foreach(SRC_FILE ${NF_Networking_Security_SRCS})
+ set(NF_Networking_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(NF_Networking_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ ${PROJECT_SOURCE_DIR}/src/PAL/COM/sockets/ssl
+ ${NF_Security_Search_Path}
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${NF_Networking_SRC_FILE}") # debug helper
+ list(APPEND NF_Networking_SOURCES ${NF_Networking_SRC_FILE})
+ endforeach()
+
+endif()
+
+
+include(FindPackageHandleStandardArgs)
+
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NF_Networking DEFAULT_MSG NF_Networking_INCLUDE_DIRS NF_Networking_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindRTXRTOS.cmake b/source/native/nf-interpreter/CMake/Modules/FindRTXRTOS.cmake
new file mode 100644
index 00000000..c36076bb
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindRTXRTOS.cmake
@@ -0,0 +1,99 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+if(NOT STM32_CHIP_TYPE)
+ STM32_GET_CHIP_TYPE(${TARGET_CHIP} STM32_CHIP_TYPE)
+ if(NOT STM32_CHIP_TYPE)
+ message(FATAL_ERROR "Unknown chip: ${TARGET_CHIP}.")
+ endif()
+ message(STATUS "${TARGET_CHIP} is ${STM32_CHIP_TYPE} device")
+endif()
+string(TOLOWER ${STM32_CHIP_TYPE} STM32_CHIP_TYPE_LOWER)
+
+
+# build path hints according to device series
+if(STM32_SERIES STREQUAL "F0")
+ set(RTXRTOS_HAL_NAME HAL_CM0.S)
+ set(RTXRTOS_COMPILE_OPTIONS -D__CORTEX_M0)
+elseif(STM32_SERIES STREQUAL "F1")
+ set(RTXRTOS_HAL_NAME HAL_CM0.S)
+ set(RTXRTOS_COMPILE_OPTIONS -D__CORTEX_M0)
+elseif(STM32_SERIES STREQUAL "F2")
+ set(RTXRTOS_HAL_NAME HAL_CM0.S)
+ set(RTXRTOS_COMPILE_OPTIONS -D__CORTEX_M0)
+elseif(STM32_SERIES STREQUAL "F3")
+ set(RTXRTOS_HAL_NAME HAL_CM3.S)
+ set(RTXRTOS_COMPILE_OPTIONS -D__CORTEX_M3)
+elseif(STM32_SERIES STREQUAL "F4")
+ set(RTXRTOS_HAL_NAME HAL_CM4.S)
+ set(RTXRTOS_COMPILE_OPTIONS -D__CORTEX_M4)
+elseif(STM32_SERIES STREQUAL "F7")
+ set(RTXRTOS_HAL_NAME HAL_CM4.S)
+ set(RTXRTOS_COMPILE_OPTIONS -D__CORTEX_M7)
+elseif(STM32_SERIES STREQUAL "L0")
+ set(RTXRTOS_HAL_NAME HAL_CM0.S)
+ set(RTXRTOS_COMPILE_OPTIONS -D__CORTEX_M0)
+elseif(STM32_SERIES STREQUAL "L1")
+ set(RTXRTOS_HAL_NAME HAL_CM0.S)
+ set(RTXRTOS_COMPILE_OPTIONS -D__CORTEX_M0)
+elseif(STM32_SERIES STREQUAL "L4")
+ set(RTXRTOS_HAL_NAME HAL_CM4.S)
+ set(RTXRTOS_COMPILE_OPTIONS -D__CORTEX_M4)
+endif()
+
+# set include directories for RXT RTOS
+list(APPEND RTXRTOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS/RTX/INC)
+list(APPEND RTXRTOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS/RTX/SRC)
+
+set(RTXRTOS_SRCS
+ Mutex.cpp
+ RtosTimer.cpp
+ Semaphore.cpp
+ Thread.cpp
+
+ HAL_CM.c
+ rt_CMSIS.c
+ rt_Event.c
+ rt_List.c
+ rt_Mailbox.c
+ rt_MemBox.c
+ rt_Memory.c
+ rt_Mutex.c
+ rt_Robin.c
+ rt_Semaphore.c
+ rt_System.c
+ rt_Task.c
+ rt_Time.c
+ rt_Timer.c
+)
+
+foreach(SRC_FILE ${RTXRTOS_SRCS})
+ set(RTXRTOS_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(RTXRTOS_SRC_FILE ${SRC_FILE}
+ PATHS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS/RTX/SRC ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS/Template/CPP
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ list(APPEND RTXRTOS_SOURCES ${RTXRTOS_SRC_FILE})
+endforeach()
+
+# find path for HAL_CMx file
+set(RTXRTOS_SRC_FILE SRC_FILE-NOTFOUND)
+find_file(RTXRTOS_SRC_FILE ${RTXRTOS_HAL_NAME}
+ PATHS PATHS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS/RTX/SRC/GCC
+ CMAKE_FIND_ROOT_PATH_BOTH
+)
+list(APPEND RTXRTOS_SOURCES ${RTXRTOS_SRC_FILE})
+
+# find path for SVC_Table file
+set(RTXRTOS_SRC_FILE SRC_FILE-NOTFOUND)
+find_file(RTXRTOS_SRC_FILE SVC_Table.S
+ PATHS PATHS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS/RTX/SRC/GCC
+ CMAKE_FIND_ROOT_PATH_BOTH
+)
+list(APPEND RTXRTOS_SOURCES ${RTXRTOS_SRC_FILE})
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(RTXRTOS DEFAULT_MSG RTXRTOS_INCLUDE_DIRS RTXRTOS_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindRTXRTOS2.cmake b/source/native/nf-interpreter/CMake/Modules/FindRTXRTOS2.cmake
new file mode 100644
index 00000000..cc3342ae
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindRTXRTOS2.cmake
@@ -0,0 +1,112 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+if(NOT STM32_CHIP_TYPE)
+ STM32_GET_CHIP_TYPE(${TARGET_CHIP} STM32_CHIP_TYPE)
+ if(NOT STM32_CHIP_TYPE)
+ message(FATAL_ERROR "Unknown chip: ${TARGET_CHIP}.")
+ endif()
+ message(STATUS "${TARGET_CHIP} is ${STM32_CHIP_TYPE} device")
+endif()
+string(TOLOWER ${STM32_CHIP_TYPE} STM32_CHIP_TYPE_LOWER)
+
+
+# build path hints according to device series
+if(STM32_SERIES STREQUAL "F0")
+ set(RTXRTOS2_HAL_NAME irq_cm0.S)
+ set(RTXRTOS2_COMPILE_OPTIONS -D__CORTEX_M0 -DCMSIS_device_header=ARMCM0.h)
+ list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/Device/ARM/ARMCM0/Include)
+elseif(STM32_SERIES STREQUAL "F1")
+ set(RTXRTOS2_HAL_NAME irq_cm0.S)
+ set(RTXRTOS2_COMPILE_OPTIONS -D__CORTEX_M0 -DCMSIS_device_header=ARMCM0.h)
+ list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/Device/ARM/ARMCM0/Include)
+elseif(STM32_SERIES STREQUAL "F2")
+ set(RTXRTOS2_HAL_NAME irq_cm0.S)
+ set(RTXRTOS2_COMPILE_OPTIONS -D__CORTEX_M0 -DCMSIS_device_header=ARMCM0.h)
+ list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/Device/ARM/ARMCM0/Include)
+elseif(STM32_SERIES STREQUAL "F3")
+ set(RTXRTOS2_HAL_NAME irq_cm3.S)
+ set(RTXRTOS2_COMPILE_OPTIONS -D__CORTEX_M3 -DCMSIS_device_header=ARMCM3.h)
+ list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/Device/ARM/ARMCM3/Include)
+elseif(STM32_SERIES STREQUAL "F4")
+ set(RTXRTOS2_HAL_NAME irq_cm4f.S)
+ set(RTXRTOS2_COMPILE_OPTIONS -D__CORTEX_M4 -DCMSIS_device_header=ARMCM4.h)
+ list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/Device/ARM/ARMCM4/Include)
+elseif(STM32_SERIES STREQUAL "F7")
+ set(RTXRTOS2_HAL_NAME irq_cm4f.S)
+ set(RTXRTOS2_COMPILE_OPTIONS -D__CORTEX_M7 -DCMSIS_device_header=ARMCM7.h)
+ list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/Device/ARM/ARMCM7/Include)
+elseif(STM32_SERIES STREQUAL "L0")
+ set(RTXRTOS2_HAL_NAME irq_cm0.S)
+ set(RTXRTOS2_COMPILE_OPTIONS -D__CORTEX_M0 -DCMSIS_device_header=ARMCM0.h)
+ list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/Device/ARM/ARMCM0/Include)
+elseif(STM32_SERIES STREQUAL "L1")
+ set(RTXRTOS2_HAL_NAME irq_cm0.S)
+ set(RTXRTOS2_COMPILE_OPTIONS -D__CORTEX_M0 -DCMSIS_device_header=ARMCM0.h)
+ list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/Device/ARM/ARMCM0/Include)
+elseif(STM32_SERIES STREQUAL "L4")
+ set(RTXRTOS2_HAL_NAME irq_cm4f.S)
+ set(RTXRTOS2_COMPILE_OPTIONS -D__CORTEX_M4 -DCMSIS_device_header=ARMCM4.h)
+ list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/Device/ARM/ARMCM0/Include)
+endif()
+
+# set include directories for RXT RTOS
+list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/Core/Include)
+list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS2/Include)
+list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS2/RTX/Include)
+list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS2/RTX/Include1)
+list(APPEND RTXRTOS2_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS2/RTX/Source)
+
+set(RTXRTOS2_SRCS
+ Events.c
+ MemPool.c
+ MsgQueue.c
+ Mutex.c
+ Semaphore.c
+ Thread.c
+ Timer.c
+
+ rtx_delay.c
+ rtx_evflags.c
+ rtx_kernel.c
+ rtx_memory.c
+ rtx_mempool.c
+ rtx_msgqueue.c
+ rtx_mutex.c
+ rtx_semaphore.c
+ rtx_system.c
+ rtx_thread.c
+ rtx_timer.c
+ user_svc.c
+)
+
+foreach(SRC_FILE ${RTXRTOS2_SRCS})
+ set(RTXRTOS2_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(RTXRTOS2_SRC_FILE ${SRC_FILE}
+ PATHS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS2/RTX/Source ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS2/RTX/Template
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ list(APPEND RTXRTOS2_SOURCES ${RTXRTOS2_SRC_FILE})
+endforeach()
+
+# find path for HAL_CMx file
+set(RTXRTOS2_SRC_FILE SRC_FILE-NOTFOUND)
+find_file(RTXRTOS2_SRC_FILE ${RTXRTOS2_HAL_NAME}
+ PATHS PATHS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS2/RTX/Source/GCC
+ CMAKE_FIND_ROOT_PATH_BOTH
+)
+list(APPEND RTXRTOS2_SOURCES ${RTXRTOS2_SRC_FILE})
+
+# # find path for SVC_Table file
+# set(RTXRTOS2_SRC_FILE SRC_FILE-NOTFOUND)
+# find_file(RTXRTOS2_SRC_FILE SVC_Table.S
+# PATHS PATHS ${PROJECT_BINARY_DIR}/RTXRTOS_Source/CMSIS/RTOS/RTX/SRC/GCC
+# CMAKE_FIND_ROOT_PATH_BOTH
+# )
+# list(APPEND RTXRTOS2_SOURCES ${RTXRTOS2_SRC_FILE})
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(RTXRTOS2 DEFAULT_MSG RTXRTOS2_INCLUDE_DIRS RTXRTOS2_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindSPIFFS.cmake b/source/native/nf-interpreter/CMake/Modules/FindSPIFFS.cmake
new file mode 100644
index 00000000..d3a13b9e
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindSPIFFS.cmake
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# List of the required include paths
+list(APPEND SPIFFS_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/SPIFFS_Source/src)
+
+set(src_spiffs
+
+ spiffs_nucleus.c
+ spiffs_gc.c
+ spiffs_hydrogen.c
+ spiffs_cache.c
+ spiffs_check.c
+
+ # HAL implementation specific to a platform
+ # has to be included at platform level
+ # hal_spiffs.c
+
+ target_spiffs.c
+)
+
+foreach(SRC_FILE ${src_spiffs})
+ set(SPIFFS_SRC_FILE SRC_FILE -NOTFOUND)
+ find_file(SPIFFS_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ "${PROJECT_BINARY_DIR}/SPIFFS_Source/src"
+ "${TARGET_BASE_LOCATION}"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${SPIFFS_SRC_FILE}") # debug helper
+ list(APPEND SPIFFS_SOURCES ${SPIFFS_SRC_FILE})
+endforeach()
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SPIFFS DEFAULT_MSG SPIFFS_INCLUDE_DIRS SPIFFS_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindSTM32F0_CubePackage.cmake b/source/native/nf-interpreter/CMake/Modules/FindSTM32F0_CubePackage.cmake
new file mode 100644
index 00000000..75939aa2
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindSTM32F0_CubePackage.cmake
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories
+list(APPEND STM32F0_CubePackage_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/STM32F0_CubePackage_Source/Drivers/STM32F0xx_HAL_Driver/Inc")
+
+# source files
+set(STM32F0_CubePackage_SRCS
+
+ # add HAL files here as required
+)
+
+foreach(SRC_FILE ${STM32F0_CubePackage_SRCS})
+ set(STM32F0_CubePackage_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(STM32F0_CubePackage_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ "${PROJECT_BINARY_DIR}/STM32F0_CubePackage_Source/Drivers/STM32F0xx_HAL_Driver/Src"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${STM32F0_CubePackage_SRC_FILE}") # debug helper
+ list(APPEND STM32F0_CubePackage_SOURCES ${STM32F0_CubePackage_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(STM32F0_CubePackage DEFAULT_MSG STM32F0_CubePackage_INCLUDE_DIRS STM32F0_CubePackage_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindSTM32F4_CubePackage.cmake b/source/native/nf-interpreter/CMake/Modules/FindSTM32F4_CubePackage.cmake
new file mode 100644
index 00000000..557c94f4
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindSTM32F4_CubePackage.cmake
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories
+list(APPEND STM32F4_CubePackage_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/STM32F4_CubePackage_Source/Drivers/STM32F4xx_HAL_Driver/Inc")
+
+# source files
+set(STM32F4_CubePackage_SRCS
+
+ # add HAL files here as required
+
+ # SPIFFS
+ stm32f4xx_hal_dma.c
+ stm32f4xx_hal_qspi.c
+)
+
+foreach(SRC_FILE ${STM32F4_CubePackage_SRCS})
+ set(STM32F4_CubePackage_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(STM32F4_CubePackage_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ "${PROJECT_BINARY_DIR}/STM32F4_CubePackage_Source/Drivers/STM32F4xx_HAL_Driver/Src"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${STM32F4_CubePackage_SRC_FILE}") # debug helper
+ list(APPEND STM32F4_CubePackage_SOURCES ${STM32F4_CubePackage_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(STM32F4_CubePackage DEFAULT_MSG STM32F4_CubePackage_INCLUDE_DIRS STM32F4_CubePackage_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindSTM32F7_CubePackage.cmake b/source/native/nf-interpreter/CMake/Modules/FindSTM32F7_CubePackage.cmake
new file mode 100644
index 00000000..c5fb281c
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindSTM32F7_CubePackage.cmake
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories
+list(APPEND STM32F7_CubePackage_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/STM32F7_CubePackage_Source/Drivers/STM32F7xx_HAL_Driver/Inc")
+
+# source files
+set(STM32F7_CubePackage_SRCS
+
+ # add HAL files here as required
+
+ # SPIFFS
+ stm32f7xx_hal_dma.c
+ stm32f7xx_hal_qspi.c
+)
+
+foreach(SRC_FILE ${STM32F7_CubePackage_SRCS})
+ set(STM32F7_CubePackage_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(STM32F7_CubePackage_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ "${PROJECT_BINARY_DIR}/STM32F7_CubePackage_Source/Drivers/STM32F7xx_HAL_Driver/Src/"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${STM32F7_CubePackage_SRC_FILE}") # debug helper
+ list(APPEND STM32F7_CubePackage_SOURCES ${STM32F7_CubePackage_SRC_FILE})
+endforeach()
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(STM32F7_CubePackage DEFAULT_MSG STM32F7_CubePackage_INCLUDE_DIRS STM32F7_CubePackage_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindSTM32FREERTOS.cmake b/source/native/nf-interpreter/CMake/Modules/FindSTM32FREERTOS.cmake
new file mode 100644
index 00000000..8b557481
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindSTM32FREERTOS.cmake
@@ -0,0 +1,115 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+if(NOT STM32_CHIP_TYPE)
+ STM32_GET_CHIP_TYPE(${TARGET_CHIP} STM32_CHIP_TYPE)
+ if(NOT STM32_CHIP_TYPE)
+ message(FATAL_ERROR "Unknown chip: ${TARGET_CHIP}.")
+ endif()
+ message(STATUS "${TARGET_CHIP} is ${STM32_CHIP_TYPE} device")
+endif()
+string(TOLOWER ${STM32_CHIP_TYPE} STM32_CHIP_TYPE_LOWER)
+
+# find path of STM32 CMSIS FreeRTOS port for include files
+find_path(STM32CMSISFREERTOS_INCLUDE_DIR cmsis_os.h
+ PATH_SUFFIXES CMSIS_RTOS
+ HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source
+ CMAKE_FIND_ROOT_PATH_BOTH
+)
+
+# set path search for FreeRTOS distribution
+set(FREERTOS_HEADERS
+ croutine.h
+ deprecated_definitions.h
+ event_groups.h
+ FreeRTOS.h
+ list.h
+ mpu_prototypes.h
+ mpu_wrappers.h
+ portable.h
+ projdefs.h
+ queue.h
+ semphr.h
+ StackMacros.h
+ task.h
+ timers.h
+)
+
+# build path hints according to device series
+if(STM32_SERIES STREQUAL "F0")
+ set(FREERTOS_PATH_SUFFIXES ARM_CM0)
+elseif(STM32_SERIES STREQUAL "F1")
+ set(FREERTOS_PATH_SUFFIXES ARM_CM0)
+elseif(STM32_SERIES STREQUAL "F2")
+ set(FREERTOS_PATH_SUFFIXES ARM_CM0)
+elseif(STM32_SERIES STREQUAL "F3")
+ set(FREERTOS_PATH_SUFFIXES ARM_CM3)
+elseif(STM32_SERIES STREQUAL "F4")
+ set(FREERTOS_PATH_SUFFIXES ARM_CM4F)
+elseif(STM32_SERIES STREQUAL "F7")
+ set(FREERTOS_PATH_SUFFIXES ARM_CM7)
+elseif(STM32_SERIES STREQUAL "L0")
+ set(FREERTOS_PATH_SUFFIXES ARM_CM0)
+elseif(STM32_SERIES STREQUAL "L1")
+ set(FREERTOS_PATH_SUFFIXES ARM_CM0)
+elseif(STM32_SERIES STREQUAL "L4")
+ set(FREERTOS_PATH_SUFFIXES ARM_CM4F)
+endif()
+
+find_path(FREERTOS_INCLUDE_DIR ${FREERTOS_HEADERS}
+ PATH_SUFFIXES FreeRTOS_Source Include
+ PATHS ${PROJECT_BINARY_DIR}/FreeRTOS_Source
+ CMAKE_FIND_ROOT_PATH_BOTH
+)
+
+find_path(FREERTOS_PORTABLE_INCLUDE_DIR portmacro.h
+ PATHS ${PROJECT_BINARY_DIR}/FreeRTOS_Source/portable/GCC/${FREERTOS_PATH_SUFFIXES}
+ CMAKE_FIND_ROOT_PATH_BOTH
+)
+
+set(STM32FREERTOS_INCLUDE_DIR
+ ${STM32CMSISFREERTOS_INCLUDE_DIR}
+ ${FREERTOS_INCLUDE_DIR}
+ ${FREERTOS_PORTABLE_INCLUDE_DIR}
+)
+
+set(SRC_FILE_FOUND SRC_FILE-NOTFOUND)
+find_file(SRC_FILE_FOUND cmsis_os.c
+ #PATH_SUFFIXES CMSIS_RTOS
+ PATHS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS
+ CMAKE_FIND_ROOT_PATH_BOTH
+)
+list(APPEND STM32FREERTOS_SOURCES ${SRC_FILE_FOUND})
+
+set(FREERTOS_SOURCES
+ croutine.c
+ event_groups.c
+ list.c
+ queue.c
+ tasks.c
+ timers.c
+ port.c
+
+ # choose here the appropriate memory management for FreeRTOS (see http://www.freertos.org/a00111.html)
+ # heap_1.c
+ # heap_2.c
+ # heap_3.c
+ heap_4.c
+ #heap_5.c
+)
+
+foreach(SRC_FILE ${FREERTOS_SOURCES})
+ set(FREERTOS_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(FREERTOS_SRC_FILE ${SRC_FILE}
+ PATH_SUFFIXES FreeRTOS_Source Include ${FREERTOS_PATH_SUFFIXES}
+ PATHS ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/FreeRTOS_Source/portable/MemMang ${PROJECT_BINARY_DIR}/FreeRTOS_Source/portable/GCC
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ list(APPEND STM32FREERTOS_SOURCES ${FREERTOS_SRC_FILE})
+endforeach()
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(STM32FREERTOS DEFAULT_MSG STM32FREERTOS_INCLUDE_DIR STM32FREERTOS_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindSTM32H7_CubePackage.cmake b/source/native/nf-interpreter/CMake/Modules/FindSTM32H7_CubePackage.cmake
new file mode 100644
index 00000000..1f0cb07d
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindSTM32H7_CubePackage.cmake
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories
+list(APPEND STM32H7_CubePackage_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/STM32H7_CubePackage_Source/Drivers/STM32H7xx_HAL_Driver/Inc")
+
+# source files
+set(STM32H7_CubePackage_SRCS
+
+ # add HAL files here as required
+
+ # SPIFFS
+ stm32h7xx_hal_qspi.c
+)
+
+foreach(SRC_FILE ${STM32H7_CubePackage_SRCS})
+ set(STM32H7_CubePackage_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(STM32H7_CubePackage_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ "${PROJECT_BINARY_DIR}/STM32H7_CubePackage_Source/Drivers/STM32H7xx_HAL_Driver/Src"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${STM32H7_CubePackage_SRC_FILE}") # debug helper
+ list(APPEND STM32H7_CubePackage_SOURCES ${STM32H7_CubePackage_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(STM32H7_CubePackage DEFAULT_MSG STM32H7_CubePackage_INCLUDE_DIRS STM32H7_CubePackage_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindSTM32L0_CubePackage.cmake b/source/native/nf-interpreter/CMake/Modules/FindSTM32L0_CubePackage.cmake
new file mode 100644
index 00000000..e126f65f
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindSTM32L0_CubePackage.cmake
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories
+list(APPEND STM32L0_CubePackage_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/STM32L0_CubePackage_Source/Drivers/STM32L0xx_HAL_Driver/Inc")
+
+# source files
+set(STM32_CubePackage_SRCS
+
+ # add HAL files here as required
+)
+
+foreach(SRC_FILE ${STM32L0_CubePackage_SRCS})
+ set(STM32L0_CubePackage_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(STM32L0_CubePackage_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ "${PROJECT_BINARY_DIR}/STM32L0_CubePackage_Source/Drivers/STM32L0xx_HAL_Driver/Src"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${STM32L0_CubePackage_SRC_FILE}") # debug helper
+ list(APPEND STM32L0_CubePackage_SOURCES ${STM32L0_CubePackage_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(STM32L0_CubePackage DEFAULT_MSG STM32L0_CubePackage_INCLUDE_DIRS STM32L0_CubePackage_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindSystem.Devices.Dac.cmake b/source/native/nf-interpreter/CMake/Modules/FindSystem.Devices.Dac.cmake
new file mode 100644
index 00000000..94b36889
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindSystem.Devices.Dac.cmake
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/System.Devices.Dac")
+
+
+# set include directories
+list(APPEND System.Devices.Dac_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Core)
+list(APPEND System.Devices.Dac_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+list(APPEND System.Devices.Dac_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/HAL/Include)
+list(APPEND System.Devices.Dac_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Include)
+list(APPEND System.Devices.Dac_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND System.Devices.Dac_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/System.Devices.Dac)
+
+
+# source files
+set(System.Devices.Dac_SRCS
+
+ sys_dev_dac_native.cpp
+ sys_dev_dac_native_System_Devices_Dac_DacController.cpp
+ sys_dev_dac_native_System_Devices_Dac_DacChannel.cpp
+
+ target_system_devices_dac_config.cpp
+)
+
+foreach(SRC_FILE ${System.Devices.Dac_SRCS})
+ set(System.Devices.Dac_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(System.Devices.Dac_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${TARGET_BASE_LOCATION}
+ ${PROJECT_SOURCE_DIR}/src/System.Devices.Dac
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${System.Devices.Dac_SRC_FILE}") # debug helper
+ list(APPEND System.Devices.Dac_SOURCES ${System.Devices.Dac_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(System.Devices.Dac DEFAULT_MSG System.Devices.Dac_INCLUDE_DIRS System.Devices.Dac_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindSystem.Math.cmake b/source/native/nf-interpreter/CMake/Modules/FindSystem.Math.cmake
new file mode 100644
index 00000000..e211bf2b
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindSystem.Math.cmake
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 2018 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${PROJECT_SOURCE_DIR}/src/CLR/System.Math")
+
+
+# set include directories
+list(APPEND System.Math_INCLUDE_DIRS "${BASE_PATH_FOR_THIS_MODULE}")
+
+
+# source files
+set(System.Math_SRCS
+
+ nf_native_system_math.cpp
+ nf_native_system_math_System_Math.cpp
+
+)
+
+foreach(SRC_FILE ${System.Math_SRCS})
+ set(System.Math_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(System.Math_SRC_FILE ${SRC_FILE}
+ PATHS
+ "${BASE_PATH_FOR_THIS_MODULE}"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${System.Math_SRC_FILE}") # debug helper
+ list(APPEND System.Math_SOURCES ${System.Math_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(System.Math DEFAULT_MSG System.Math_INCLUDE_DIRS System.Math_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindSystem.Net.cmake b/source/native/nf-interpreter/CMake/Modules/FindSystem.Net.cmake
new file mode 100644
index 00000000..3f8f444f
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindSystem.Net.cmake
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# set include directories
+list(APPEND System.Net_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/HAL/Include")
+list(APPEND System.Net_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/DeviceInterfaces/System.Net")
+
+# source files
+set(System.Net_SRCS
+
+ # System.Net
+ sys_net_native.cpp
+ sys_net_native_System_Net_Sockets_NativeSocket.cpp
+
+ # System.Net.NetworkInformation
+ sys_net_native_System_Net_NetworkInformation_NetworkInterface.cpp
+ sys_net_native_System_Net_NetworkInformation_Wireless80211Configuration.cpp
+ sys_net_native_System_Net_NetworkInformation_WirelessAPConfiguration.cpp
+
+ # System.Security.Cryptography.X509Certificates
+ sys_net_native_System_Security_Cryptography_X509Certificates_X509Certificate.cpp
+ sys_net_native_System_Security_Cryptography_X509Certificates_X509Certificate2.cpp
+
+ # System.Net.Security
+ sys_net_native_System_Net_Security_SslNative.cpp
+ sys_net_native_System_Net_Security_CertificateManager.cpp
+
+)
+
+foreach(SRC_FILE ${System.Net_SRCS})
+ set(System.Net_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(System.Net_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ "${PROJECT_SOURCE_DIR}/src/DeviceInterfaces/System.Net"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${System.Net_SRC_FILE}") # debug helper
+ list(APPEND System.Net_SOURCES ${System.Net_SRC_FILE})
+endforeach()
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(System.Net DEFAULT_MSG System.Net_INCLUDE_DIRS System.Net_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindTI_SimpleLink.cmake b/source/native/nf-interpreter/CMake/Modules/FindTI_SimpleLink.cmake
new file mode 100644
index 00000000..9c76d4ee
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindTI_SimpleLink.cmake
@@ -0,0 +1,95 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+###################################################################################################################################
+# WHEN ADDING A NEW series add the respective name to the list below along with the CMake files with GCC options and source files
+###################################################################################################################################
+
+# check if the series name is supported
+
+set(TI_SIMPLELINK_SUPPORTED_SERIES "CC32xx" CACHE INTERNAL "supported TI series names")
+
+list(FIND TI_SIMPLELINK_SUPPORTED_SERIES ${TARGET_SERIES} TARGET_SERIES_NAME_INDEX)
+if(TI_SIMPLELINK_SUPPORTED_SERIES EQUAL -1)
+ if(TARGET_SERIES_NAME_INDEX EQUAL -1)
+ message(FATAL_ERROR "\n\nSorry but the ${TARGET_SERIES} is not supported at this time...\nYou can wait for it to be added, or you might want to contribute by working on a PR for it.\n\n")
+ else()
+ # series is supported by TI
+ set(TARGET_VENDOR "TI" CACHE INTERNAL "target vendor is TI")
+ endif()
+endif()
+
+# including here the CMake files for the source files specific to the target series
+include(TI_SimpleLink_${TARGET_SERIES}_sources)
+
+# and here the GCC options tuned for the target series
+include(TI_SimpleLink_${TARGET_SERIES}_GCC_options)
+
+# includes for FreeRTOS
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/include")
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/include/private")
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/FreeRTOS/portable/GCC/ARM_CM3")
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${TARGET_BASE_LOCATION}")
+
+# source files for FreeRTOS
+set(FreeRTOS_SRCS
+
+ # FreeRTOS
+ event_groups.c
+ list.c
+ queue.c
+ stream_buffer.c
+ tasks.c
+ timers.c
+ port.c
+ heap_4.c
+ clock.c
+ memory.c
+ mqueue.c
+ pthread_barrier.c
+ pthread_cond.c
+ pthread.c
+ pthread_mutex.c
+ pthread_rwlock.c
+ sched.c
+ semaphore.c
+ sleep.c
+ timer.c
+ PTLS.c
+ aeabi_portable.c
+ ClockP_freertos.c
+ DebugP_freertos.c
+ MutexP_freertos.c
+ SemaphoreP_freertos.c
+ SystemP_freertos.c
+ HwiPCC32XX_freertos.c
+ PowerCC32XX_freertos.c
+ startup_cc32xx_gcc.c
+
+)
+
+foreach(SRC_FILE ${FreeRTOS_SRCS})
+ set(FreeRTOS_SCR_FILE SRC_FILE -NOTFOUND)
+ find_file(FreeRTOS_SCR_FILE ${SRC_FILE}
+ PATHS
+
+ # FreeRTOS
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/posix/freertos"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/source"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/kernel/freertos/dpl"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/kernel/freertos/startup"
+ "${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/FreeRTOS/portable/MemMang"
+ "${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/FreeRTOS/portable/GCC/ARM_CM3"
+ "${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/FreeRTOS"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${FreeRTOS_SCR_FILE}") # debug helper
+ list(APPEND TI_SimpleLink_SOURCES ${FreeRTOS_SCR_FILE})
+endforeach()
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(TI_SimpleLink DEFAULT_MSG TI_SimpleLink_INCLUDE_DIRS TI_SimpleLink_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Adc.cmake b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Adc.cmake
new file mode 100644
index 00000000..70d6479a
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Adc.cmake
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/Windows.Devices.Adc")
+
+
+# set include directories
+list(APPEND Windows.Devices.Adc_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Core)
+list(APPEND Windows.Devices.Adc_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+list(APPEND Windows.Devices.Adc_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/HAL/Include)
+list(APPEND Windows.Devices.Adc_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Include)
+list(APPEND Windows.Devices.Adc_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND Windows.Devices.Adc_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/Windows.Devices.Adc)
+
+
+# source files
+set(Windows.Devices.Adc_SRCS
+
+ win_dev_adc_native.cpp
+ win_dev_adc_native_Windows_Devices_Adc_AdcController.cpp
+ win_dev_adc_native_Windows_Devices_Adc_AdcChannel.cpp
+
+ target_windows_devices_adc_config.cpp
+)
+
+foreach(SRC_FILE ${Windows.Devices.Adc_SRCS})
+ set(Windows.Devices.Adc_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(Windows.Devices.Adc_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${TARGET_BASE_LOCATION}
+ ${PROJECT_SOURCE_DIR}/src/Windows.Devices.Adc
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${Windows.Devices.Adc_SRC_FILE}") # debug helper
+ list(APPEND Windows.Devices.Adc_SOURCES ${Windows.Devices.Adc_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Windows.Devices.Adc DEFAULT_MSG Windows.Devices.Adc_INCLUDE_DIRS Windows.Devices.Adc_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Gpio.cmake b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Gpio.cmake
new file mode 100644
index 00000000..7cda082a
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Gpio.cmake
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/Windows.Devices.Gpio")
+
+
+# set include directories
+list(APPEND Windows.Devices.Gpio_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Core)
+list(APPEND Windows.Devices.Gpio_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+list(APPEND Windows.Devices.Gpio_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/HAL/Include)
+list(APPEND Windows.Devices.Gpio_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Include)
+list(APPEND Windows.Devices.Gpio_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND Windows.Devices.Gpio_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/Windows.Devices.Gpio)
+
+
+# source files
+set(Windows.Devices.Gpio_SRCS
+
+ # class library source files
+ win_dev_gpio_native_Windows_Devices_Gpio_GpioController.cpp
+ win_dev_gpio_native_Windows_Devices_Gpio_GpioPin.cpp
+ win_dev_gpio_native_Windows_Devices_Gpio_GpioChangeCounter.cpp
+ win_dev_gpio_native.cpp
+
+ # core source files
+ AsyncCompletions.cpp
+ AsyncContinuations.cpp
+ NativeEventDispatcher.cpp
+ InterruptHandler.cpp
+ Hardware.cpp
+)
+
+foreach(SRC_FILE ${Windows.Devices.Gpio_SRCS})
+ set(Windows.Devices.Gpio_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(Windows.Devices.Gpio_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ # class library source files
+ ${BASE_PATH_FOR_THIS_MODULE}
+
+ # core source files
+ ${PROJECT_SOURCE_DIR}/src/PAL/AsyncProcCall
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core/NativeEventDispatcher
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core/InterruptHandler
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core/Hardware
+ ${PROJECT_SOURCE_DIR}/src/Windows.Devices.Gpio
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${Windows.Devices.Gpio_SRC_FILE}") # debug helper
+ list(APPEND Windows.Devices.Gpio_SOURCES ${Windows.Devices.Gpio_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Windows.Devices.Gpio DEFAULT_MSG Windows.Devices.Gpio_INCLUDE_DIRS Windows.Devices.Gpio_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.I2c.cmake b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.I2c.cmake
new file mode 100644
index 00000000..ea9f242c
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.I2c.cmake
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/Windows.Devices.I2c")
+
+
+# set include directories
+list(APPEND Windows.Devices.I2c_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Core)
+list(APPEND Windows.Devices.I2c_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+list(APPEND Windows.Devices.I2c_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/HAL/Include)
+list(APPEND Windows.Devices.I2c_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Include)
+list(APPEND Windows.Devices.I2c_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND Windows.Devices.I2c_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/Windows.Devices.I2c)
+
+
+# source files
+set(Windows.Devices.I2c_SRCS
+
+ win_dev_i2c_native.cpp
+ win_dev_i2c_native_Windows_Devices_I2C_I2cDevice.cpp
+ win_dev_i2c_native_Windows_Devices_I2c_I2cController.cpp
+
+ target_windows_devices_i2c_config.cpp
+)
+
+foreach(SRC_FILE ${Windows.Devices.I2c_SRCS})
+ set(Windows.Devices.I2c_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(Windows.Devices.I2c_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${TARGET_BASE_LOCATION}
+ ${PROJECT_SOURCE_DIR}/src/Windows.Devices.I2c
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${Windows.Devices.I2c_SRC_FILE}") # debug helper
+ list(APPEND Windows.Devices.I2c_SOURCES ${Windows.Devices.I2c_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Windows.Devices.I2c DEFAULT_MSG Windows.Devices.I2c_INCLUDE_DIRS Windows.Devices.I2c_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Pwm.cmake b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Pwm.cmake
new file mode 100644
index 00000000..3dbc6351
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Pwm.cmake
@@ -0,0 +1,43 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/Windows.Devices.Pwm")
+
+
+# set include directories
+list(APPEND Windows.Devices.Pwm_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Core)
+list(APPEND Windows.Devices.Pwm_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+list(APPEND Windows.Devices.Pwm_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/HAL/Include)
+list(APPEND Windows.Devices.Pwm_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Include)
+list(APPEND Windows.Devices.Pwm_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND Windows.Devices.Pwm_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/Windows.Devices.Pwm)
+
+
+# source files
+set(Windows.Devices.Pwm_SRCS
+
+ win_dev_pwm_native.cpp
+ win_dev_pwm_native_Windows_Devices_Pwm_PwmPin.cpp
+ win_dev_pwm_native_Windows_Devices_Pwm_PwmController.cpp
+)
+
+foreach(SRC_FILE ${Windows.Devices.Pwm_SRCS})
+ set(Windows.Devices.Pwm_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(Windows.Devices.Pwm_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${PROJECT_SOURCE_DIR}/src/Windows.Devices.Pwm
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${Windows.Devices.Pwm_SRC_FILE}") # debug helper
+ list(APPEND Windows.Devices.Pwm_SOURCES ${Windows.Devices.Pwm_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Windows.Devices.Pwm DEFAULT_MSG Windows.Devices.Pwm_INCLUDE_DIRS Windows.Devices.Pwm_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.SerialCommunication.cmake b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.SerialCommunication.cmake
new file mode 100644
index 00000000..5c3baf41
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.SerialCommunication.cmake
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/Windows.Devices.SerialCommunication")
+
+
+# set include directories
+list(APPEND Windows.Devices.SerialCommunication_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND Windows.Devices.SerialCommunication_INCLUDE_DIRS ${TARGET_BASE_LOCATION})
+list(APPEND Windows.Devices.SerialCommunication_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/Windows.Devices.SerialCommunication)
+
+
+# source files
+set(Windows.Devices.SerialCommunication_SRCS
+
+ win_dev_serial_native_Windows_Devices_SerialCommunication_SerialDevice.cpp
+ win_dev_serial_native.cpp
+
+ target_windows_devices_serialcommunication_config.cpp
+)
+
+foreach(SRC_FILE ${Windows.Devices.SerialCommunication_SRCS})
+ set(Windows.Devices.SerialCommunication_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(Windows.Devices.SerialCommunication_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${TARGET_BASE_LOCATION}
+ ${PROJECT_SOURCE_DIR}/src/Windows.Devices.SerialCommunication
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${Windows.Devices.SerialCommunication_SRC_FILE}") # debug helper
+ list(APPEND Windows.Devices.SerialCommunication_SOURCES ${Windows.Devices.SerialCommunication_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Windows.Devices.SerialCommunication DEFAULT_MSG Windows.Devices.SerialCommunication_INCLUDE_DIRS Windows.Devices.SerialCommunication_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Spi.cmake b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Spi.cmake
new file mode 100644
index 00000000..ec3f708f
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.Spi.cmake
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/Windows.Devices.Spi")
+
+
+# set include directories
+list(APPEND Windows.Devices.Spi_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Core)
+list(APPEND Windows.Devices.Spi_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+list(APPEND Windows.Devices.Spi_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/HAL/Include)
+list(APPEND Windows.Devices.Spi_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Include)
+list(APPEND Windows.Devices.Spi_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND Windows.Devices.Spi_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/Windows.Devices.Spi)
+
+
+# source files
+set(Windows.Devices.Spi_SRCS
+
+ win_dev_spi_native_Windows_Devices_Spi_SpiBusInfo.cpp
+ win_dev_spi_native_Windows_Devices_Spi_SpiController.cpp
+ win_dev_spi_native_Windows_Devices_Spi_SpiDevice.cpp
+ win_dev_spi_native.cpp
+
+ target_windows_devices_spi_config.cpp
+)
+
+foreach(SRC_FILE ${Windows.Devices.Spi_SRCS})
+ set(Windows.Devices.Spi_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(Windows.Devices.Spi_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${TARGET_BASE_LOCATION}
+ ${PROJECT_SOURCE_DIR}/src/Windows.Devices.Spi
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${Windows.Devices.Spi_SRC_FILE}") # debug helper
+ list(APPEND Windows.Devices.Spi_SOURCES ${Windows.Devices.Spi_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Windows.Devices.Spi DEFAULT_MSG Windows.Devices.Spi_INCLUDE_DIRS Windows.Devices.Spi_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.WiFi.cmake b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.WiFi.cmake
new file mode 100644
index 00000000..e1221581
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindWindows.Devices.WiFi.cmake
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/Windows.Devices.Wifi")
+
+
+# set include directories
+list(APPEND Windows.Devices.Wifi_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Core)
+list(APPEND Windows.Devices.Wifi_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+list(APPEND Windows.Devices.Wifi_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/HAL/Include)
+list(APPEND Windows.Devices.Wifi_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Include)
+list(APPEND Windows.Devices.Wifi_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND Windows.Devices.Wifi_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/Windows.Devices.Wifi)
+
+
+# source files
+set(Windows.Devices.Wifi_SRCS
+
+ win_dev_wifi_native.cpp
+ win_dev_wifi_native_Windows_Devices_WIFI_WifiAdapter.cpp
+)
+
+foreach(SRC_FILE ${Windows.Devices.Wifi_SRCS})
+ set(Windows.Devices.Wifi_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(Windows.Devices.Wifi_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${PROJECT_SOURCE_DIR}/src/Windows.Devices.Wifi
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ #message("${SRC_FILE} >> ${Windows.Devices.Wifi_SRC_FILE}") # debug helper
+ list(APPEND Windows.Devices.Wifi_SOURCES ${Windows.Devices.Wifi_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Windows.Devices.Wifi DEFAULT_MSG Windows.Devices.Wifi_INCLUDE_DIRS Windows.Devices.Wifi_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindWindows.Networking.Sockets.cmake b/source/native/nf-interpreter/CMake/Modules/FindWindows.Networking.Sockets.cmake
new file mode 100644
index 00000000..a54b830f
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindWindows.Networking.Sockets.cmake
@@ -0,0 +1,45 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+#set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/Windows.Networking.Sockets")
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/System.Net")
+
+
+# set include directories
+list(APPEND Windows.Networking.Sockets_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Core)
+list(APPEND Windows.Networking.Sockets_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+list(APPEND Windows.Networking.Sockets_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/HAL/Include)
+list(APPEND Windows.Networking.Sockets_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/PAL/Include)
+list(APPEND Windows.Networking.Sockets_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND Windows.Networking.Sockets_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/Windows.Networking.Sockets)
+
+
+# source files
+set(Windows.Networking.Sockets_SRCS
+
+# win_net_sockets_native.cpp
+# win_net_sockets_native_Windows_Networking_Sockets_SocketNative.cpp
+ sys_net_native.cpp
+ sys_net_native_System_Net_Sockets_NativeSocket.cpp
+)
+
+foreach(SRC_FILE ${Windows.Networking.Sockets_SRCS})
+ set(Windows.Networking.Sockets_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(Windows.Networking.Sockets_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${PROJECT_SOURCE_DIR}/src/Windows.Networking.Sockets
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${Windows.Networking.Sockets_SRC_FILE}") # debug helper
+ list(APPEND Windows.Networking.Sockets_SOURCES ${Windows.Networking.Sockets_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Windows.Networking.Sockets DEFAULT_MSG Windows.Networking.Sockets_INCLUDE_DIRS Windows.Networking.Sockets_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindWindows.Storage.cmake b/source/native/nf-interpreter/CMake/Modules/FindWindows.Storage.cmake
new file mode 100644
index 00000000..2577f5e7
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindWindows.Storage.cmake
@@ -0,0 +1,52 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/Windows.Storage")
+
+
+# set include directories
+if(RTOS_CHIBIOS_CHECK)
+ list(APPEND Windows.Storage_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/fatfs/src)
+ set( PROJECT_COMMON_PATH ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/common)
+endif()
+
+list(APPEND Windows.Storage_INCLUDE_DIRS ${TARGET_BASE_LOCATION}/Include)
+list(APPEND Windows.Storage_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND Windows.Storage_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/Windows.Storage)
+
+
+# source files
+set(Windows.Storage_SRCS
+
+ win_storage_native_Windows_Storage_FileIO.cpp
+ win_storage_native_Windows_Storage_StorageFile.cpp
+ win_storage_native_Windows_Storage_StorageFolder.cpp
+ win_storage_native_Windows_Storage_Devices_SDCard.cpp
+ win_storage_native.cpp
+
+ Target_Windows_Storage.c
+)
+
+foreach(SRC_FILE ${Windows.Storage_SRCS})
+ set(Windows.Storage_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(Windows.Storage_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${TARGET_BASE_LOCATION}
+ ${PROJECT_COMMON_PATH}
+ ${PROJECT_SOURCE_DIR}/src/Windows.Storage
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${Windows.Storage_SRC_FILE}") # debug helper
+ list(APPEND Windows.Storage_SOURCES ${Windows.Storage_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Windows.Storage DEFAULT_MSG Windows.Storage_INCLUDE_DIRS Windows.Storage_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindWireProtocol.cmake b/source/native/nf-interpreter/CMake/Modules/FindWireProtocol.cmake
new file mode 100644
index 00000000..4ab68c8c
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindWireProtocol.cmake
@@ -0,0 +1,71 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# handle Wire Protocol _TRACE_ preferences, if any
+option(NF_WP_TRACE_ERRORS "option to Trace errors with Wire Protocol")
+option(NF_WP_TRACE_HEADERS "option to Trace headers with Wire Protocol")
+option(NF_WP_TRACE_STATE "option to Trace state with Wire Protocol")
+option(NF_WP_TRACE_NODATA "option to Trace empty packets with Wire Protocol")
+option(NF_WP_TRACE_ALL "option to Trace with Wire Protocol")
+option(NF_WP_IMPLEMENTS_CRC32 "option to report if target implements CRC32 in Wire Protocol")
+
+# this one has to follow the declaration on src\CLR\Include\WireProtocol_Message.h
+# #define TRACE_ERRORS 1
+# #define TRACE_HEADERS 2
+# #define TRACE_STATE 4
+# #define TRACE_NODATA 8
+
+# default to 0 (no Wire Protocol trace)
+set(WP_TRACE_MASK 0 CACHE INTERNAL "WP trace mask")
+
+if(NF_WP_TRACE_ERRORS)
+ math(EXPR WP_TRACE_MASK "${WP_TRACE_MASK} + 1")
+endif()
+if(NF_WP_TRACE_HEADERS)
+ math(EXPR WP_TRACE_MASK "${WP_TRACE_MASK} + 2")
+endif()
+if(NF_WP_TRACE_STATE)
+ math(EXPR WP_TRACE_MASK "${WP_TRACE_MASK} + 4")
+endif()
+if(NF_WP_TRACE_NODATA)
+ math(EXPR WP_TRACE_MASK "${WP_TRACE_MASK} + 8")
+endif()
+if(NF_WP_TRACE_ALL)
+ math(EXPR WP_TRACE_MASK "8 + 4 + 2 + 1")
+endif()
+
+message(STATUS "Wire Protocol TRACE_MASK is '${WP_TRACE_MASK}'") # debug helper
+
+# set include directories for Wire Protocol
+list(APPEND WireProtocol_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)
+
+# source files for Wire Protocol
+set(WireProtocol_SRCS
+
+ WireProtocol_Message.c
+ WireProtocol_MonitorCommands.c
+ WireProtocol_HAL_Interface.c
+ WireProtocol_App_Interface.c
+
+ nanoSupport_CRC32.c
+)
+
+foreach(SRC_FILE ${WireProtocol_SRCS})
+ set(WireProtocol_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(WireProtocol_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_SOURCE_DIR}/src/CLR/WireProtocol
+ ${PROJECT_SOURCE_DIR}/src/CLR/Core
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${WireProtocol_SRC_FILE}") # debug helper
+ list(APPEND WireProtocol_SOURCES ${WireProtocol_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(WireProtocol DEFAULT_MSG WireProtocol_INCLUDE_DIRS WireProtocol_SOURCES)
\ No newline at end of file
diff --git a/source/native/nf-interpreter/CMake/Modules/FindmbedTLS.cmake b/source/native/nf-interpreter/CMake/Modules/FindmbedTLS.cmake
new file mode 100644
index 00000000..52149f83
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindmbedTLS.cmake
@@ -0,0 +1,157 @@
+#
+# Copyright (c) 2018 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# because of issues when passing the config file as a string when using ExternalProject_Add with mbedTLS
+# we are replicating their CMakeList here. Actually this is more a simplified version...
+
+# List of the required include paths
+list(APPEND mbedTLS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/mbedTLS_Source/include/)
+
+option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF)
+option(ENABLE_ZLIB_SUPPORT "Build mbed TLS with zlib library." OFF)
+
+if(ENABLE_ZLIB_SUPPORT)
+ find_package(ZLIB)
+
+ if(ZLIB_FOUND)
+ include_directories(${ZLIB_INCLUDE_DIR})
+ endif(ZLIB_FOUND)
+endif(ENABLE_ZLIB_SUPPORT)
+
+# add_subdirectory(library)
+# add_subdirectory(include)
+
+set(src_crypto
+ aes.c
+ aesni.c
+ arc4.c
+ aria.c
+ asn1parse.c
+ asn1write.c
+ base64.c
+ bignum.c
+ blowfish.c
+ camellia.c
+ ccm.c
+ cipher.c
+ cipher_wrap.c
+ cmac.c
+ ctr_drbg.c
+ des.c
+ dhm.c
+ ecdh.c
+ ecdsa.c
+ ecjpake.c
+ ecp.c
+ ecp_curves.c
+ entropy.c
+ entropy_poll.c
+ error.c
+ gcm.c
+ havege.c
+ hkdf.c
+ hmac_drbg.c
+ md.c
+ md2.c
+ md4.c
+ md5.c
+ md_wrap.c
+ memory_buffer_alloc.c
+ oid.c
+ padlock.c
+ pem.c
+ pk.c
+ pk_wrap.c
+ pkcs12.c
+ pkcs5.c
+ pkparse.c
+ pkwrite.c
+ platform.c
+ platform_util.c
+ ripemd160.c
+ rsa.c
+ rsa_internal.c
+ sha1.c
+ sha256.c
+ sha512.c
+ threading.c
+ timing.c
+ version.c
+ version_features.c
+ xtea.c
+
+ # platform implementation of hardware random provider
+ mbedtls_entropy_hardware_pool.c
+)
+
+set(src_x509
+ certs.c
+ pkcs11.c
+ x509.c
+ x509_create.c
+ x509_crl.c
+ x509_crt.c
+ x509_csr.c
+ x509write_crt.c
+ x509write_csr.c
+)
+
+set(src_tls
+ debug.c
+ net_sockets.c
+ ssl_cache.c
+ ssl_ciphersuites.c
+ ssl_cli.c
+ ssl_cookie.c
+ ssl_srv.c
+ ssl_ticket.c
+ ssl_tls.c
+)
+
+foreach(SRC_FILE ${src_crypto})
+ set(MBEDTLS_SRC_FILE SRC_FILE -NOTFOUND)
+ find_file(MBEDTLS_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_BINARY_DIR}/mbedTLS_Source/library
+
+ ${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${MBEDTLS_SRC_FILE}") # debug helper
+ list(APPEND mbedTLS_SOURCES ${MBEDTLS_SRC_FILE})
+endforeach()
+
+# unset this warning as error required for this source file
+SET_SOURCE_FILES_PROPERTIES( ${PROJECT_BINARY_DIR}/mbedTLS_Source/library/hmac_drbg.c PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized)
+SET_SOURCE_FILES_PROPERTIES( ${PROJECT_BINARY_DIR}/mbedTLS_Source/library/x509_crt.c PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized)
+
+foreach(SRC_FILE ${src_x509})
+ set(MBEDTLS_SRC_FILE SRC_FILE -NOTFOUND)
+ find_file(MBEDTLS_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_BINARY_DIR}/mbedTLS_Source/library
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${MBEDTLS_SRC_FILE}") # debug helper
+ list(APPEND mbedTLS_SOURCES ${MBEDTLS_SRC_FILE})
+endforeach()
+
+foreach(SRC_FILE ${src_tls})
+ set(MBEDTLS_SRC_FILE SRC_FILE -NOTFOUND)
+ find_file(MBEDTLS_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_BINARY_DIR}/mbedTLS_Source/library
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${MBEDTLS_SRC_FILE}") # debug helper
+ list(APPEND mbedTLS_SOURCES ${MBEDTLS_SRC_FILE})
+endforeach()
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(mbedTLS DEFAULT_MSG mbedTLS_INCLUDE_DIRS mbedTLS_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Devices.Can.cmake b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Devices.Can.cmake
new file mode 100644
index 00000000..384152a8
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Devices.Can.cmake
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2018 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/nanoFramework.Devices.Can")
+
+
+# set include directories
+list(APPEND nanoFramework.Devices.Can_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND nanoFramework.Devices.Can_INCLUDE_DIRS ${TARGET_BASE_LOCATION})
+list(APPEND nanoFramework.Devices.Can_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/nanoFramework.Devices.Can)
+
+# source files
+set(nanoFramework.Devices.Can_SRCS
+
+ nf_devices_can_native_nanoFramework_Devices_Can_CanController.cpp
+ nf_devices_can_native.cpp
+
+ target_nf_devices_can_config.cpp
+)
+
+foreach(SRC_FILE ${nanoFramework.Devices.Can_SRCS})
+ set(nanoFramework.Devices.Can_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(nanoFramework.Devices.Can_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${TARGET_BASE_LOCATION}
+ ${PROJECT_SOURCE_DIR}/src/nanoFramework.Devices.Can
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${nanoFramework.Devices.Can_SRC_FILE}") # debug helper
+ list(APPEND nanoFramework.Devices.Can_SOURCES ${nanoFramework.Devices.Can_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(nanoFramework.Devices.Can DEFAULT_MSG nanoFramework.Devices.Can_INCLUDE_DIRS nanoFramework.Devices.Can_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Devices.OneWire.cmake b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Devices.OneWire.cmake
new file mode 100644
index 00000000..c3d9e3a4
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Devices.OneWire.cmake
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2018 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/nanoFramework.Devices.OneWire")
+
+
+# set include directories
+list(APPEND nanoFramework.Devices.OneWire_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
+list(APPEND nanoFramework.Devices.OneWire_INCLUDE_DIRS ${TARGET_BASE_LOCATION})
+list(APPEND nanoFramework.Devices.OneWire_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/nanoFramework.Devices.OneWire)
+
+# source files
+set(nanoFramework.Devices.OneWire_SRCS
+
+ nf_devices_onewire_native_nanoFramework_Devices_OneWire_OneWireController.cpp
+ nf_devices_onewire_native.cpp
+
+ target_nf_devices_onewire_config.cpp
+)
+
+foreach(SRC_FILE ${nanoFramework.Devices.OneWire_SRCS})
+ set(nanoFramework.Devices.OneWire_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(nanoFramework.Devices.OneWire_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+ ${TARGET_BASE_LOCATION}
+ ${PROJECT_SOURCE_DIR}/src/nanoFramework.Devices.OneWire
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${nanoFramework.Devices.OneWire_SRC_FILE}") # debug helper
+ list(APPEND nanoFramework.Devices.OneWire_SOURCES ${nanoFramework.Devices.OneWire_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(nanoFramework.Devices.OneWire DEFAULT_MSG nanoFramework.Devices.OneWire_INCLUDE_DIRS nanoFramework.Devices.OneWire_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Hardware.Esp32.cmake b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Hardware.Esp32.cmake
new file mode 100644
index 00000000..9255d68c
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Hardware.Esp32.cmake
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/nanoFramework.Hardware.Esp32")
+
+
+# set include directories
+list(APPEND nanoFramework.Hardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/CLR/Core")
+list(APPEND nanoFramework.Hardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/CLR/Include")
+list(APPEND nanoFramework.Hardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/HAL/Include")
+list(APPEND nanoFramework.Hardware.Esp32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/PAL/Include")
+list(APPEND nanoFramework.Hardware.Esp32_INCLUDE_DIRS "${BASE_PATH_FOR_THIS_MODULE}")
+
+# source files
+set(nanoFramework.Hardware.Esp32_SRCS
+
+ nanoFramework_hardware_esp32_native.cpp
+ nanoFramework_hardware_esp32_native_Hardware_Esp32_sleep.cpp
+ nanoFramework_hardware_esp32_native_Hardware_Esp32_Logging.cpp
+ nanoFramework_hardware_esp32_native_Hardware_Esp32_HighResTimer.cpp
+ nanoFramework_hardware_esp32_native_Hardware_Esp32_Configuration.cpp
+)
+
+foreach(SRC_FILE ${nanoFramework.Hardware.Esp32_SRCS})
+ set(nanoFramework.Hardware.Esp32_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(nanoFramework.Hardware.Esp32_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${nanoFramework.Hardware.Esp32_SRC_FILE}") # debug helper
+ list(APPEND nanoFramework.Hardware.Esp32_SOURCES ${nanoFramework.Hardware.Esp32_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(nanoFramework.Hardware.Esp32 DEFAULT_MSG nanoFramework.Hardware.Esp32_INCLUDE_DIRS nanoFramework.Hardware.Esp32_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Hardware.Stm32.cmake b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Hardware.Stm32.cmake
new file mode 100644
index 00000000..87dfaeb5
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Hardware.Stm32.cmake
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/nanoFramework.Hardware.Stm32")
+
+
+# set include directories
+# list(APPEND nanoFramework.Hardware.Stm32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/CLR/Core")
+# list(APPEND nanoFramework.Hardware.Stm32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/CLR/Include")
+# list(APPEND nanoFramework.Hardware.Stm32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/HAL/Include")
+# list(APPEND nanoFramework.Hardware.Stm32_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/PAL/Include")
+list(APPEND nanoFramework.Hardware.Stm32_INCLUDE_DIRS "${BASE_PATH_FOR_THIS_MODULE}")
+
+
+# source files
+set(nanoFramework.Hardware.Stm32_SRCS
+
+ nf_hardware_stm32_native.cpp
+ nf_hardware_stm32_native_nanoFramework_Hardware_Stm32_BackupMemory.cpp
+ nf_hardware_stm32_native_nanoFramework_Hardware_Stm32_Power.cpp
+ nf_hardware_stm32_native_nanoFramework_Hardware_Stm32_RTC.cpp
+ nf_hardware_stm32_native_nanoFramework_Hardware_Stm32_Utilities.cpp
+)
+
+foreach(SRC_FILE ${nanoFramework.Hardware.Stm32_SRCS})
+ set(nanoFramework.Hardware.Stm32_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(nanoFramework.Hardware.Stm32_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${BASE_PATH_FOR_THIS_MODULE}
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${nanoFramework.Hardware.Stm32_SRC_FILE}") # debug helper
+ list(APPEND nanoFramework.Hardware.Stm32_SOURCES ${nanoFramework.Hardware.Stm32_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(nanoFramework.Hardware.Stm32 DEFAULT_MSG nanoFramework.Hardware.Stm32_INCLUDE_DIRS nanoFramework.Hardware.Stm32_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Networking.Sntp.cmake b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Networking.Sntp.cmake
new file mode 100644
index 00000000..75604406
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Networking.Sntp.cmake
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+
+# set include directories
+list(APPEND CHIBIOS_LWIP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/ext/lwip/src/include/lwip)
+list(APPEND nanoFramework.Networking.Sntp_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/HAL/Include")
+list(APPEND nanoFramework.Networking.Sntp_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/DeviceInterfaces/Networking.Sntp")
+
+
+# source files
+set(nanoFramework.Networking.Sntp_SRCS
+
+ # source files of the assembly
+ nf_networking_sntp_nanoFramework_Networking_Sntp.cpp
+ nf_networking_sntp.cpp
+)
+
+foreach(SRC_FILE ${nanoFramework.Networking.Sntp_SRCS})
+ set(nanoFramework.Networking.Sntp_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(nanoFramework.Networking.Sntp_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ # path for source files of this module
+ ${PROJECT_SOURCE_DIR}/src/DeviceInterfaces/Networking.Sntp
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${nanoFramework.Networking.Sntp_SRC_FILE}") # debug helper
+ list(APPEND nanoFramework.Networking.Sntp_SOURCES ${nanoFramework.Networking.Sntp_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(nanoFramework.Networking.Sntp DEFAULT_MSG nanoFramework.Networking.Sntp_INCLUDE_DIRS nanoFramework.Networking.Sntp_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.ResourceManager.cmake b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.ResourceManager.cmake
new file mode 100644
index 00000000..bb2dbb00
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.ResourceManager.cmake
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+
+# set include directories
+list(APPEND nanoFramework.ResourceManager_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/HAL/Include")
+list(APPEND nanoFramework.ResourceManager_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/nanoFramework.ResourceManager")
+
+
+# source files
+set(nanoFramework.ResourceManager_SRCS
+
+ # source files of the assembly
+ nf_system_resourcemanager_nanoFramework_Runtime_Native_ResourceUtility.cpp
+ nf_system_resourcemanager_System_Resources_ResourceManager.cpp
+ nf_system_resourcemanager.cpp
+)
+
+foreach(SRC_FILE ${nanoFramework.ResourceManager_SRCS})
+ set(nanoFramework.ResourceManager_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(nanoFramework.ResourceManager_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ # path for source files of this module
+ ${PROJECT_SOURCE_DIR}/src/nanoFramework.ResourceManager
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${nanoFramework.ResourceManager_SRC_FILE}") # debug helper
+ list(APPEND nanoFramework.ResourceManager_SOURCES ${nanoFramework.ResourceManager_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(nanoFramework.ResourceManager DEFAULT_MSG nanoFramework.ResourceManager_INCLUDE_DIRS nanoFramework.ResourceManager_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Runtime.Events.cmake b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Runtime.Events.cmake
new file mode 100644
index 00000000..d7e9be4f
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.Runtime.Events.cmake
@@ -0,0 +1,55 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# native code directory
+set(BASE_PATH_FOR_THIS_MODULE "${PROJECT_SOURCE_DIR}/src/nanoFramework.Runtime.Events")
+
+
+# set include directories
+list(APPEND nanoFramework.Runtime.Events_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/CLR/Core")
+list(APPEND nanoFramework.Runtime.Events_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/CLR/Include")
+list(APPEND nanoFramework.Runtime.Events_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/HAL/Include")
+list(APPEND nanoFramework.Runtime.Events_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/PAL/Include")
+list(APPEND nanoFramework.Runtime.Events_INCLUDE_DIRS "${BASE_PATH_FOR_THIS_MODULE}")
+
+
+# source files
+set(nanoFramework.Runtime.Events_SRCS
+
+ # source files of the assembly
+ nf_rt_events_native_nanoFramework_Runtime_Events_EventSink.cpp
+ nf_rt_events_native_nanoFramework_Runtime_Events_NativeEventDispatcher.cpp
+ nf_rt_events_native_nanoFramework_Runtime_Events_WeakDelegate.cpp
+ nf_rt_events_native.cpp
+
+ # source files
+ AsyncCompletions.cpp
+ AsyncContinuations.cpp
+ nanoPAL_Events_functions.cpp
+
+)
+
+foreach(SRC_FILE ${nanoFramework.Runtime.Events_SRCS})
+ set(nanoFramework.Runtime.Events_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(nanoFramework.Runtime.Events_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ # path for source files of this module
+ ${BASE_PATH_FOR_THIS_MODULE}
+
+ # path for AsyncProcCall and related code
+ ${PROJECT_SOURCE_DIR}/src/PAL/AsyncProcCall
+ ${PROJECT_SOURCE_DIR}/src/PAL/Events
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${nanoFramework.Runtime.Events_SRC_FILE}") # debug helper
+ list(APPEND nanoFramework.Runtime.Events_SOURCES ${nanoFramework.Runtime.Events_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(nanoFramework.Runtime.Events DEFAULT_MSG nanoFramework.Runtime.Events_INCLUDE_DIRS nanoFramework.Runtime.Events_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.System.Collections.cmake b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.System.Collections.cmake
new file mode 100644
index 00000000..afa84191
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/FindnanoFramework.System.Collections.cmake
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+
+# set include directories
+list(APPEND nanoFramework.System.Collections_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/HAL/Include")
+list(APPEND nanoFramework.System.Collections_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/nanoFramework.System.Collections")
+
+
+# the following CLR support files are required and added to the build by FindNF_CoreCLR.cmake
+# CLR_RT_HeapBlock_Queue.cpp
+# CLR_RT_HeapBlock_Stack.cpp
+
+# source files
+set(nanoFramework.System.Collections_SRCS
+
+ # source files of the assembly
+ nf_system_collections_System_Collections_Queue.cpp
+ nf_system_collections_System_Collections_Stack.cpp
+ nf_system_collections.cpp
+)
+
+foreach(SRC_FILE ${nanoFramework.System.Collections_SRCS})
+ set(nanoFramework.System.Collections_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(nanoFramework.System.Collections_SRC_FILE ${SRC_FILE}
+ PATHS
+
+ # path for source files of this module
+ ${PROJECT_SOURCE_DIR}/src/nanoFramework.System.Collections
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${nanoFramework.System.Collections_SRC_FILE}") # debug helper
+ list(APPEND nanoFramework.System.Collections_SOURCES ${nanoFramework.System.Collections_SRC_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(nanoFramework.System.Collections DEFAULT_MSG nanoFramework.System.Collections_INCLUDE_DIRS nanoFramework.System.Collections_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/Modules/JSONParser.cmake b/source/native/nf-interpreter/CMake/Modules/JSONParser.cmake
new file mode 100644
index 00000000..b9230e4e
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/JSONParser.cmake
@@ -0,0 +1,289 @@
+# source from https://github.com/sbellus/json-cmake
+
+cmake_minimum_required(VERSION 3.1)
+
+if (DEFINED JSonParserGuard)
+ return()
+endif()
+
+set(JSonParserGuard yes)
+
+macro(sbeParseJson prefix jsonString)
+ cmake_policy(PUSH)
+
+ set(json_string "${${jsonString}}")
+ string(LENGTH "${json_string}" json_jsonLen)
+ set(json_index 0)
+ set(json_AllVariables ${prefix})
+ set(json_ArrayNestingLevel 0)
+ set(json_MaxArrayNestingLevel 0)
+
+ _sbeParse(${prefix})
+
+ unset(json_index)
+ unset(json_AllVariables)
+ unset(json_jsonLen)
+ unset(json_string)
+ unset(json_value)
+ unset(json_inValue)
+ unset(json_name)
+ unset(json_inName)
+ unset(json_newPrefix)
+ unset(json_reservedWord)
+ unset(json_arrayIndex)
+ unset(json_char)
+ unset(json_end)
+ unset(json_ArrayNestingLevel)
+ foreach(json_nestingLevel RANGE ${json_MaxArrayNestingLevel})
+ unset(json_${json_nestingLevel}_arrayIndex)
+ endforeach()
+ unset(json_nestingLevel)
+ unset(json_MaxArrayNestingLevel)
+
+ cmake_policy(POP)
+endmacro()
+
+macro(sbeClearJson prefix)
+ foreach(json_var ${${prefix}})
+ unset(${json_var})
+ endforeach()
+
+ unset(${prefix})
+ unset(json_var)
+endmacro()
+
+macro(sbePrintJson prefix)
+ foreach(json_var ${${prefix}})
+ message("${json_var} = ${${json_var}}")
+ endforeach()
+endmacro()
+
+macro(_sbeParse prefix)
+
+ while(${json_index} LESS ${json_jsonLen})
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+
+ if("\"" STREQUAL "${json_char}")
+ _sbeParseNameValue(${prefix})
+ elseif("{" STREQUAL "${json_char}")
+ _sbeMoveToNextNonEmptyCharacter()
+ _sbeParseObject(${prefix})
+ elseif("[" STREQUAL "${json_char}")
+ _sbeMoveToNextNonEmptyCharacter()
+ _sbeParseArray(${prefix})
+ endif()
+
+ if(${json_index} LESS ${json_jsonLen})
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+ else()
+ break()
+ endif()
+
+ if ("}" STREQUAL "${json_char}" OR "]" STREQUAL "${json_char}")
+ break()
+ endif()
+
+ _sbeMoveToNextNonEmptyCharacter()
+ endwhile()
+endmacro()
+
+macro(_sbeParseNameValue prefix)
+ set(json_name "")
+ set(json_inName no)
+
+ while(${json_index} LESS ${json_jsonLen})
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+
+ # check if name ends
+ if("\"" STREQUAL "${json_char}" AND json_inName)
+ set(json_inName no)
+ _sbeMoveToNextNonEmptyCharacter()
+ if(NOT ${json_index} LESS ${json_jsonLen})
+ break()
+ endif()
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+ set(json_newPrefix ${prefix}.${json_name})
+ set(json_name "")
+
+ if(":" STREQUAL "${json_char}")
+ _sbeMoveToNextNonEmptyCharacter()
+ if(NOT ${json_index} LESS ${json_jsonLen})
+ break()
+ endif()
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+
+ if("\"" STREQUAL "${json_char}")
+ _sbeParseValue(${json_newPrefix})
+ break()
+ elseif("{" STREQUAL "${json_char}")
+ _sbeMoveToNextNonEmptyCharacter()
+ _sbeParseObject(${json_newPrefix})
+ break()
+ elseif("[" STREQUAL "${json_char}")
+ _sbeMoveToNextNonEmptyCharacter()
+ _sbeParseArray(${json_newPrefix})
+ break()
+ else()
+ # reserved word starts
+ _sbeParseReservedWord(${json_newPrefix})
+ break()
+ endif()
+ else()
+ # name without value
+ list(APPEND ${json_AllVariables} ${json_newPrefix})
+ set(${json_newPrefix} "")
+ break()
+ endif()
+ endif()
+
+ if(json_inName)
+ # remove escapes
+ if("\\" STREQUAL "${json_char}")
+ math(EXPR json_index "${json_index} + 1")
+ if(NOT ${json_index} LESS ${json_jsonLen})
+ break()
+ endif()
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+ endif()
+
+ set(json_name "${json_name}${json_char}")
+ endif()
+
+ # check if name starts
+ if("\"" STREQUAL "${json_char}" AND NOT json_inName)
+ set(json_inName yes)
+ endif()
+
+ _sbeMoveToNextNonEmptyCharacter()
+ endwhile()
+endmacro()
+
+macro(_sbeParseReservedWord prefix)
+ set(json_reservedWord "")
+ set(json_end no)
+ while(${json_index} LESS ${json_jsonLen} AND NOT json_end)
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+
+ if("," STREQUAL "${json_char}" OR "}" STREQUAL "${json_char}" OR "]" STREQUAL "${json_char}")
+ set(json_end yes)
+ else()
+ set(json_reservedWord "${json_reservedWord}${json_char}")
+ math(EXPR json_index "${json_index} + 1")
+ endif()
+ endwhile()
+
+ list(APPEND ${json_AllVariables} ${prefix})
+ string(STRIP "${json_reservedWord}" json_reservedWord)
+ set(${prefix} ${json_reservedWord})
+endmacro()
+
+macro(_sbeParseValue prefix)
+ cmake_policy(SET CMP0054 NEW) # turn off implicit expansions in if statement
+
+ set(json_value "")
+ set(json_inValue no)
+
+ while(${json_index} LESS ${json_jsonLen})
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+
+ # check if json_value ends, it is ended by "
+ if("\"" STREQUAL "${json_char}" AND json_inValue)
+ set(json_inValue no)
+
+ set(${prefix} ${json_value})
+ list(APPEND ${json_AllVariables} ${prefix})
+ _sbeMoveToNextNonEmptyCharacter()
+ break()
+ endif()
+
+ if(json_inValue)
+ # if " is escaped consume
+ if("\\" STREQUAL "${json_char}")
+ math(EXPR json_index "${json_index} + 1")
+ if(NOT ${json_index} LESS ${json_jsonLen})
+ break()
+ endif()
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+ if(NOT "\"" STREQUAL "${json_char}")
+ # if it is not " then copy also escape character
+ set(json_char "\\${json_char}")
+ endif()
+ endif()
+
+ _sbeAddEscapedCharacter("${json_char}")
+ endif()
+
+ # check if value starts
+ if("\"" STREQUAL "${json_char}" AND NOT json_inValue)
+ set(json_inValue yes)
+ endif()
+
+ math(EXPR json_index "${json_index} + 1")
+ endwhile()
+endmacro()
+
+macro(_sbeAddEscapedCharacter char)
+ string(CONCAT json_value "${json_value}" "${char}")
+endmacro()
+
+macro(_sbeParseObject prefix)
+ _sbeParse(${prefix})
+ _sbeMoveToNextNonEmptyCharacter()
+endmacro()
+
+macro(_sbeParseArray prefix)
+ math(EXPR json_ArrayNestingLevel "${json_ArrayNestingLevel} + 1")
+ set(json_${json_ArrayNestingLevel}_arrayIndex 0)
+
+ set(${prefix} "")
+ list(APPEND ${json_AllVariables} ${prefix})
+
+ while(${json_index} LESS ${json_jsonLen})
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+
+ if("\"" STREQUAL "${json_char}")
+ # simple value
+ list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
+ _sbeParseValue(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
+ elseif("{" STREQUAL "${json_char}")
+ # object
+ _sbeMoveToNextNonEmptyCharacter()
+ list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
+ _sbeParseObject(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
+ else()
+ list(APPEND ${prefix} ${json_${json_ArrayNestingLevel}_arrayIndex})
+ _sbeParseReservedWord(${prefix}_${json_${json_ArrayNestingLevel}_arrayIndex})
+ endif()
+
+ if(NOT ${json_index} LESS ${json_jsonLen})
+ break()
+ endif()
+
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+
+ if("]" STREQUAL "${json_char}")
+ _sbeMoveToNextNonEmptyCharacter()
+ break()
+ elseif("," STREQUAL "${json_char}")
+ math(EXPR json_${json_ArrayNestingLevel}_arrayIndex "${json_${json_ArrayNestingLevel}_arrayIndex} + 1")
+ endif()
+
+ _sbeMoveToNextNonEmptyCharacter()
+ endwhile()
+
+ if(${json_MaxArrayNestingLevel} LESS ${json_ArrayNestingLevel})
+ set(json_MaxArrayNestingLevel ${json_ArrayNestingLevel})
+ endif()
+ math(EXPR json_ArrayNestingLevel "${json_ArrayNestingLevel} - 1")
+endmacro()
+
+macro(_sbeMoveToNextNonEmptyCharacter)
+ math(EXPR json_index "${json_index} + 1")
+ if(${json_index} LESS ${json_jsonLen})
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+ while(${json_char} MATCHES "[ \t\n\r]" AND ${json_index} LESS ${json_jsonLen})
+ math(EXPR json_index "${json_index} + 1")
+ string(SUBSTRING "${json_string}" ${json_index} 1 json_char)
+ endwhile()
+ endif()
+endmacro()
diff --git a/source/native/nf-interpreter/CMake/Modules/MBED_STM32F0_GCC_options.cmake b/source/native/nf-interpreter/CMake/Modules/MBED_STM32F0_GCC_options.cmake
new file mode 100644
index 00000000..b7c46de5
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/MBED_STM32F0_GCC_options.cmake
@@ -0,0 +1,16 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+#################################################################
+# WHEN ADDING A NEW TARGET add the appropriate GCC options below
+#################################################################
+
+set(CMAKE_C_FLAGS "-mthumb -mcpu=cortex-m0 -fno-builtin -std=c11 -g -Wall -ffunction-sections -fdata-sections -fomit-frame-pointer -mlong-calls -mabi=aapcs -fno-exceptions -fno-unroll-loops -ftree-vectorize -specs=nano.specs" CACHE INTERNAL "c compiler flags")
+set(CMAKE_CXX_FLAGS "-mthumb -mcpu=cortex-m0 -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mlong-calls -mabi=aapcs -fno-exceptions -fno-unroll-loops -ftree-vectorize -specs=nano.specs" CACHE INTERNAL "cxx compiler flags")
+set(CMAKE_ASM_FLAGS "-c -mthumb -mcpu=cortex-m0 -g -Wa,--no-warn -x assembler-with-cpp " CACHE INTERNAL "asm compiler flags")
+
+set(CMAKE_EXE_LINKER_FLAGS "-mthumb -mcpu=cortex-m0 -static -mabi=aapcs -Wl,-gc-sections" CACHE INTERNAL "executable linker flags")
+set(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m0 -specs=nano.specs " CACHE INTERNAL "module linker flags")
+set(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m0 -specs=nano.specs " CACHE INTERNAL "shared linker flags")
diff --git a/source/native/nf-interpreter/CMake/Modules/MBED_STM32F0_sources.cmake b/source/native/nf-interpreter/CMake/Modules/MBED_STM32F0_sources.cmake
new file mode 100644
index 00000000..4eb322d8
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/MBED_STM32F0_sources.cmake
@@ -0,0 +1,134 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+###########################################################################
+# WHEN ADDING A NEW SERIES add the include to the vendor source code below
+###########################################################################
+include(MBED_STM_sources)
+
+#######################################################################################
+# WHEN ADDING A NEW TARGET add the source code file for the series\device folder below
+#######################################################################################
+
+# sources in series\device folder
+set(MBED_VENDOR_SERIES_DEVICE_SRCS
+ stm32f0xx_hal.c
+ stm32f0xx_hal_adc.c
+ stm32f0xx_hal_adc_ex.c
+ stm32f0xx_hal_can.c
+ stm32f0xx_hal_cec.c
+ stm32f0xx_hal_comp.c
+ stm32f0xx_hal_cortex.c
+ stm32f0xx_hal_crc.c
+ stm32f0xx_hal_crc_ex.c
+ stm32f0xx_hal_dac.c
+ stm32f0xx_hal_dac_ex.c
+ stm32f0xx_hal_dma.c
+ stm32f0xx_hal_flash.c
+ stm32f0xx_hal_flash_ex.c
+ stm32f0xx_hal_gpio.c
+ stm32f0xx_hal_i2c.c
+ stm32f0xx_hal_i2c_ex.c
+ stm32f0xx_hal_i2s.c
+ stm32f0xx_hal_irda.c
+ stm32f0xx_hal_iwdg.c
+ stm32f0xx_hal_pcd.c
+ stm32f0xx_hal_pcd_ex.c
+ stm32f0xx_hal_pwr.c
+ stm32f0xx_hal_pwr_ex.c
+ stm32f0xx_hal_rcc.c
+ stm32f0xx_hal_rcc_ex.c
+ stm32f0xx_hal_rtc.c
+ stm32f0xx_hal_rtc_ex.c
+ stm32f0xx_hal_smartcard.c
+ stm32f0xx_hal_smartcard_ex.c
+ stm32f0xx_hal_smbus.c
+ stm32f0xx_hal_spi.c
+ stm32f0xx_hal_spi_ex.c
+ stm32f0xx_hal_tim.c
+ stm32f0xx_hal_tim_ex.c
+ stm32f0xx_hal_tsc.c
+ stm32f0xx_hal_uart.c
+ stm32f0xx_hal_uart_ex.c
+ stm32f0xx_hal_usart.c
+ stm32f0xx_hal_wwdg.c
+)
+foreach(SRC_FILE ${MBED_VENDOR_SERIES_DEVICE_SRCS})
+ set(MBEDOS_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(MBEDOS_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/device
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${MBEDOS_SRC_FILE}") # debug helper
+ list(APPEND MBEDOS_SOURCES ${MBEDOS_SRC_FILE})
+endforeach()
+
+##########################################################################
+# WHEN ADDING A NEW TARGET add the source code file for the series below
+##########################################################################
+
+set(MBED_VENDOR_SERIES_AND_TARGET_SRCS
+ analogin_api.c
+ analogout_api.c
+ can_api.c
+ gpio_api.c
+ gpio_irq_api.c
+ lp_ticker.c
+ mbed_overrides.c
+ pinmap.c
+ port_api.c
+ pwmout_api.c
+ rtc_api.c
+ serial_api.c
+ sleep.c
+ spi_api.c
+
+ PeripheralPins.c
+ cmsis_nvic.c
+ system_stm32f0xx.c
+)
+foreach(SRC_FILE ${MBED_VENDOR_SERIES_AND_TARGET_SRCS})
+ set(MBEDOS_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(MBEDOS_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/TARGET_${MBED_TARGET}
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/TARGET_${MBED_TARGET}/device
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/TARGET_${MBED_TARGET}/device/TOOLCHAIN_GCC_ARM
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${MBEDOS_SRC_FILE}") # debug helper
+ list(APPEND MBEDOS_SOURCES ${MBEDOS_SRC_FILE})
+endforeach()
+
+#######################################################################################################################################
+# WHEN ADDING A NEW TARGET add the respective if clause below along with the startup file and the linker file name (without extension)
+#######################################################################################################################################
+
+# startup file
+if(${MBED_TARGET} STREQUAL "NUCLEO_F091RC")
+ list(APPEND MBEDOS_SOURCES ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/TARGET_NUCLEO_F091RC/device/TOOLCHAIN_GCC_ARM/startup_stm32f091xc.S)
+ set(LINKER_FILE "STM32F091XC")
+endif()
+
+#######################################################################################################################################
+
+
+################################################################
+# WHEN ADDING A NEW TARGET check if the linker file below works
+################################################################
+
+function(MBED_SET_LINKER_OPTIONS TARGET)
+
+ get_target_property(TARGET_LD_FLAGS ${TARGET} LINK_FLAGS)
+ if(TARGET_LD_FLAGS)
+ set(TARGET_LD_FLAGS "-T${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/TARGET_${MBED_TARGET}/device/TOOLCHAIN_GCC_ARM/${LINKER_FILE}.LD ${TARGET_LD_FLAGS}")
+ else()
+ set(TARGET_LD_FLAGS "-T${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}/TARGET_${MBED_TARGET_SERIES}/TARGET_${MBED_TARGET}/device/TOOLCHAIN_GCC_ARM/${LINKER_FILE}.LD")
+ endif()
+ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS ${TARGET_LD_FLAGS})
+
+endfunction()
diff --git a/source/native/nf-interpreter/CMake/Modules/MBED_STM_sources.cmake b/source/native/nf-interpreter/CMake/Modules/MBED_STM_sources.cmake
new file mode 100644
index 00000000..5116e037
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/MBED_STM_sources.cmake
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+############################################################################
+# WHEN ADDING A NEW VENDOR add the source code from the vendor folder below
+############################################################################
+
+# source files common for all STM targets
+set(MBED_VENDOR_SRCS
+ hal_tick_16b.c
+ hal_tick_32b.c
+ i2c_api.c
+ stm_spi_api.c
+ trng_api.c
+ us_ticker_16b.c
+ us_ticker_32b.c
+)
+foreach(SRC_FILE ${MBED_VENDOR_SRCS})
+ set(MBEDOS_SRC_FILE SRC_FILE-NOTFOUND)
+ find_file(MBEDOS_SRC_FILE ${SRC_FILE}
+ PATHS
+ ${PROJECT_BINARY_DIR}/mBedOS_Source/targets/TARGET_${MBED_TARGET_VENDOR}
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${MBEDOS_SRC_FILE}") # debug helper
+ list(APPEND MBEDOS_SOURCES ${MBEDOS_SRC_FILE})
+endforeach()
+
+# HAL_CMx file
+list(APPEND MBEDOS_SOURCES ${PROJECT_BINARY_DIR}/mBedOS_Source/rtos/rtx/TARGET_CORTEX_M/TARGET_${MBED_TARGET_CORE_SHORT}/TOOLCHAIN_GCC/HAL_C${MBED_TARGET_CORE_SHORT}.S)
+
+# SVC_Table file
+list(APPEND MBEDOS_SOURCES ${PROJECT_BINARY_DIR}/mBedOS_Source/rtos/rtx/TARGET_CORTEX_M/TARGET_${MBED_TARGET_CORE_SHORT}/TOOLCHAIN_GCC/SVC_Table.S)
diff --git a/source/native/nf-interpreter/CMake/Modules/NF_NativeAssemblies.cmake b/source/native/nf-interpreter/CMake/Modules/NF_NativeAssemblies.cmake
new file mode 100644
index 00000000..35387d73
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/NF_NativeAssemblies.cmake
@@ -0,0 +1,326 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+############################################################################################
+# WHEN ADDING A NEW API add the name that corresponds to the CMake option here
+# e.g.: for namespace Windows.Devices.Gpio, the CMake option is 'API_Windows.Devices.Gpio'
+# and the namespace designation is 'Windows.Devices.Gpio'
+###########################################################################################
+
+option(API_nanoFramework.Devices.Can "option for nanoFramework.Devices.Can")
+option(API_nanoFramework.Devices.OneWire "option for nanoFramework.Devices.OneWire")
+option(API_nanoFramework.Networking.Sntp "option for nanoFramework.Networking.Sntp")
+option(API_nanoFramework.Runtime.Events "option for nanoFramework.Runtime.Events API")
+option(API_nanoFramework.ResourceManager "option for nanoFramework.ResourceManager")
+option(API_nanoFramework.System.Collections "option for nanoFramework.System.Collections")
+option(API_System.Math "option for System.Math")
+option(API_System.Net "option for System.Net")
+option(API_Windows.Devices.Adc "option for Windows.Devices.Adc API")
+option(API_System.Devices.Dac "option for System.Devices.Dac API")
+option(API_Windows.Devices.Gpio "option for Windows.Devices.Gpio API")
+option(API_Windows.Devices.I2c "option for Windows.Devices.I2c API")
+option(API_Windows.Devices.Pwm "option for Windows.Devices.Pwm API")
+option(API_Windows.Devices.SerialCommunication "option for Windows.Devices.SerialCommunication API")
+option(API_Windows.Devices.Spi "option for Windows.Devices.Spi API")
+option(API_Windows.Networking.Sockets "option for Windows.Networking.Sockets")
+option(API_Windows.Storage "option for Windows.Storage")
+
+
+# Esp32 only
+option(API_Hardware.Esp32 "option for Hardware.Esp32")
+
+
+# Stm32 only
+option(API_Hardware.Stm32 "option for Hardware.Stm32")
+
+
+#################################################################
+# macro to perform individual settings to add an API to the build
+macro(PerformSettingsForApiEntry apiNamespace)
+
+ # namespace with '_' replacing '.'
+ string(REPLACE "." "_" apiNamespaceWithoutDots "${apiNamespace}")
+
+ # list this option
+ list(APPEND apiListing "${apiNamespace}")
+
+ # append to list of declaration for Interop Assemblies table
+ list(APPEND CLR_RT_NativeAssemblyDataList "extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_${apiNamespaceWithoutDots};")
+
+ # append to list of entries for Interop Assemblies table
+ list(APPEND CLR_RT_NativeAssemblyDataTableEntriesList "&g_CLR_AssemblyNative_${apiNamespaceWithoutDots},")
+
+ # find the module
+ find_package(${apiNamespace} REQUIRED)
+
+ # append include directories to list with includes for all the APIs
+ list(APPEND TARGET_NANO_APIS_INCLUDES "${${apiNamespace}_INCLUDE_DIRS}")
+ list(REMOVE_DUPLICATES TARGET_NANO_APIS_INCLUDES)
+
+ # append source files to list wiht source files for all the APIs
+ list(APPEND TARGET_NANO_APIS_SOURCES "${${apiNamespace}_SOURCES}")
+ list(REMOVE_DUPLICATES TARGET_NANO_APIS_SOURCES)
+
+endmacro()
+#################################################################
+
+
+############################################################################################
+# WHEN ADDING A NEW API add the corresponding block below
+# required changes:
+# 1. change the 'IF' to match the CMake option
+# 2. change the call to PerformSettingsForApiEntry() macro with the API name (doted naming)
+############################################################################################
+
+macro(ParseNativeAssemblies)
+
+ # Hardware.Esp32
+ if(API_Hardware.Esp32)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("nanoFramework.Hardware.Esp32")
+ endif()
+
+ # Hardware.Stm32
+ if(API_Hardware.Stm32)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("nanoFramework.Hardware.Stm32")
+ endif()
+
+ # nanoFramework.Devices.Can
+ if(API_nanoFramework.Devices.Can)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("nanoFramework.Devices.Can")
+ endif()
+
+ # nanoFramework.Devices.OneWire
+ if(API_nanoFramework.Devices.OneWire)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("nanoFramework.Devices.OneWire")
+ endif()
+
+ # nanoFramework.Networking.Sntp
+ if(API_nanoFramework.Networking.Sntp)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("nanoFramework.Networking.Sntp")
+ endif()
+
+ # nanoFramework.ResourceManager
+ if(API_nanoFramework.ResourceManager)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("nanoFramework.ResourceManager")
+ endif()
+
+ # nanoFramework.System.Collections
+ if(API_nanoFramework.System.Collections)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("nanoFramework.System.Collections")
+ endif()
+
+ # nanoFramework.Runtime.Events
+ if(API_nanoFramework.Runtime.Events)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("nanoFramework.Runtime.Events")
+
+ # this one is special because it requires also another assembly for events that is internal (doens't have a managed end)
+
+ # append to list of declaration for Interop Assemblies table
+ list(APPEND CLR_RT_NativeAssemblyDataList "extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Runtime_Events_EventSink_DriverProcs;")
+ # append to list of entries for Interop Assemblies table
+ list(APPEND CLR_RT_NativeAssemblyDataTableEntriesList "&g_CLR_AssemblyNative_nanoFramework_Runtime_Events_EventSink_DriverProcs,")
+
+ endif()
+
+ # System.Math
+ if(API_System.Math)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("System.Math")
+ endif()
+
+ # System.Net
+ if(API_System.Net)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("System.Net")
+ endif()
+
+ # Windows.Devices.Adc
+ if(API_Windows.Devices.Adc)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("Windows.Devices.Adc")
+ endif()
+
+ # System.Devices.Dac
+ if(API_System.Devices.Dac)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("System.Devices.Dac")
+ endif()
+
+ # Windows.Devices.Gpio
+ if(API_Windows.Devices.Gpio)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("Windows.Devices.Gpio")
+ endif()
+
+ # Windows.Devices.I2c
+ if(API_Windows.Devices.I2c)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("Windows.Devices.I2c")
+ endif()
+
+ # Windows.Devices.Pwm
+ if(API_Windows.Devices.Pwm)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("Windows.Devices.Pwm")
+ endif()
+
+ # Windows.Devices.SerialCommunication
+ if(API_Windows.Devices.SerialCommunication)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("Windows.Devices.SerialCommunication")
+ endif()
+
+ # Windows.Devices.Spi
+ if(API_Windows.Devices.Spi)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("Windows.Devices.Spi")
+ endif()
+
+ # Windows.Networking.Sockets
+ if(API_Windows.Networking.Sockets)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("Windows.Networking.Sockets")
+ endif()
+
+ # Windows.Devices.Wifi
+ if(API_Windows.Devices.Wifi)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("Windows.Devices.Wifi")
+ endif()
+
+ # Windows.Storage
+ if(API_Windows.Storage)
+ ##### API name here (doted name)
+ PerformSettingsForApiEntry("Windows.Storage")
+ endif()
+
+ # Interop assemblies
+ ParseInteropAssemblies()
+
+
+ # parse the declarations to have new lines and ';'
+ string(REPLACE ";;" ";\n" CLR_RT_NativeAssemblyDataDeclarations "${CLR_RT_NativeAssemblyDataList}")
+ # parse the list to have new lines, ',' and identation
+ string(REPLACE ";" "\n " CLR_RT_NativeAssemblyDataTableEntries "${CLR_RT_NativeAssemblyDataTableEntriesList}")
+
+
+ # configure code file with Interop Assemblies table and...
+ configure_file("${PROJECT_SOURCE_DIR}/InteropAssemblies/CLR_RT_InteropAssembliesTable.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/CLR_RT_InteropAssembliesTable.cpp" @ONLY)
+ # ... now add Interop Assemblies table to ChibiOS nanoCLR sources list
+ list(APPEND TARGET_NANO_APIS_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/CLR_RT_InteropAssembliesTable.cpp")
+
+ # make the vars global
+ set(TARGET_NANO_APIS_INCLUDES ${TARGET_NANO_APIS_INCLUDES} CACHE INTERNAL "make global")
+ set(TARGET_NANO_APIS_SOURCES ${TARGET_NANO_APIS_SOURCES} CACHE INTERNAL "make global")
+
+
+ # output the list of APIs included
+ list(LENGTH apiListing apiListingLenght)
+
+ if(apiListingLenght GREATER 0)
+
+ # APIs included
+ message(STATUS "")
+ message(STATUS " *** APIs included ***")
+ message(STATUS "")
+
+ foreach(entry ${apiListing})
+ message(STATUS " ${entry}")
+ endforeach(entry ${})
+
+ message(STATUS "")
+ message(STATUS " *** end of APIs ***")
+ message(STATUS "")
+
+ else()
+ # no APIs were included
+ message(STATUS " *** NO APIs included ***")
+ endif()
+
+endmacro()
+
+##############################################################################
+# macro to perform individual settings to add an Interop assembly to the build
+macro(PerformSettingsForInteropEntry interopAssemblyName)
+
+ # namespace with '_' replacing '.'
+ string(REPLACE "." "_" interopAssemblyNameWithoutDots "${interopAssemblyName}")
+
+ # list this option
+ list(APPEND interopAssemblyList "${interopAssemblyName}")
+
+ # append to list of declaration for Interop Assemblies table
+ list(APPEND CLR_RT_NativeAssemblyDataList "extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_${interopAssemblyNameWithoutDots};")
+
+ # append to list of entries for Interop Assemblies table
+ list(APPEND CLR_RT_NativeAssemblyDataTableEntriesList "&g_CLR_AssemblyNative_${interopAssemblyNameWithoutDots},")
+
+ # find the module
+ find_package("INTEROP-${interopAssemblyName}" REQUIRED)
+
+ #########
+ # because Interop assemblies are considered and treated as like any CLR assembly we add them to the same lists
+ #########
+
+ # append include directories to list with includes for all the APIs
+ list(APPEND TARGET_NANO_APIS_INCLUDES "${${interopAssemblyName}_INCLUDE_DIRS}")
+ list(REMOVE_DUPLICATES TARGET_NANO_APIS_INCLUDES)
+
+ # append source files to list wiht source files for all the APIs
+ list(APPEND TARGET_NANO_APIS_SOURCES "${${interopAssemblyName}_SOURCES}")
+ list(REMOVE_DUPLICATES TARGET_NANO_APIS_SOURCES)
+
+endmacro()
+
+#################################################################
+# macro that adds the requested Interop assemblies to the build
+# requiremens to add an Interop assemble:
+# 1) add it's namespace to the NF_INTEROP_ASSEMBLIES CMake options
+# 2) have the corresponding CMake module in the Modules folder (mind the correct naming)
+macro(ParseInteropAssemblies)
+
+ # check if there are any Interop assemblies to be added
+ if(NF_INTEROP_ASSEMBLIES)
+
+ # loop through each Interop assembly and add it to the build
+ foreach(assembly ${NF_INTEROP_ASSEMBLIES})
+ PerformSettingsForInteropEntry(${assembly})
+ endforeach()
+
+ endif()
+
+ # output the list of Interop assemblies included
+ list(LENGTH interopAssemblyList interopAssemblyListLenght)
+
+ if(interopAssemblyListLenght GREATER 0)
+
+ # APIs included
+ message(STATUS "")
+ message(STATUS " *** Interop assemblies included ***")
+ message(STATUS "")
+
+ foreach(entry ${interopAssemblyList})
+ message(STATUS " ${entry}")
+ endforeach(entry ${})
+
+ message(STATUS "")
+ message(STATUS " *** end of Interop assemblies ***")
+ message(STATUS "")
+
+ else()
+ # no Interop assemblies were included
+ message(STATUS " *** NO Interop assemblies included ***")
+ endif()
+
+endmacro()
diff --git a/source/native/nf-interpreter/CMake/Modules/STM32_CubePackage.cmake b/source/native/nf-interpreter/CMake/Modules/STM32_CubePackage.cmake
new file mode 100644
index 00000000..8285b9e7
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/STM32_CubePackage.cmake
@@ -0,0 +1,103 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# include the STM32 Cube package for the appropriate series, if requested
+
+# check if cube package source was specified or if it's empty (default is empty)
+macro(ProcessSTM32CubePackage)
+
+ # process target series, which is in the format "STM32F4xx"
+ string(REPLACE "STM32" "" TARGET_SERIES_SHORT_1 "${TARGET_SERIES}")
+ string(REPLACE "xx" "" TARGET_SERIES_SHORT "${TARGET_SERIES_SHORT_1}")
+
+ set(NO_STM32_CUBE_PACKAGE_SOURCE TRUE)
+ if(NO_STM32_CUBE_PACKAGE_SOURCE)
+ if(NOT "${STM32_CUBE_PACKAGE_SOURCE}" STREQUAL "")
+ set(NO_STM32_CUBE_PACKAGE_SOURCE FALSE)
+ endif()
+ endif()
+
+ if(NO_STM32_CUBE_PACKAGE_SOURCE)
+ # no STM Cube package source specified, download it from nanoFramework fork
+
+ # check for Git (needed here for advanced warning to user if it's not installed)
+ find_package(Git)
+
+ # check if Git was found, if not report to user and abort
+ if(NOT GIT_EXECUTABLE)
+ message(FATAL_ERROR "error: could not find Git, make sure you have it installed.")
+ endif()
+
+ message(STATUS "STM32 ${TARGET_SERIES_SHORT} Cube package from GitHub repo")
+
+ # need to setup a separate CMake project to download the code from the GitHub repository
+ # otherwise it won't be available before the actual build step
+ configure_file("${PROJECT_SOURCE_DIR}/CMake/STM32.CubePackage.CMakeLists.cmake.in"
+ "${CMAKE_BINARY_DIR}/STM32${TARGET_SERIES_SHORT}-CubePackage_Download/CMakeLists.txt")
+
+ # setup CMake project for STM32_CubePackage download
+ execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+ RESULT_VARIABLE result
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/STM32${TARGET_SERIES_SHORT}-CubePackage_Download")
+
+ # run build on STM32_CubePackage download CMake project to perform the download
+ execute_process(COMMAND ${CMAKE_COMMAND} --build .
+ RESULT_VARIABLE result
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/STM32${TARGET_SERIES_SHORT}-CubePackage_Download")
+
+ # add STM32_CubePackage as external project
+ # need to specify nanoframework as the active branch
+ ExternalProject_Add(
+ STM32${TARGET_SERIES_SHORT}_CubePackage
+ PREFIX STM32${TARGET_SERIES_SHORT}_CubePackage
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/STM32${TARGET_SERIES_SHORT}_CubePackage_Source
+ GIT_REPOSITORY https://github.com/nanoframework/STM32Cube${TARGET_SERIES_SHORT}
+ GIT_TAG "nf-build" # target specific branch
+ GIT_SHALLOW 1 # download only the tip of the branch, not the complete history
+ TIMEOUT 10
+ LOG_DOWNLOAD 1
+ # Disable all other steps
+ INSTALL_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ )
+
+ # get source dir for STM32_CubePackage CMake project
+ ExternalProject_Get_Property(STM32${TARGET_SERIES_SHORT}_CubePackage SOURCE_DIR)
+
+ else()
+ # STM32 Cube package source was specified
+
+ # sanity check is source path exists
+ if(EXISTS "${STM32_CUBE_PACKAGE_SOURCE}/")
+ message(STATUS "STM32 Cube package source from: ${STM32_CUBE_PACKAGE_SOURCE}")
+
+ # check if we already have the sources, no need to copy again
+ if(NOT EXISTS "${CMAKE_BINARY_DIR}/STM32${TARGET_SERIES_SHORT}_CubePackage_Source")
+ file(COPY "${STM32_CUBE_PACKAGE_SOURCE}/" DESTINATION "${CMAKE_BINARY_DIR}/STM32${TARGET_SERIES_SHORT}_CubePackage_Source")
+ else()
+ message(STATUS "Using local cache of STM32 Cube package source from ${STM32_CUBE_PACKAGE_SOURCE}")
+ endif()
+ else()
+ message(FATAL_ERROR "Couldn't find STM32 Cube package source at ${STM32_CUBE_PACKAGE_SOURCE}/")
+ endif()
+
+ # add STM32_CubePackage as external project
+ ExternalProject_Add(
+ STM32${TARGET_SERIES_SHORT}_CubePackage
+ PREFIX STM32${TARGET_SERIES_SHORT}_CubePackage
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/STM32${TARGET_SERIES_SHORT}_CubePackage_Source
+ # Disable all other steps
+ INSTALL_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ )
+
+ # get source dir for STM32_CubePackage CMake project
+ ExternalProject_Get_Property(STM32${TARGET_SERIES_SHORT}_CubePackage SOURCE_DIR)
+
+ endif()
+
+endmacro()
diff --git a/source/native/nf-interpreter/CMake/Modules/TI_SimpleLink_CC32xx_GCC_options.cmake b/source/native/nf-interpreter/CMake/Modules/TI_SimpleLink_CC32xx_GCC_options.cmake
new file mode 100644
index 00000000..72b2250a
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/TI_SimpleLink_CC32xx_GCC_options.cmake
@@ -0,0 +1,48 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+#################################################################
+# WHEN ADDING A NEW SERIES add the appropriate GCC options below
+#################################################################
+
+# need to specify this for assembler
+set(CMAKE_ASM_FLAGS " -mthumb -mcpu=cortex-m4 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
+
+# need to specify linker flags here
+# -mfpu=fpv5-sp-d16
+set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -Wl,--print-memory-usage -mcpu=cortex-m4 -march=armv7e-m -mthumb -nostartfiles -std=c99 -mfloat-abi=soft -ffunction-sections -fdata-sections -g -gstrict-dwarf -Wall " CACHE INTERNAL "executable linker flags")
+
+
+function(NF_SET_COMPILER_OPTIONS TARGET)
+
+ # include any extra options coming from any extra args?
+ target_compile_options(${TARGET} PUBLIC ${ARGN} -march=armv7e-m -mthumb -mcpu=cortex-m4 -mfloat-abi=soft -mabi=aapcs -gstrict-dwarf -nostdlib -Wall -w -static -ffunction-sections -falign-functions=16 -fdata-sections -fno-builtin -fno-common -fsingle-precision-constant -fomit-frame-pointer -mlong-calls -fdollars-in-identifiers -fno-exceptions -fno-unroll-loops -ffast-math -ftree-vectorize -fcheck-new -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics)
+
+ # this series has FPU
+ target_compile_definitions(${TARGET} PUBLIC -DCORTEX_USE_FPU=TRUE)
+
+endfunction()
+
+
+function(NF_SET_LINKER_OPTIONS TARGET)
+
+ # request specs from newlib nano
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " --specs=nano.specs ")
+
+ # set extra linker flags
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${ARGN}")
+
+ # set optimization linker flags for RELEASE and MinSizeRel
+ if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
+ set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-linker-plugin -Os")
+ endif()
+
+ # set optimization flags
+ nf_set_optimization_options(${TARGET})
+
+ # set link map
+ nf_set_link_map(${TARGET})
+
+endfunction()
diff --git a/source/native/nf-interpreter/CMake/Modules/TI_SimpleLink_CC32xx_sources.cmake b/source/native/nf-interpreter/CMake/Modules/TI_SimpleLink_CC32xx_sources.cmake
new file mode 100644
index 00000000..12c3df28
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/Modules/TI_SimpleLink_CC32xx_sources.cmake
@@ -0,0 +1,245 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+# includes for SimpleLink CC32xx SDK
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source")
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers")
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/posix/gcc")
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/boards/CC3220SF_LAUNCHXL")
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/devices/cc32xx")
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/devices/cc32xx/driverlib")
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/net")
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/bsd")
+
+# includes for nanoFramework SSL driver
+list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src/PAL/Com/sockets/ssl")
+
+
+# source files for board drivers
+set(BoardDrivers_SRCS
+
+ # board drivers
+ # NVS.c
+ # NVSRAM.c
+ # NVSSPI25X.c
+ # SD.c
+ # SDSPI.c
+ # SDFatFS.c
+ List.c
+ RingBuf.c
+ ADC.c
+ ADCCC32XX.c
+ # Camera.c
+ # CameraCC32XXDMA.c
+ Capture.c
+ CaptureCC32XX.c
+ CryptoCC32XX.c
+ UDMACC32XX.c
+ GPIOCC32XX.c
+ I2C.c
+ I2CCC32XX.c
+ I2S.c
+ PowerCC32XX.c
+ PowerCC32XX_asm.sm4g
+ PWM.c
+ PWMTimerCC32XX.c
+ SDHostCC32XX.c
+ SPI.c
+ SPICC32XXDMA.c
+ SPICC32XXDMA.c
+ Timer.c
+ TimerCC32XX.c
+ UART.c
+ UARTCC32XX.c
+ UARTCC32XXDMA.c
+ Watchdog.c
+ WatchdogCC32XX.c
+)
+
+foreach(SRC_FILE ${BoardDrivers_SRCS})
+ set(BoardDrivers_SCR_FILE SRC_FILE -NOTFOUND)
+ find_file(BoardDrivers_SCR_FILE ${SRC_FILE}
+ PATHS
+
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/nvs"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/sd"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/adc"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/camera"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/capture"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/crypto"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/dma"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/gpio"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/i2c"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/i2s"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/power"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/pwm"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/sd"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/spi"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/timer"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/uart"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/watchdog"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/utils"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${BoardDrivers_SCR_FILE}") # debug helper
+ list(APPEND TI_SimpleLink_SOURCES ${BoardDrivers_SCR_FILE})
+endforeach()
+
+# need to specify a language for this assembler source file because its not using a standard extension
+set_source_files_properties("${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/power/PowerCC32XX_asm.sm4g" PROPERTIES LANGUAGE ASM)
+
+# source files for drivers library
+set(DriversLibrary_SRCS
+
+ #drivers library
+ adc.c
+ aes.c
+ camera.c
+ cpu.c
+ crc.c
+ des.c
+ flash.c
+ gpio.c
+ hwspinlock.c
+ i2c.c
+ interrupt.c
+ i2s.c
+ pin.c
+ prcm.c
+ sdhost.c
+ shamd5.c
+ spi.c
+ systick.c
+ timer.c
+ uart.c
+ udma.c
+ utils.c
+ wdt.c
+
+ # display specific
+ DisplayUart.c
+)
+
+foreach(SRC_FILE ${DriversLibrary_SRCS})
+ set(DriversLibrary_SCR_FILE SRC_FILE -NOTFOUND)
+ find_file(DriversLibrary_SCR_FILE ${SRC_FILE}
+ PATHS
+
+ #drivers library
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/devices/cc32xx/driverlib"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/display"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${DriversLibrary_SCR_FILE}") # debug helper
+ list(APPEND TI_SimpleLink_SOURCES ${DriversLibrary_SCR_FILE})
+endforeach()
+
+# source files for SimpleLink
+set(SimpleLink_SRCS
+
+ device.c
+ driver.c
+ flowcont.c
+ fs.c
+ netapp.c
+ netcfg.c
+ netutil.c
+ nonos.c
+ sl_socket.c
+ spawn.c
+ wlan.c
+ cc_pal.c
+ eventreg.c
+ wlanconfig.c
+
+ # eventreg.c
+
+)
+
+foreach(SRC_FILE ${SimpleLink_SRCS})
+ set(SimpleLink_SCR_FILE SRC_FILE -NOTFOUND)
+ find_file(SimpleLink_SCR_FILE ${SRC_FILE}
+ PATHS
+
+ #drivers library
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/net/wifi"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/net/wifi/porting"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/net/wifi/source"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${SimpleLink_SCR_FILE}") # debug helper
+ list(APPEND TI_SimpleLink_SOURCES ${SimpleLink_SCR_FILE})
+endforeach()
+
+
+# source files for SimpleLink net Wi-Fi
+set(SLNetWiFi_SRCS
+
+ slnetsock.c
+ slnetutils.c
+ slnetif.c
+
+ # bsd
+ netdb.c
+ socket.c
+ errnoutil.c
+
+ # drivers
+ eventreg.c
+ slnetifwifi.c
+
+ # utils
+ clock_sync.c
+)
+
+foreach(SRC_FILE ${SLNetWiFi_SRCS})
+ set(SLNetWiFi_SCR_FILE SRC_FILE -NOTFOUND)
+ find_file(SLNetWiFi_SCR_FILE ${SRC_FILE}
+ PATHS
+
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/net"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/net/bsd"
+
+ # drivers
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/net/wifi"
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/drivers/net/wifi/slnetif"
+
+ # utils
+ "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/net/utils"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${SLNetWiFi_SCR_FILE}") # debug helper
+ list(APPEND TI_SimpleLink_SOURCES ${SLNetWiFi_SCR_FILE})
+endforeach()
+
+
+# source files for nanoFramework SSL driver
+set(nanoSsl_SRCS
+
+ ssl.cpp
+)
+
+foreach(SRC_FILE ${nanoSsl_SRCS})
+ set(nanoSsl_SCR_FILE SRC_FILE -NOTFOUND)
+ find_file(nanoSsl_SCR_FILE ${SRC_FILE}
+ PATHS
+
+ "${PROJECT_SOURCE_DIR}/src/PAL/COM/sockets/ssl"
+
+ CMAKE_FIND_ROOT_PATH_BOTH
+ )
+ # message("${SRC_FILE} >> ${nanoSsl_SCR_FILE}") # debug helper
+ list(APPEND TI_SimpleLink_SOURCES ${nanoSsl_SCR_FILE})
+endforeach()
+
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SimpleLinkCC32xxSDK DEFAULT_MSG TI_SimpleLink_INCLUDE_DIRS TI_SimpleLink_SOURCES)
diff --git a/source/native/nf-interpreter/CMake/RTXRTOS.CMakeLists.cmake.in b/source/native/nf-interpreter/CMake/RTXRTOS.CMakeLists.cmake.in
new file mode 100644
index 00000000..c203606d
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/RTXRTOS.CMakeLists.cmake.in
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 2.8.2)
+
+project(RTXRTOS-download NONE)
+
+include(ExternalProject)
+
+# download RTX RTOS source from official ARM GitHub repo
+ ExternalProject_Add(
+ RTXRTOS
+ PREFIX RTXRTOS
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/RTXRTOS_Source
+ GIT_REPOSITORY https://github.com/ARM-software/CMSIS_5
+ GIT_TAG master # target master branch
+ GIT_SHALLOW 1 # download only the tip of the branch, not the complete history
+ TIMEOUT 10
+ LOG_DOWNLOAD 1
+
+ # Disable all other steps
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ )
diff --git a/source/native/nf-interpreter/CMake/SPIFFS.CMakeLists.cmake.in b/source/native/nf-interpreter/CMake/SPIFFS.CMakeLists.cmake.in
new file mode 100644
index 00000000..d7f3e5ad
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/SPIFFS.CMakeLists.cmake.in
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+project(SPIFFS-download NONE)
+
+include(ExternalProject)
+
+# download SPIFFS source from nanoFramework GitHub fork
+ExternalProject_Add(
+ SPIFFS
+ PREFIX SPIFFS
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/SPIFFS_Source
+ GIT_REPOSITORY https://github.com/nanoframework/spiffs
+ GIT_TAG "nf-build" # target nanoFramework modified branch
+ GIT_SHALLOW 1 # download only the tip of the branch, not the complete history
+ TIMEOUT 10
+ LOG_DOWNLOAD 1
+ # Disable all other steps
+ INSTALL_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+)
diff --git a/source/native/nf-interpreter/CMake/STM32.CubePackage.CMakeLists.cmake.in b/source/native/nf-interpreter/CMake/STM32.CubePackage.CMakeLists.cmake.in
new file mode 100644
index 00000000..3c99cca9
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/STM32.CubePackage.CMakeLists.cmake.in
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+project(STM32-CubePackage-download NONE)
+
+include(ExternalProject)
+
+# download STM32 Cube Package source from nanoFramework GitHub fork
+ExternalProject_Add(
+ STM32${TARGET_SERIES_SHORT}_CubePackage
+ PREFIX STM32${TARGET_SERIES_SHORT}_CubePackage
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/STM32${TARGET_SERIES_SHORT}_CubePackage_Source
+ GIT_REPOSITORY https://github.com/nanoframework/STM32Cube${TARGET_SERIES_SHORT}
+ GIT_TAG "nf-build" # target specific branch
+ GIT_SHALLOW 1 # download only the tip of the branch, not the complete history
+ TIMEOUT 10
+ LOG_DOWNLOAD 1
+ # Disable all other steps
+ INSTALL_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+)
diff --git a/source/native/nf-interpreter/CMake/SimpleLinkCC32xxSdk.CMakeLists.cmake.in b/source/native/nf-interpreter/CMake/SimpleLinkCC32xxSdk.CMakeLists.cmake.in
new file mode 100644
index 00000000..8892b9db
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/SimpleLinkCC32xxSdk.CMakeLists.cmake.in
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+project(SimpleLinkCC32xxSDK-download NONE)
+
+include(ExternalProject)
+
+# download SimpleLinkCC32xx SDK from nanoFramework repo
+ExternalProject_Add(
+ SimpleLinkCC32xxSDK
+ PREFIX SimpleLinkCC32xxSdk
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/SimpleLinkCC32xxSdk_Source
+ GIT_REPOSITORY https://github.com/nanoframework/SimpleLink_CC32xx_SDK
+ GIT_TAG ${TI_SL_CC32xx_SDK_TAG} # target specified branch
+ GIT_SHALLOW 1 # download only the tip of the branch, not the complete history
+ TIMEOUT 10
+ LOG_DOWNLOAD 1
+
+ # Disable all other steps
+ INSTALL_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+)
diff --git a/source/native/nf-interpreter/CMake/TI_SimpleLink_target_os.h.in b/source/native/nf-interpreter/CMake/TI_SimpleLink_target_os.h.in
new file mode 100644
index 00000000..73ec8d87
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/TI_SimpleLink_target_os.h.in
@@ -0,0 +1,30 @@
+//
+// Copyright (c) 2019 The nanoFramework project contributors
+// See LICENSE file in the project root for full license information.
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// This file was automatically generated by a tool. //
+// Any changes you make here will be overwritten when it's generated again. //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef _TARGET_OS_H_
+#define _TARGET_OS_H_
+
+#define VERSION_MAJOR @nanoFramework_VERSION_MAJOR@U
+#define VERSION_MINOR @nanoFramework_VERSION_MINOR@U
+#define VERSION_BUILD @nanoFramework_VERSION_PATCH@U
+#define VERSION_REVISION @nanoFramework_VERSION_TWEAK@U
+
+#define NANOCLR_LIGHT_MATH @TARGET_LIGHT_MATH@
+#define DP_FLOATINGPOINT @TARGET_DP_FLOATINGPOINT@
+
+#define SUPPORT_ANY_BASE_CONVERSION @TARGET_SUPPORT_ANY_BASE_CONVERSION@
+
+#define HAS_CONFIG_BLOCK @TARGET_HAS_CONFIG_BLOCK@
+
+#define NANOCLR_REFLECTION @TARGET_NANOCLR_REFLECTION@
+
+#define NANOCLR_SYSTEM_COLLECTIONS @TARGET_SYSTEM_COLLECTIONS@
+
+#endif /* _TARGET_OS_H_ */
diff --git a/source/native/nf-interpreter/CMake/mBedOS.CMakeLists.cmake.in b/source/native/nf-interpreter/CMake/mBedOS.CMakeLists.cmake.in
new file mode 100644
index 00000000..2ce4be90
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/mBedOS.CMakeLists.cmake.in
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 2.8.2)
+
+project(mBedOS-download NONE)
+
+include(ExternalProject)
+
+# download mBed RTOS source from official mBed GitHub repo
+ ExternalProject_Add(
+ mBedOS
+ PREFIX mBedOS
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/mBedOS_Source
+ GIT_REPOSITORY https://github.com/ARMmbed/mbed-os/
+ GIT_TAG master # target master branch
+ GIT_SHALLOW 1 # download only the tip of the branch, not the complete history
+ TIMEOUT 10
+ LOG_DOWNLOAD 1
+
+ # Disable all other steps
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ )
diff --git a/source/native/nf-interpreter/CMake/mbedTLS.CMakeLists.cmake.in b/source/native/nf-interpreter/CMake/mbedTLS.CMakeLists.cmake.in
new file mode 100644
index 00000000..1be3e498
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/mbedTLS.CMakeLists.cmake.in
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2018 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+project(mbedTLS-download NONE)
+
+include(ExternalProject)
+
+# download mbedTLS source from official GitHub repo
+ExternalProject_Add(
+ mbedTLS
+ PREFIX mbedTLS
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/mbedTLS_Source
+ GIT_REPOSITORY https://github.com/nanoframework/mbedtls
+ GIT_TAG ${MBEDTLS_GIT_TAG} # target specified branch
+ GIT_SHALLOW 1 # download only the tip of the branch, not the complete history
+ TIMEOUT 10
+ LOG_DOWNLOAD 1
+ # Disable all other steps
+ INSTALL_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+)
diff --git a/source/native/nf-interpreter/CMake/toolchain.ChibiOS.GCC.cmake b/source/native/nf-interpreter/CMake/toolchain.ChibiOS.GCC.cmake
new file mode 100644
index 00000000..bee8b68e
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/toolchain.ChibiOS.GCC.cmake
@@ -0,0 +1,180 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+INCLUDE(CMakeForceCompiler)
+# if( DEFINED CMAKE_CROSSCOMPILING )
+# # subsequent toolchain loading is not really needed
+# return()
+# endif()
+
+
+###################################################
+# set C and C++ flags for compiler detection tests
+###################################################
+# IMPORTANT: these flags need to be removed after
+# the compiler detection otherwise they'll get
+# added to all compiler build calls and
+# will colide with the use of nano.specs
+###################################################
+set(CMAKE_C_FLAGS_INIT "-specs=nosys.specs")
+set(CMAKE_CXX_FLAGS_INIT "-specs=nosys.specs")
+###################################################
+
+
+# set toolchain directories
+set(TOOLCHAIN_BIN_DIR ${TOOLCHAIN_PREFIX}/bin)
+set(TOOLCHAIN_INC_DIR ${TOOLCHAIN_PREFIX}/arm-none-eabi/include)
+set(TOOLCHAIN_LIB_DIR ${TOOLCHAIN_PREFIX}/arm-none-eabi/lib)
+
+# the name of the operating system for which CMake is to build
+set(CMAKE_SYSTEM_NAME Generic)
+
+# name of the CPU CMake is building for
+set(CMAKE_SYSTEM_PROCESSOR arm)
+
+# macro to setup compilers
+macro(SET_COMPILER_VAR var name)
+ find_program(CMAKE_${var} arm-none-eabi-${name} HINTS ${TOOLCHAIN_BIN_DIR} DOC "${name} tool")
+endmacro()
+
+# setup C compiler
+if(NOT CMAKE_C_COMPILER)
+ SET_COMPILER_VAR(C_COMPILER gcc)
+endif()
+
+# setup C++ compiler
+if(NOT CMAKE_CXX_COMPILER)
+ SET_COMPILER_VAR(CXX_COMPILER g++)
+endif()
+
+# setup Assembler compiler
+SET_COMPILER_VAR(ASM-ATT_COMPILER as)
+
+# other toolchain configurations
+set(CMAKE_OBJCOPY ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-objcopy CACHE INTERNAL "objcopy tool")
+set(CMAKE_OBJDUMP ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-objdump CACHE INTERNAL "objdump tool")
+set(CMAKE_SIZE ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-size CACHE INTERNAL "size tool")
+set(CMAKE_DEBUGER ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-gdb CACHE INTERNAL "debuger")
+
+# root paths to search on the filesystem for cross-compiling
+set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_PREFIX}/arm-none-eabi ${EXTRA_FIND_PATH})
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# set required C and C++ standard for ALL targets
+set(CMAKE_C_STANDARD 11 CACHE INTERNAL "C standard for all targets")
+set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "C++ standard for all targets")
+
+# set all C and C++ extensions to be OFF on ALL targets
+# this forces the use of -std=c11 and -std=c++11 instead of -std=gnu11 and -std=gnu++11
+set(CMAKE_C_EXTENSIONS OFF CACHE INTERNAL "C compiler extensions OFF")
+set(CMAKE_CXX_EXTENSIONS OFF CACHE INTERNAL "C++ compiler extensions OFF")
+
+
+function(NF_ADD_HEX_BIN_DUMP_TARGETS TARGET)
+ if(EXECUTABLE_OUTPUT_PATH)
+ set(FILENAME "${EXECUTABLE_OUTPUT_PATH}/${TARGET}")
+ else()
+ set(FILENAME "${TARGET}")
+ endif()
+
+ #get_filename_component(FNSHORT ${FILENAME} NAME_WE)
+ string(REGEX REPLACE "\\.[^.]*$" "" FNSHORT ${FILENAME})
+
+ # add targets for HEX, BIN and S19 formats with no output so they will always be built
+ add_custom_target(${TARGET}.hex DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Oihex ${FILENAME} ${FNSHORT}.hex)
+ add_custom_target(${TARGET}.s19 DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Osrec ${FILENAME} ${FNSHORT}.s19)
+ add_custom_target(${TARGET}.bin DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Obinary ${FILENAME} ${FNSHORT}.bin)
+ add_custom_target(${TARGET}.dump DEPENDS ${TARGET} COMMAND ${CMAKE_OBJDUMP} -d -EL -S ${FILENAME} ${FNSHORT}.dump)
+endfunction()
+
+
+function(NF_PRINT_SIZE_OF_TARGETS TARGET)
+ if(EXECUTABLE_OUTPUT_PATH)
+ set(FILENAME "${EXECUTABLE_OUTPUT_PATH}/${TARGET}")
+ else()
+ set(FILENAME "${TARGET}")
+ endif()
+ add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_SIZE} -A -x ${FILENAME})
+endfunction()
+
+
+function(NF_SET_OPTIMIZATION_OPTIONS TARGET)
+
+ target_compile_options(${TARGET} PRIVATE
+ $<$:-Og -femit-class-debug-always -g3 -ggdb>
+ $<$:-O3 -flto -fuse-linker-plugin -fno-fat-lto-objects>
+ $<$:-Os -flto -fuse-linker-plugin -fno-fat-lto-objects>
+ $<$:-Os -femit-class-debug-always -g3 -ggdb>
+ )
+
+endfunction()
+
+
+function(NF_SET_LINK_MAP TARGET)
+
+ # need to remove the .elf suffix from target name
+ string(FIND ${TARGET} "." TARGET_EXTENSION_DOT_INDEX)
+ string(SUBSTRING ${TARGET} 0 ${TARGET_EXTENSION_DOT_INDEX} TARGET_SHORT)
+
+ # add linker flags to generate map file
+ set_property(TARGET ${TARGET_SHORT}.elf APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-Map=${PROJECT_BINARY_DIR}/${TARGET_SHORT}.map,--library-path=${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/common")
+
+endfunction()
+
+
+function(NF_SET_COMPILER_DEFINITIONS TARGET)
+
+ # definition for platform
+ # (always ARM here)
+ # ChibiOS HAL community always include (nanoFramework overlay and official community contributions optionally)
+ target_compile_definitions(${TARGET} PUBLIC "-DPLATFORM_ARM -DHAL_USE_COMMUNITY")
+
+ # build types that have debugging capabilities AND are NOT RTM have to have the define 'NANOCLR_ENABLE_SOURCELEVELDEBUGGING'
+ if((NOT NF_BUILD_RTM) OR NF_FEATURE_DEBUGGER)
+ target_compile_definitions(${TARGET} PUBLIC "-DNANOCLR_ENABLE_SOURCELEVELDEBUGGING ")
+ endif()
+
+ # set compiler definition for RTM build option
+ if(NF_BUILD_RTM)
+ target_compile_definitions(${TARGET} PUBLIC -DBUILD_RTM)
+ endif()
+
+ # set compiler definition for using Application Domains feature
+ if(NF_FEATURE_USE_APPDOMAINS)
+ target_compile_definitions(${TARGET} PUBLIC -DNANOCLR_USE_APPDOMAINS)
+ endif()
+
+ # set compiler definition for implementing (or not) CRC32 in Wire Protocol
+ if(NF_WP_IMPLEMENTS_CRC32)
+ target_compile_definitions(${TARGET} PUBLIC -DWP_IMPLEMENTS_CRC32)
+ endif()
+
+ # set definition for Wire Protocol trace mask
+ target_compile_definitions(${TARGET} PUBLIC -DTRACE_MASK=${WP_TRACE_MASK})
+
+ # set compiler definition regarding inclusion of trace messages and checks on CLR
+ if(NF_PLATFORM_NO_CLR_TRACE)
+ target_compile_definitions(${TARGET} PUBLIC -DPLATFORM_NO_CLR_TRACE=1)
+ endif()
+
+ # set compiler definition regarding CLR IL inlining
+ if(NF_CLR_NO_IL_INLINE)
+ target_compile_definitions(${TARGET} PUBLIC -DNANOCLR_NO_IL_INLINE=1)
+ endif()
+
+ # include any extra compiler definitions coming from extra args
+ target_compile_definitions(${TARGET} PUBLIC ${ARGN})
+
+endfunction()
+
+
+function(NF_SET_LINKER_FILE TARGET LINKER_FILE_NAME)
+
+ # set linker file name
+ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "-T${LINKER_FILE_NAME}")
+
+endfunction()
diff --git a/source/native/nf-interpreter/CMake/toolchain.FreeRtos.ESP32.GCC.cmake b/source/native/nf-interpreter/CMake/toolchain.FreeRtos.ESP32.GCC.cmake
new file mode 100644
index 00000000..67970bca
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/toolchain.FreeRtos.ESP32.GCC.cmake
@@ -0,0 +1,95 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+INCLUDE(CMakeForceCompiler)
+# if( DEFINED CMAKE_CROSSCOMPILING )
+# # subsequent toolchain loading is not really needed
+# return()
+# endif()
+
+# check for toolchain path
+# if(NOT TOOLCHAIN_PREFIX)
+# message( "tcp ${TOOLCHAIN_PREFIX}" )
+# message(STATUS "\n-- ########################################\nNo TOOLCHAIN_PREFIX specified, need one!\nCall CMake with -DTOOLCHAIN_PREFIX=\"\"\n specifing the path to your GCC toolchain")
+# message(STATUS "\nNOTE: mind the forward slash in the path, without trailing slash.)")
+# message(STATUS "########################################\n\n")
+# message(FATAL_ERROR "No TOOLCHAIN_PREFIX specified")
+# endif()
+
+# Stop cmake trying to check if compiler works
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY )
+
+# set toolchain directories
+set(TOOLCHAIN_BIN_DIR ${TOOLCHAIN_PREFIX}/xtensa-esp32-elf/bin)
+set(TOOLCHAIN_INC_DIR ${ESP32_IDF_PATH}/components/newlib/include)
+set(TOOLCHAIN_LIB_DIR ${TOOLCHAIN_PREFIX}/xtensa-esp32-elf/xtensa-esp32-elf/lib)
+
+# the name of the operating system for which CMake is to build
+set(CMAKE_SYSTEM_NAME Generic)
+
+# name of the CPU CMake is building for
+set(CMAKE_SYSTEM_PROCESSOR xtensa-esp32)
+
+# macro to setup compilers
+macro(SET_COMPILER_VAR var name)
+ find_program(CMAKE_${var} xtensa-esp32-elf-${name} HINTS ${TOOLCHAIN_BIN_DIR} DOC "${name} tool")
+endmacro()
+
+# setup C compiler
+if(NOT CMAKE_C_COMPILER)
+ SET_COMPILER_VAR(C_COMPILER gcc)
+endif()
+SET_COMPILER_VAR(C_COMPILER gcc)
+
+# setup C++ compiler
+if(NOT CMAKE_CXX_COMPILER)
+ SET_COMPILER_VAR(CXX_COMPILER g++)
+endif()
+
+# setup Assembler compiler
+SET_COMPILER_VAR(ASM-ATT_COMPILER as)
+
+# other toolchain configurations
+set(CMAKE_OBJCOPY ${TOOLCHAIN_BIN_DIR}/xtensa-esp32-elf-objcopy CACHE INTERNAL "objcopy tool")
+set(CMAKE_OBJDUMP ${TOOLCHAIN_BIN_DIR}/xtensa-esp32-elf-objdump CACHE INTERNAL "objdump tool")
+set(CMAKE_SIZE ${TOOLCHAIN_BIN_DIR}/xtensa-esp32-elf-size CACHE INTERNAL "size tool")
+set(CMAKE_DEBUGER ${TOOLCHAIN_BIN_DIR}/xtensa-esp32-elf-gdb CACHE INTERNAL "debuger")
+
+set(GCC_ESP32_LINKER_FLAGS, " -nostdlib -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--start-group -Wl,--print-memory-usage " CACHE INTERNAL "Gcc esp32 liker flags" )
+set(GCC_ESP32_LINKER_LIBS, " ${ESP32_IDF_PATH}/components/newlib/lib/libc.a ${ESP32_IDF_PATH}/components/newlib/lib/libm.a ${ESP32_IDF_PATH}/components/esp32/libhal.a -L${ESP32_IDF_PATH}/components/esp32/lib -lcore -lrtc -lnet80211 -lmesh -lpp -lwpa -lsmartconfig -lcoexist -lwps -lwpa2 -lphy -lgcc -lstdc++ " CACHE INTERNAL "Gcc esp32 liker libs")
+set(GCC_ESP32_LINKER_LD, " -L ${ESP32_IDF_PATH}/components/esp32/ld -T esp32_out.ld -u ld_include_panic_highint_hdl -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld " CACHE INTERNAL "Gcc esp32 liker LD")
+
+# set debug flags
+#set(CMAKE_C_FLAGS "-DTEST_WITH_C_FLAGS " CACHE INTERNAL "c compiler flags ")
+
+
+set(CMAKE_CXX_FLAGS "" CACHE INTERNAL "")
+
+set(CMAKE_C_FLAGS_DEBUG "-std=gnu99 -Og -ggdb -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -DWITH_POSIX -DHAVE_CONFIG_H -DESP_PLATFORM -D IDF_VER=\"v3.3\" -MMD -MP " CACHE INTERNAL "c compiler flags debug")
+set(CMAKE_CXX_FLAGS_DEBUG " -Og -ggdb -std=gnu++11 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -DESP_PLATFORM " CACHE INTERNAL "cxx compiler flags debug")
+
+set(CMAKE_ASM_FLAGS_DEBUG " -g3 -ggdb" CACHE INTERNAL "asm compiler flags debug")
+
+#set(CMAKE_EXE_LINKER_FLAGS_DEBUG " ${GCC_ESP32_LINKER_FLAGS} ${GCC_ESP32_LINKER_LIBS} ${GCC_ESP32_LINKER_LD} " CACHE INTERNAL "linker flags debug")
+set(CMAKE_EXE_LINKER_FLAGS_DEBUG " -nostdlib -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static " CACHE INTERNAL "linker flags debug")
+
+# set release flags
+set(CMAKE_C_FLAGS_RELEASE " -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -MMD -MP -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -D IDF_VER=\"v3.3\" " CACHE INTERNAL "c compiler flags release")
+set(CMAKE_C_FLAGS_MINSIZEREL " -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -MMD -MP -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -D IDF_VER=\"v3.3\" " CACHE INTERNAL "c compiler flags minsizerel")
+set(CMAKE_CXX_FLAGS_RELEASE " -Os -std=gnu++11 -g3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -DESP_PLATFORM " CACHE INTERNAL "cxx compiler flags release")
+set(CMAKE_CXX_FLAGS_MINSIZEREL " -Os -std=gnu++11 -g3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -DESP_PLATFORM " CACHE INTERNAL "cxx compiler flags minsizerel")
+
+set(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm compiler flags release")
+set(CMAKE_EXE_LINKER_FLAGS_RELEASE " -nostdlib -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static " CACHE INTERNAL "linker flags release")
+set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL " -nostdlib -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static " CACHE INTERNAL "linker flags minsizerel")
+
+set( CMAKE_C_LINK_EXECUTABLE " -o ")
+set( CMAKE_CXX_LINK_EXECUTABLE " -o ")
+
+# root paths to search on the filesystem for cross-compiling
+set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_PREFIX}/xtensa-esp32-elf ${EXTRA_FIND_PATH})
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/source/native/nf-interpreter/CMake/toolchain.TI_SimpleLink.GCC.cmake b/source/native/nf-interpreter/CMake/toolchain.TI_SimpleLink.GCC.cmake
new file mode 100644
index 00000000..37b908a6
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/toolchain.TI_SimpleLink.GCC.cmake
@@ -0,0 +1,174 @@
+#
+# Copyright (c) 2019 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+INCLUDE(CMakeForceCompiler)
+
+###################################################
+# set C and C++ flags for compiler detection tests
+###################################################
+# IMPORTANT: these flags need to be removed after
+# the compiler detection otherwise they'll get
+# added to all compiler build calls and
+# will colide with the use of nano.specs
+###################################################
+set(CMAKE_C_FLAGS_INIT "-specs=nosys.specs")
+set(CMAKE_CXX_FLAGS_INIT "-specs=nosys.specs")
+###################################################
+
+
+# set toolchain directories
+set(TOOLCHAIN_BIN_DIR ${TOOLCHAIN_PREFIX}/bin)
+set(TOOLCHAIN_INC_DIR ${TOOLCHAIN_PREFIX}/arm-none-eabi/include)
+set(TOOLCHAIN_LIB_DIR ${TOOLCHAIN_PREFIX}/arm-none-eabi/lib)
+
+# the name of the operating system for which CMake is to build
+set(CMAKE_SYSTEM_NAME Generic)
+
+# name of the CPU CMake is building for
+set(CMAKE_SYSTEM_PROCESSOR arm)
+
+# macro to setup compilers
+macro(SET_COMPILER_VAR var name)
+ find_program(CMAKE_${var} arm-none-eabi-${name} HINTS ${TOOLCHAIN_BIN_DIR} DOC "${name} tool")
+endmacro()
+
+# setup C compiler
+if(NOT CMAKE_C_COMPILER)
+ SET_COMPILER_VAR(C_COMPILER gcc)
+endif()
+
+# setup C++ compiler
+if(NOT CMAKE_CXX_COMPILER)
+ SET_COMPILER_VAR(CXX_COMPILER g++)
+endif()
+
+# setup Assembler compiler
+SET_COMPILER_VAR(ASM-ATT_COMPILER as)
+
+# other toolchain configurations
+set(CMAKE_OBJCOPY ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-objcopy CACHE INTERNAL "objcopy tool")
+set(CMAKE_OBJDUMP ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-objdump CACHE INTERNAL "objdump tool")
+set(CMAKE_SIZE ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-size CACHE INTERNAL "size tool")
+set(CMAKE_DEBUGER ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-gdb CACHE INTERNAL "debuger")
+
+# root paths to search on the filesystem for cross-compiling
+set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_PREFIX}/arm-none-eabi ${EXTRA_FIND_PATH})
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# set required C and C++ standard for ALL targets
+set(CMAKE_C_STANDARD 11 CACHE INTERNAL "C standard for all targets")
+set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "C++ standard for all targets")
+
+# set all C and C++ extensions to be OFF on ALL targets
+# this forces the use of -std=c11 and -std=c++11 instead of -std=gnu11 and -std=gnu++11
+set(CMAKE_C_EXTENSIONS OFF CACHE INTERNAL "C compiler extensions OFF")
+set(CMAKE_CXX_EXTENSIONS OFF CACHE INTERNAL "C++ compiler extensions OFF")
+
+
+function(NF_ADD_HEX_BIN_DUMP_TARGETS TARGET)
+ if(EXECUTABLE_OUTPUT_PATH)
+ set(FILENAME "${EXECUTABLE_OUTPUT_PATH}/${TARGET}")
+ else()
+ set(FILENAME "${TARGET}")
+ endif()
+
+ # add targets for HEX, BIN and S19 formats with no output so they will always be built
+ add_custom_target(${TARGET}.hex DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Oihex ${FILENAME} ${FILENAME}.hex)
+ add_custom_target(${TARGET}.s19 DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Osrec ${FILENAME} ${FILENAME}.s19)
+ add_custom_target(${TARGET}.bin DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Obinary ${FILENAME} ${FILENAME}.bin)
+ add_custom_target(${TARGET}.dump DEPENDS ${TARGET} COMMAND ${CMAKE_OBJDUMP} -d -EL -S ${FILENAME} ${FILENAME}.dump)
+endfunction()
+
+
+function(NF_PRINT_SIZE_OF_TARGETS TARGET)
+ if(EXECUTABLE_OUTPUT_PATH)
+ set(FILENAME "${EXECUTABLE_OUTPUT_PATH}/${TARGET}")
+ else()
+ set(FILENAME "${TARGET}")
+ endif()
+ add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_SIZE} -A -x ${FILENAME})
+endfunction()
+
+
+function(NF_SET_OPTIMIZATION_OPTIONS TARGET)
+
+ target_compile_options(${TARGET} PRIVATE
+ $<$:-Og -femit-class-debug-always -g3 -ggdb>
+ $<$:-O3 -flto -fuse-linker-plugin -fno-fat-lto-objects>
+ $<$:-Os -flto -fuse-linker-plugin -fno-fat-lto-objects>
+ $<$:-Os -femit-class-debug-always -g3 -ggdb>
+ )
+
+endfunction()
+
+
+function(NF_SET_LINK_MAP TARGET)
+
+ # need to remove the .elf suffix from target name
+ string(FIND ${TARGET} "." TARGET_EXTENSION_DOT_INDEX)
+ string(SUBSTRING ${TARGET} 0 ${TARGET_EXTENSION_DOT_INDEX} TARGET_SHORT)
+
+ # add linker flags to generate map file
+ set_property(TARGET ${TARGET_SHORT}.elf APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-Map=${PROJECT_SOURCE_DIR}/build/${TARGET_SHORT}.map,--library-path=${PROJECT_SOURCE_DIR}/targets/TI-SimpleLink/common")
+
+endfunction()
+
+
+function(NF_SET_COMPILER_DEFINITIONS TARGET)
+
+ # definition for platform
+ # (always ARM here)
+ target_compile_definitions(${TARGET} PUBLIC "-DPLATFORM_ARM ")
+
+ # definitions required for SimpleLink CC32xx SDK
+ target_compile_definitions(${TARGET} PUBLIC -Dgcc -DPTLS_TLS_INDEX=0 -DCC32XX -DBOARD_DISPLAY_USE_UART_ANSI=0 -DBOARD_DISPLAY_USE_LCD=0 -DconfigNUM_THREAD_LOCAL_STORAGE_POINTERS=1 -DSL_PLATFORM_MULTI_THREADED)
+
+ # build types that have debugging capabilities AND are NOT RTM have to have the define 'NANOCLR_ENABLE_SOURCELEVELDEBUGGING'
+ if((NOT NF_BUILD_RTM) OR NF_FEATURE_DEBUGGER)
+ target_compile_definitions(${TARGET} PUBLIC "-DNANOCLR_ENABLE_SOURCELEVELDEBUGGING ")
+ endif()
+
+ # set compiler definition for RTM build option
+ if(NF_BUILD_RTM)
+ target_compile_definitions(${TARGET} PUBLIC -DBUILD_RTM)
+ endif()
+
+ # set compiler definition for using Application Domains feature
+ if(NF_FEATURE_USE_APPDOMAINS)
+ target_compile_definitions(${TARGET} PUBLIC -DNANOCLR_USE_APPDOMAINS)
+ endif()
+
+ # set compiler definition for implementing (or not) CRC32 in Wire Protocol
+ if(NF_WP_IMPLEMENTS_CRC32)
+ target_compile_definitions(${TARGET} PUBLIC -DWP_IMPLEMENTS_CRC32)
+ endif()
+
+ # set definition for Wire Protocol trace mask
+ target_compile_definitions(${TARGET} PUBLIC -DTRACE_MASK=${WP_TRACE_MASK})
+
+ # set compiler definition regarding inclusion of trace messages and checks on CLR
+ if(NF_PLATFORM_NO_CLR_TRACE)
+ target_compile_definitions(${TARGET} PUBLIC -DPLATFORM_NO_CLR_TRACE=1)
+ endif()
+
+ # set compiler definition regarding CLR IL inlining
+ if(NF_CLR_NO_IL_INLINE)
+ target_compile_definitions(${TARGET} PUBLIC -DNANOCLR_NO_IL_INLINE=1)
+ endif()
+
+ # include any extra compiler definitions coming from extra args
+ target_compile_definitions(${TARGET} PUBLIC ${ARGN})
+
+endfunction()
+
+
+function(NF_SET_LINKER_FILE TARGET LINKER_FILE_NAME)
+
+ # set linker file name
+ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "-T${LINKER_FILE_NAME}")
+
+endfunction()
diff --git a/source/native/nf-interpreter/CMake/toolchain.mBed.GCC.cmake b/source/native/nf-interpreter/CMake/toolchain.mBed.GCC.cmake
new file mode 100644
index 00000000..b2917483
--- /dev/null
+++ b/source/native/nf-interpreter/CMake/toolchain.mBed.GCC.cmake
@@ -0,0 +1,101 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+INCLUDE(CMakeForceCompiler)
+# if( DEFINED CMAKE_CROSSCOMPILING )
+# # subsequent toolchain loading is not really needed
+# return()
+# endif()
+
+# check for toolchain path
+if(NOT TOOLCHAIN_PREFIX)
+ message(STATUS "\n-- ########################################\nNo TOOLCHAIN_PREFIX specified, need one!\nCall CMake with -DTOOLCHAIN_PREFIX=\"\"\n specifing the path to your GCC toolchain (ex: E:/GNU_Tools_ARM_Embedded/5_4_2016q3)")
+ message(STATUS "\nNOTE: mind the forward slash in the path, without trailing slash.)")
+ message(STATUS "########################################\n\n")
+ message(FATAL_ERROR "No TOOLCHAIN_PREFIX specified")
+endif()
+
+# set toolchain directories
+set(TOOLCHAIN_BIN_DIR ${TOOLCHAIN_PREFIX}/bin)
+set(TOOLCHAIN_INC_DIR ${TOOLCHAIN_PREFIX}/arm-none-eabi/include)
+set(TOOLCHAIN_LIB_DIR ${TOOLCHAIN_PREFIX}/arm-none-eabi/lib)
+
+# the name of the operating system for which CMake is to build
+set(CMAKE_SYSTEM_NAME Generic)
+
+# name of the CPU CMake is building for
+set(CMAKE_SYSTEM_PROCESSOR arm)
+
+# macro to setup compilers
+macro(SET_COMPILER_VAR var name)
+ find_program(CMAKE_${var} arm-none-eabi-${name} HINTS ${TOOLCHAIN_BIN_DIR} DOC "${name} tool")
+endmacro()
+
+# setup C compiler
+if(NOT CMAKE_C_COMPILER)
+ SET_COMPILER_VAR(C_COMPILER gcc)
+ if(CMAKE_C_COMPILER)
+ CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
+ endif()
+endif()
+SET_COMPILER_VAR(C_COMPILER gcc)
+
+# setup C++ compiler
+if(NOT CMAKE_CXX_COMPILER)
+ SET_COMPILER_VAR(CXX_COMPILER g++)
+ if(CMAKE_CXX_COMPILER)
+ CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU)
+ endif()
+endif()
+
+# setup Assembler compiler
+SET_COMPILER_VAR(ASM-ATT_COMPILER as)
+
+# other toolchain configurations
+set(CMAKE_OBJCOPY ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-objcopy CACHE INTERNAL "objcopy tool")
+set(CMAKE_OBJDUMP ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-objdump CACHE INTERNAL "objdump tool")
+set(CMAKE_SIZE ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-size CACHE INTERNAL "size tool")
+set(CMAKE_DEBUGER ${TOOLCHAIN_BIN_DIR}/arm-none-eabi-gdb CACHE INTERNAL "debuger")
+
+# set debug flags
+set(CMAKE_C_FLAGS_DEBUG "-Og -femit-class-debug-always -g3 -ggdb" CACHE INTERNAL "c compiler flags debug")
+set(CMAKE_CXX_FLAGS_DEBUG "-Og -femit-class-debug-always -g3 -ggdb" CACHE INTERNAL "cxx compiler flags debug")
+set(CMAKE_ASM_FLAGS_DEBUG "-g3 -ggdb" CACHE INTERNAL "asm compiler flags debug")
+set(CMAKE_EXE_LINKER_FLAGS_DEBUG "" CACHE INTERNAL "linker flags debug")
+
+# set release flags
+set(CMAKE_C_FLAGS_RELEASE "-Os -flto" CACHE INTERNAL "c compiler flags release")
+set(CMAKE_CXX_FLAGS_RELEASE "-Os -flto" CACHE INTERNAL "cxx compiler flags release")
+set(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm compiler flags release")
+set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-flto" CACHE INTERNAL "linker flags release")
+
+# root paths to search on the filesystem for cross-compiling
+set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_PREFIX}/arm-none-eabi ${EXTRA_FIND_PATH})
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+function(MBED_ADD_HEX_BIN_DUMP_TARGETS TARGET)
+ if(EXECUTABLE_OUTPUT_PATH)
+ set(FILENAME "${EXECUTABLE_OUTPUT_PATH}/${TARGET}")
+ else()
+ set(FILENAME "${TARGET}")
+ endif()
+
+ # add targets for HEX, BIN and S19 formats with no output so they will always be built
+ add_custom_target(${TARGET}.hex DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Oihex ${FILENAME} ${FILENAME}.hex)
+ add_custom_target(${TARGET}.s19 DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Osrec ${FILENAME} ${FILENAME}.s19)
+ add_custom_target(${TARGET}.bin DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Obinary ${FILENAME} ${FILENAME}.bin)
+ add_custom_target(${TARGET}.dump DEPENDS ${TARGET} COMMAND ${CMAKE_OBJDUMP} -d -EL -S ${FILENAME} ${FILENAME}.dump)
+endfunction()
+
+function(MBED_PRINT_SIZE_OF_TARGETS TARGET)
+ if(EXECUTABLE_OUTPUT_PATH)
+ set(FILENAME "${EXECUTABLE_OUTPUT_PATH}/${TARGET}")
+ else()
+ set(FILENAME "${TARGET}")
+ endif()
+ add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_SIZE} ${FILENAME})
+endfunction()
diff --git a/source/native/nf-interpreter/CMakeLists.txt b/source/native/nf-interpreter/CMakeLists.txt
new file mode 100644
index 00000000..8f9039d9
--- /dev/null
+++ b/source/native/nf-interpreter/CMakeLists.txt
@@ -0,0 +1,730 @@
+#
+# Copyright (c) 2017 The nanoFramework project contributors
+# See LICENSE file in the project root for full license information.
+#
+
+cmake_minimum_required(VERSION 3.11)
+include(CMakeToolsHelpers OPTIONAL)
+include(ExternalProject)
+
+# set(CMAKE_VERBOSE_MAKEFILE 1) # debug helper
+
+# the following prevents launchin a build in the source tree
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
+
+# fatal error and message explaining this
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+ message(STATUS "\n-- ###############################################\n")
+ message(STATUS "Please run the build outside of the source tree.\n\n")
+ message(STATUS "Hint: create a 'build' folder and run CMake from there..")
+ message(STATUS "###############################################\n\n")
+ message(FATAL_ERROR "Build launched in the source tree.")
+endif()
+#########################################
+
+
+########################################################
+# path to local CMake modules
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules)
+########################################################
+
+
+######################################################
+# set build type to release if not specified otherwise
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "Debug")
+endif()
+######################################################
+
+# add compiler define for DEBUG
+add_compile_options("$<$:-DDEBUG>")
+
+######################################################
+# set time stamp of build
+string(TIMESTAMP BUILD_TIMESTAMP UTC)
+######################################################
+
+#######################
+# handle RTOSes choice
+
+if("${RTOS}" STREQUAL "")
+ # no RTOS selected, defaulting to ChibiOS
+ set(RTOS "CHIBIOS")
+endif()
+
+# list of supported RTOSes
+# when adding a new RTOS add the corresponding string below AND...
+# ... also on the compare block below
+set(RTOS_SUPPORTED "CHIBIOS" "FREERTOS_ESP32" "TI_SIMPLELINK" CACHE INTERNAL "supported RTOS options")
+
+list(FIND RTOS_SUPPORTED ${RTOS} RTOS_INDEX)
+if(RTOS_INDEX EQUAL -1)
+ message(FATAL_ERROR "\n\n'${RTOS}' is an invalid option for RTOS. Please choose a valid RTOS.\n\n")
+else()
+ message(STATUS "\nSetting RTOS to ${RTOS}\n")
+endif()
+
+string(COMPARE EQUAL "CHIBIOS" "${RTOS}" RTOS_CHIBIOS_CHECK)
+string(COMPARE EQUAL "FREERTOS_ESP32" "${RTOS}" RTOS_FREERTOS_ESP32_CHECK)
+string(COMPARE EQUAL "TI_SIMPLELINK" "${RTOS}" RTOS_TI_SIMPLELINK_CHECK)
+
+##########################################################################
+
+if(RTOS_FREERTOS_ESP32_CHECK)
+ set(RTOS_FREERTOS_ESP32_CHECK TRUE)
+ set(RTOS_TI_SIMPLELINK_CHECK FALSE)
+ set(RTOS_CHIBIOS_CHECK FALSE)
+endif()
+
+if(RTOS_CHIBIOS_CHECK)
+ set(RTOS_CHIBIOS_CHECK TRUE)
+ set(RTOS_FREERTOS_ESP32_CHECK FALSE)
+ set(RTOS_TI_SIMPLELINK_CHECK FALSE)
+endif()
+
+if(RTOS_TI_SIMPLELINK_CHECK)
+ set(RTOS_TI_SIMPLELINK_CHECK TRUE)
+ set(RTOS_FREERTOS_ESP32_CHECK FALSE)
+ set(RTOS_CHIBIOS_CHECK FALSE)
+endif()
+
+#######################
+
+
+##########################################
+# set default toolchain to GCC
+set(TOOLCHAIN GCC)
+# have it lower case too for file names
+string(TOLOWER TOOLCHAIN_LOWER ${TOOLCHAIN})
+##########################################
+
+if(RTOS_CHIBIOS_CHECK)
+
+ # check for toolchain path
+ if(NOT TOOLCHAIN_PREFIX)
+ message(STATUS "\n-- ########################################\nNo TOOLCHAIN_PREFIX specified, need one!\nCall CMake with -DTOOLCHAIN_PREFIX=\"\"\n specifing the path to your GCC toolchain (ex: E:/GNU_Tools_ARM_Embedded/5_4_2016q3)")
+ message(STATUS "\nNOTE: mind the forward slash in the path, without trailing slash.)")
+ message(STATUS "########################################\n\n")
+ message(FATAL_ERROR "No TOOLCHAIN_PREFIX specified")
+ endif()
+
+ message(STATUS "\nSetting Toolchain file for ChibiOS \n")
+ # set toolchain file
+ set(CMAKE_TOOLCHAIN_FILE CMake/toolchain.ChibiOS.${TOOLCHAIN}.cmake)
+
+ # Set up short path substitution on Windows
+ if(WIN32)
+ if(EXISTS ${CMAKE_SOURCE_DIR}/SetNFRoot.bat)
+ execute_process(COMMAND ${CMAKE_SOURCE_DIR}/SetNFRoot.bat OUTPUT_VARIABLE NFROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(ENV{nfRoot} ${NFROOT})
+ endif()
+ endif()
+
+elseif(RTOS_FREERTOS_ESP32_CHECK)
+ message(STATUS "\nSetting Toolchain file for FreeRTOS ESP32 \n")
+ set(CMAKE_TOOLCHAIN_FILE CMake/toolchain.FreeRtos.ESP32.${TOOLCHAIN}.cmake)
+
+elseif(RTOS_TI_SIMPLELINK_CHECK)
+ message(STATUS "\nSetting Toolchain file for FreeRTOS CC32XX \n")
+ set(CMAKE_TOOLCHAIN_FILE CMake/toolchain.TI_SimpleLink.${TOOLCHAIN}.cmake)
+
+endif()
+
+#########################################
+
+# set default version
+if(NOT BUILD_VERSION)
+ set(BUILD_VERSION 0.0.0.0)
+endif()
+project(nanoFramework VERSION ${BUILD_VERSION})
+
+#######################
+message(STATUS "")
+message(STATUS "Building nanoFramework version ${PROJECT_VERSION} using build type '${CMAKE_BUILD_TYPE}'.")
+message(STATUS "Source directory is '${PROJECT_SOURCE_DIR}'.")
+message(STATUS "Build directory is '${PROJECT_BINARY_DIR}'.")
+message(STATUS "Toolchain is '${TOOLCHAIN}'.")
+message(STATUS "")
+#######################
+
+
+#################################################################
+# ouput RTM build option
+# Build RTM version of firmware (default is OFF so the build is not RTM and the CLR outputs some debug informations)
+option(NF_BUILD_RTM "option to build with RTM definition")
+
+if(NF_BUILD_RTM)
+ message(STATUS "***************************")
+ message(STATUS "** Building RTM firmware **")
+ message(STATUS "***************************")
+ message(STATUS "")
+endif()
+#################################################################
+
+if(RTOS_CHIBIOS_CHECK)
+
+ #################################################################
+ # clear CMAKE_C_FLAGS_INIT and CMAKE_CXX_FLAGS_INIT
+ # (this needs to be here and not before because by now
+ # the compiler detection has already occurred)
+ set(CMAKE_C_FLAGS "" CACHE INTERNAL "clear c compiler flags")
+ set(CMAKE_CXX_FLAGS "" CACHE INTERNAL "clear cxx compiler flags")
+ #################################################################
+
+
+ #################################################################
+ # clear some CMake flavor flags that are being set as default
+ # in the GNU compiler init
+ # we want to control and fine tune these
+ set(CMAKE_C_FLAGS_DEBUG "" CACHE INTERNAL "clear c compiler flags")
+ set(CMAKE_C_FLAGS_MINSIZEREL "" CACHE INTERNAL "clear c compiler flags")
+ set(CMAKE_C_FLAGS_RELEASE "" CACHE INTERNAL "clear c compiler flags")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "clear c compiler flags")
+ set(CMAKE_CXX_FLAGS_DEBUG "" CACHE INTERNAL "clear c++ compiler flags")
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "" CACHE INTERNAL "clear c++ compiler flags")
+ set(CMAKE_CXX_FLAGS_RELEASE "" CACHE INTERNAL "clear c++ compiler flags")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "clear c++ compiler flags")
+ #################################################################
+
+
+ #################################################################
+ # clear default libraries that are set by CMake
+ # we want to control
+ set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "" CACHE INTERNAL "clear c linker default libs")
+ set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "" CACHE INTERNAL "clear c++ linker default libs")
+ #################################################################
+
+endif()
+
+#################################################################################
+# chooses if double-point float point support is provided by the platform
+# (default is OFF which means that single-precision floating point is effective)
+option(DP_FLOATINGPOINT "option to enable support for double-precision floating point")
+
+if(DP_FLOATINGPOINT)
+ set(TARGET_DP_FLOATINGPOINT TRUE CACHE INTERNAL "DP FP support")
+ message(STATUS "Double-precision floating point is effective")
+else()
+ set(TARGET_DP_FLOATINGPOINT FALSE CACHE INTERNAL "DP FP support")
+ message(STATUS "Single-precision floating point is effective")
+endif()
+
+#################################################################################
+# chooses if build without complex math functions
+# (default is OFF which means that all floating point math functions are available)
+option(NF_FEATURE_LIGHT_MATH "option to build without complex math functions")
+
+if(NF_FEATURE_LIGHT_MATH)
+ set(TARGET_LIGHT_MATH TRUE CACHE INTERNAL "Complex Math functions disabled")
+ message(STATUS "Complex math functions not available")
+else()
+ set(TARGET_LIGHT_MATH FALSE CACHE INTERNAL "Complex Math functions enabled")
+ message(STATUS "Complex math functions available")
+endif()
+
+###################################################################################
+# chooses if platform provides support for converting string to values on any base
+# (default is OFF which means that conversion to value from base 10 and 16 (partial) is effective)
+option(SUPPORT_ANY_BASE_CONVERSION "option to enable support for converting strings to value on any base")
+
+if(SUPPORT_ANY_BASE_CONVERSION)
+ set(TARGET_SUPPORT_ANY_BASE_CONVERSION TRUE CACHE INTERNAL "Option for string conversion to value from any base")
+ message(STATUS "String conversion to value on any base is effective")
+else()
+ set(TARGET_SUPPORT_ANY_BASE_CONVERSION FALSE CACHE INTERNAL "Option for string conversion to value from base 10 and partial for 16")
+ message(STATUS "String conversion to value from base 10 and 16 (partial) is effective")
+endif()
+
+#################################################################
+# true random number generation option supported by hardware
+option(USE_RNG "option to enable use of true random generator hardware block" ON)
+
+if(USE_RNG)
+ message(STATUS "Random Number Generation by target MCU is activated")
+else()
+ message(STATUS "Random Number Generation by target MCU is NOT activated")
+endif()
+
+#################################################################
+# nanoFramework features
+#################################################################
+
+###################################################################
+# debugger (default is OFF so no support for debugging is included
+option(NF_FEATURE_DEBUGGER "option to enable support for debugging")
+
+if(NF_FEATURE_DEBUGGER)
+ message(STATUS "Support for debugging managed applications is included.")
+else()
+ message(STATUS "Support for debugging managed applications IS NOT included.")
+endif()
+
+#################################################################
+# enables Application Domains support in nanoCLR
+# (default is OFF so Application Domains is NOT supported)
+option(NF_FEATURE_USE_APPDOMAINS "option to enable Application Domains")
+
+if(NF_FEATURE_USE_APPDOMAINS)
+ message(STATUS "Application Domains support is included")
+else()
+ message(STATUS "Application Domains support IS NOT included")
+endif()
+
+#################################################################
+# disable all trace messages and checks on CLR
+# (default is OFF so all traces and checks are enabled)
+option(NF_PLATFORM_NO_CLR_TRACE "option to disable all trace stuff in CLR")
+
+if(NF_PLATFORM_NO_CLR_TRACE)
+ message(STATUS "CLR has all trace messages and checks DISABLED")
+else()
+ message(STATUS "CLR has all trace messages and checks enabled")
+endif()
+
+#################################################################
+# disable CLR IL inlining
+# (default is OFF so CLR IL inline is enabled)
+option(NF_CLR_NO_IL_INLINE "option to disable CLR IL inlining")
+
+if(NF_CLR_NO_IL_INLINE)
+ message(STATUS "CLR IL inlining is DISABLED")
+else()
+ message(STATUS "CLR IL inlining is enabled")
+endif()
+
+#################################################################
+# enables configuration block storage support
+# (default is OFF so Configuration block storage is NOT supported)
+option(NF_FEATURE_HAS_CONFIG_BLOCK "option to enable configuration block storage")
+
+if(NF_FEATURE_HAS_CONFIG_BLOCK)
+ set(TARGET_HAS_CONFIG_BLOCK TRUE CACHE INTERNAL "Option for config block")
+ message(STATUS "Configuration block storage is included")
+else()
+ set(TARGET_HAS_CONFIG_BLOCK FALSE CACHE INTERNAL "Option for config block")
+ message(STATUS "Configuration block storage IS NOT included")
+endif()
+
+#################################################################
+# enables support for SD Card
+# (default is OFF so SD Card is NOT supported)
+option(NF_FEATURE_HAS_SDCARD "option to enable support for SD Card")
+
+if(NF_FEATURE_HAS_SDCARD)
+
+ # this feature currently is supported only on ChibiOS and ESP32 FreeRTOS
+ if(NOT RTOS_CHIBIOS_CHECK AND NOT RTOS_FREERTOS_ESP32_CHECK)
+ message(FATAL_ERROR "Support for SD Card is only available for ChibiOS Cortex-M and ESP32 targets.")
+ endif()
+
+ # force inclusion of Windows.Storage API
+ set(API_Windows.Storage ON CACHE INTERNAL "Forcing Windows.Storage API option to ON")
+
+ message(STATUS "Support for SD Card is included")
+else()
+ message(STATUS "Support for SD Card IS NOT included")
+endif()
+
+#################################################################
+
+#################################################################
+# enables USB Mass Storage support
+# (default is OFF so USB Mass Storage is NOT supported)
+option(NF_FEATURE_HAS_USB_MSD "option to enable USB Mass Storage")
+
+if(NF_FEATURE_HAS_USB_MSD)
+
+ # this feature currently is supported only on ChibiOS
+ if(NOT RTOS_CHIBIOS_CHECK)
+ message(FATAL_ERROR "Support for USB Mass Storage is only available for ChibiOS Cortex-M targets.")
+ endif()
+
+ # this feature requires inclusion of ChibiOS contribution repository
+ set(CHIBIOS_CONTRIB_REQUIRED ON CACHE INTERNAL "Forcing ChibiOS contribution repo option to ON")
+
+ # force inclusion of Windows.Storage API
+ set(API_Windows.Storage ON CACHE INTERNAL "Forcing Windows.Storage API option to ON")
+
+ message(STATUS "Support for USB Mass Storage is included")
+else()
+ message(STATUS "Support for USB Mass Storage IS NOT included")
+endif()
+
+#################################################################
+
+#################################################################
+# enables support for SPI file system
+# (default is OFF so SPIFFS is NOT supported)
+option(NF_FEATURE_USE_SPIFFS "option to enable support for SPI file system")
+
+if(NF_FEATURE_USE_SPIFFS)
+
+ # this feature currently is supported only on ChibiOS and ESP32
+ if(NOT RTOS_CHIBIOS_CHECK)
+ message(FATAL_ERROR "Support for SPIFFS is only available for ChibiOS Cortex-M and ESP32 targets.")
+ endif()
+
+ # force inclusion of Windows.Storage API
+ set(API_Windows.Storage ON CACHE INTERNAL "Forcing Windows.Storage API option to ON")
+
+ set(NF_FEATURE_USE_SPIFFS_OPTION TRUE CACHE INTERNAL "Set nF SPIFFS feature TRUE")
+
+ message(STATUS "Support for SPIFFS is included")
+else()
+ set(NF_FEATURE_USE_SPIFFS_OPTION FALSE CACHE INTERNAL "Set nF SPIFFS feature FALSE")
+ message(STATUS "Support for SPIFFS IS NOT included")
+endif()
+
+#################################################################
+
+if(RTOS_CHIBIOS_CHECK)
+
+ #################################################################
+ # ARM Cortex-M Single Wire Output (SWO)
+ # (default is OFF so no SWO output)
+
+ option(SWO_OUTPUT "option to enable SWO")
+
+ if(SWO_OUTPUT)
+ set(SWO_OUTPUT_OPTION TRUE CACHE INTERNAL "Single Wire Output Option")
+ message(STATUS "Single Wire Output (SWO) enabled")
+ else()
+ set(SWO_OUTPUT_OPTION FALSE CACHE INTERNAL "Single Wire Output Option")
+ endif()
+
+ #################################################################
+
+ #################################################################
+ # enables use of ChibiOS Community contribution
+ # (default is OFF so ChibiOS Community is NOT included)
+ option(CHIBIOS_CONTRIB_REQUIRED "option to include ChibiOS Community contributions repository")
+ #################################################################
+
+endif()
+
+#################################################################
+# reports Wire Protocol CRC32 implementation
+if(NF_WP_IMPLEMENTS_CRC32)
+ message(STATUS "Wire Protocol implements CRC32")
+else()
+ message(STATUS "Wire Protocol does NOT implement CRC32")
+endif()
+
+#################################################################
+# enables Networking support in nanoCLR
+# declares Networking option
+# needs to show before the API namespaces processing because it's used there
+# (default is OFF so Networking is NOT supported)
+option(USE_NETWORKING_OPTION "option to use networking")
+
+# (default is OFF so mbed TLS is NOT used)
+option(NF_SECURITY_MBEDTLS "option to use mbed TLS as the network security provider")
+
+# set default option for SNTP to ON
+option(NF_NETWORKING_SNTP "option to use add SNTP support, requires networking otherwise has no effect" ON)
+
+#################################################################
+
+#############################################
+# handles inclusion of System.Reflection API
+#############################################
+
+# set default option for SNTP to ON
+option(NF_FEATURE_SUPPORT_REFLECTION "option to add support for System.Reflection API" ON)
+
+if(NF_FEATURE_SUPPORT_REFLECTION)
+ set(TARGET_NANOCLR_REFLECTION TRUE CACHE INTERNAL "enable support for System.Reflection API")
+ message(STATUS "Support for System.Reflection API enabled")
+else()
+ set(TARGET_NANOCLR_REFLECTION FALSE CACHE INTERNAL "DISABLE support for System.Reflection API")
+ message(STATUS "Support for System.Reflection API **IS NOT** enabled")
+endif()
+
+#################################################################
+
+#################################################################
+
+#############################################
+# handles inclusion of System.Collections API
+#############################################
+
+if(API_nanoFramework.System.Collections)
+ set(TARGET_SYSTEM_COLLECTIONS TRUE CACHE INTERNAL "enable support for System.Collections API")
+ message(STATUS "Support for System.Collections API enabled")
+else()
+ set(TARGET_SYSTEM_COLLECTIONS FALSE CACHE INTERNAL "DISABLE support for System.Collections API")
+ message(STATUS "Support for System.Collections API **IS NOT** enabled")
+endif()
+
+#################################################################
+
+#################################################################
+# manage HAL/PAL required for API namespaces
+#################################################################
+# for some APIs we need to enable the device in the HAL config
+# and/or manage other APIs that are required
+
+if( API_nanoFramework.Devices.OneWire OR
+ API_Windows.Devices.SerialCommunication)
+
+ set(HAL_USE_UART_OPTION TRUE CACHE INTERNAL "HAL OneWire for nanoFramework.Devices.OneWire")
+
+else()
+ set(HAL_USE_UART_OPTION FALSE CACHE INTERNAL "HAL OneWire for nanoFramework.Devices.OneWire")
+endif()
+
+if( API_System.Net OR
+ API_Windows.Networking.Sockets)
+
+ # set NETWORKING option to true
+ set(USE_NETWORKING_OPTION TRUE CACHE INTERNAL "NF feature NETWORKING")
+
+ # set Security module to use
+ if(NF_SECURITY_MBEDTLS )
+ set(USE_SECURITY_MBEDTLS_OPTION TRUE CACHE INTERNAL "NF security MBEDTLS")
+ endif()
+
+ if(API_Windows.Devices.Wifi)
+ set(USE_WIFI_OPTION TRUE CACHE INTERNAL "Wifi for Windows.Devices.WiFi")
+ else()
+ set(USE_WIFI_OPTION FALSE CACHE INTERNAL "Wifi for Windows.Devices.WiFi")
+ endif()
+
+endif()
+
+
+if(API_Windows.Devices.Adc)
+ set(HAL_USE_ADC_OPTION TRUE CACHE INTERNAL "HAL ADC for Windows.Devices.Adc")
+else()
+ set(HAL_USE_ADC_OPTION FALSE CACHE INTERNAL "HAL ADC for Windows.Devices.Adc")
+endif()
+
+
+if(API_System.Devices.Dac)
+ set(HAL_USE_DAC_OPTION TRUE CACHE INTERNAL "HAL DAC for System.Devices.Dac")
+else()
+ set(HAL_USE_DAC_OPTION FALSE CACHE INTERNAL "HAL DAC for System.Devices.Dac")
+endif()
+
+
+if(API_Windows.Devices.Gpio)
+ set(HAL_USE_GPIO_OPTION TRUE CACHE INTERNAL "HAL GPIO for Windows.Devices.Gpio")
+else()
+ set(HAL_USE_GPIO_OPTION FALSE CACHE INTERNAL "HAL GPIO for Windows.Devices.Gpio")
+endif()
+
+
+if(API_Windows.Devices.I2c)
+ set(HAL_USE_I2C_OPTION TRUE CACHE INTERNAL "HAL I2C for Windows.Devices.I2c")
+else()
+ set(HAL_USE_I2C_OPTION FALSE CACHE INTERNAL "HAL I2C for Windows.Devices.I2c")
+endif()
+
+
+if(API_Windows.Devices.Pwm)
+ set(HAL_USE_PWM_OPTION TRUE CACHE INTERNAL "HAL PWM for Windows.Devices.Pwm")
+else()
+ set(HAL_USE_PWM_OPTION FALSE CACHE INTERNAL "HAL PWM for Windows.Devices.Pwm")
+endif()
+
+
+if(API_Windows.Devices.Spi)
+ set(HAL_USE_SPI_OPTION TRUE CACHE INTERNAL "HAL SPI for Windows.Devices.Spi")
+else()
+ set(HAL_USE_SPI_OPTION FALSE CACHE INTERNAL "HAL SPI for Windows.Devices.Spi")
+endif()
+
+
+if(API_nanoFramework.Devices.Can)
+ set(HAL_USE_CAN_OPTION TRUE CACHE INTERNAL "HAL CAN for nanoFramework.Devices.Can")
+else()
+ set(HAL_USE_CAN_OPTION FALSE CACHE INTERNAL "HAL CAN for nanoFramework.Devices.Can")
+endif()
+
+
+if(API_nanoFramework.Devices.OneWire)
+ set(HAL_USE_STM32_ONEWIRE_OPTION TRUE CACHE INTERNAL "HAL STM32_ONEWIRE for nanoFramework.Devices.OneWire")
+else()
+ set(HAL_USE_STM32_ONEWIRE_OPTION FALSE CACHE INTERNAL "HAL STM32_ONEWIRE for nanoFramework.Devices.OneWire")
+endif()
+
+if(NF_FEATURE_HAS_SDCARD)
+ set(HAL_USE_SDC_OPTION TRUE CACHE INTERNAL "HAL SDC for NF_FEATURE_HAS_SDCARD")
+else()
+ set(HAL_USE_SDC_OPTION FALSE CACHE INTERNAL "HAL SDC for NF_FEATURE_HAS_SDCARD")
+endif()
+
+if(NF_FEATURE_HAS_USB_MSD)
+ set(HAL_USBH_USE_MSDC_OPTION TRUE CACHE INTERNAL "HAL USBH_USE_MSD for NF_FEATURE_HAS_USB_MSD")
+else()
+ set(HAL_USBH_USE_MSDC_OPTION FALSE CACHE INTERNAL "HAL USBH_USE_MSD for NF_FEATURE_HAS_USB_MSD")
+endif()
+
+#################################################################
+# manage dependent APIs required for some API namespaces
+#################################################################
+
+# include nanoFramework.Runtime.Events API
+if( API_nanoFramework.Devices.OneWire OR
+ API_System.Net OR
+ API_Windows.Devices.Gpio OR
+ API_Windows.Devices.SerialCommunication OR
+ API_Windows.Networking.Sockets OR
+ API_nanoFramework.Devices.Can OR
+ API_Windows.Storage)
+
+ # these APIs requires nanoFramework.Runtime.Events
+ set(API_nanoFramework.Runtime.Events ON CACHE INTERNAL "enable of API_nanoFramework.Runtime.Events")
+
+endif()
+
+if(API_System.Net)
+ # manage inclusion of SNTP
+ if(NF_NETWORKING_SNTP)
+ set(API_nanoFramework.Networking.Sntp ON CACHE INTERNAL "enable API_nanoFramework.Networking.Sntp")
+ else()
+ set(API_nanoFramework.Networking.Sntp OFF CACHE INTERNAL "disable API_nanoFramework.Networking.Sntp")
+ endif()
+endif()
+
+
+#################################################################
+# handles Networking support at HAL level
+
+if(USE_NETWORKING_OPTION)
+ set(HAL_USE_MAC_OPTION TRUE CACHE INTERNAL "HAL MAC for USE_NETWORKING_OPTION")
+
+ if(NF_SECURITY_MBEDTLS)
+ message(STATUS "Support for networking enabled with security from mbedTLS")
+ elseif(RTOS_TI_SIMPLELINK_CHECK)
+ message(STATUS "Support for networking enabled with security")
+ else()
+ message(STATUS "Support for networking enabled WITHOUT security")
+ endif()
+
+ # sanity check for missing configuration block option
+ # which is required for network
+
+ if(NOT NF_FEATURE_HAS_CONFIG_BLOCK)
+ message(FATAL_ERROR "\n\nERROR: network build requires NF_FEATURE_HAS_CONFIG_BLOCK build option to be 'ON'. Make sure you have that on your cmake-variants or in the build command line.")
+ endif()
+
+else()
+ set(HAL_USE_MAC_OPTION FALSE CACHE INTERNAL "HAL MAC for USE_NETWORKING_OPTION")
+ message(STATUS "Support for networking IS NOT enabled")
+endif()
+
+#################################################################
+
+
+#################################################################
+# enables filesysytem support in nanoCLR
+
+if(NF_FEATURE_HAS_SDCARD OR NF_FEATURE_HAS_USB_MSD)
+ set(USE_FILESYSTEM_OPTION TRUE CACHE INTERNAL "NF feature FILESYSTEM")
+else()
+ set(USE_FILESYSTEM_OPTION FALSE CACHE INTERNAL "NF feature FILESYSTEM")
+endif()
+
+#################################################################
+
+
+#################################################################
+# RTC (real time clock) (default is OFF so RTC is NOT included)
+option(NF_FEATURE_RTC "option to use hardware RTC")
+
+if(NF_FEATURE_RTC)
+ set(HAL_USE_RTC_OPTION TRUE CACHE INTERNAL "NF feature RTC")
+else()
+ set(HAL_USE_RTC_OPTION FALSE CACHE INTERNAL "NF feature RTC")
+endif()
+
+#################################################################
+
+#################################################################
+# CPU watchdog (default is ON so watchdog is included)
+option(NF_FEATURE_WATCHDOG "option to use hardware watchdog" ON)
+
+if(NF_FEATURE_WATCHDOG)
+ set(HAL_USE_WDG_OPTION TRUE CACHE INTERNAL "NF feature watchdog")
+else()
+ set(HAL_USE_WDG_OPTION FALSE CACHE INTERNAL "NF feature watchdog")
+endif()
+
+#################################################################
+
+#######################
+# ChibiOS
+if(RTOS_CHIBIOS_CHECK)
+
+ # Define base path for the class libraries
+ set(BASE_PATH_FOR_CLASS_LIBRARIES_MODULES "${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nanoCLR")
+
+ add_subdirectory(targets/CMSIS-OS/ChibiOS)
+ add_subdirectory(targets/CMSIS-OS/common)
+ add_subdirectory(targets/CMSIS-OS/common/Include)
+ add_subdirectory(targets/CMSIS-OS/nanoBooter)
+ add_subdirectory(targets/CMSIS-OS/nanoCLR)
+
+ # now add the subdirectory for the board
+ # try to find board in the targets folder
+ if(EXISTS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD})
+
+ # board found
+ message(STATUS "Support for target board '${CHIBIOS_BOARD}' found")
+ message(STATUS "${CHIBIOS_BOARD_DEFINITIONS_LOCATION}")
+
+ # add TARGET board directory
+ add_subdirectory("${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD}")
+
+ else()
+
+ # try to find board in the Community targets folder
+ if(EXISTS ${PROJECT_SOURCE_DIR}/targets-community/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD})
+ # board found
+ message(STATUS "Support for target board '${CHIBIOS_BOARD}' found in Community targets")
+ message(STATUS "${CHIBIOS_BOARD_DEFINITIONS_LOCATION}")
+
+ # add TARGET board directory from Community
+ add_subdirectory("targets-community/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD}")
+ else()
+ # board NOT found in targets folder
+ # board NOT found in targets folder
+ message(FATAL_ERROR "\n\nSorry but support for ${CHIBIOS_BOARD} target is not available...\n\You can wait for that to be added or you might want to contribute and start working on a PR for that.\n\n")
+ endif()
+
+ endif()
+
+#######################
+# FreeRTOS_ESP32
+elseif(RTOS_FREERTOS_ESP32_CHECK)
+
+ if("${TARGET_SERIES}" STREQUAL "ESP32")
+ message(STATUS "Platform ESP32 target board: ${ESP32_BOARD}")
+
+ # check watchdog feature
+ # EPS32 build has watchdog enabled by default, so setting it to OFF doens't make sense
+ # becuase the build system can't honour that preference
+ if(NOT NF_FEATURE_WATCHDOG)
+ message(FATAL_ERROR "\n\nESP32 watchdog is enabled by default in so you can't have the NF_FEATURE_WATCHDOG option set to OFF.\n\n")
+ endif()
+
+ # Define base path for the class libraries
+ set(BASE_PATH_FOR_CLASS_LIBRARIES_MODULES "${PROJECT_SOURCE_DIR}/targets/FreeRTOS_ESP32/${ESP32_BOARD}/nanoCLR")
+
+ add_subdirectory(targets/FreeRTOS_ESP32)
+
+ # set target base location
+ set(TARGET_BASE_LOCATION "${PROJECT_SOURCE_DIR}/targets/FreeRTOS_ESP32/${ESP32_BOARD}")
+ add_subdirectory(targets/FreeRTOS_ESP32/${ESP32_BOARD})
+
+ endif()
+
+#######################
+# TI_SIMPLELINK
+elseif(RTOS_TI_SIMPLELINK_CHECK)
+
+ add_subdirectory(targets/TI-SimpleLink)
+
+endif()
diff --git a/source/native/nf-interpreter/CMakeSettings.SAMPLE.json b/source/native/nf-interpreter/CMakeSettings.SAMPLE.json
new file mode 100644
index 00000000..a18ff205
--- /dev/null
+++ b/source/native/nf-interpreter/CMakeSettings.SAMPLE.json
@@ -0,0 +1,519 @@
+{
+ "configurations": [
+ {
+ "name": "ESP32",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "inheritEnvironments": [ "gcc-arm" ],
+ "environments": [ { "PATH": "C:\\Windows\\system32;${env.PATH}" } ],
+ "buildRoot": "${workspaceRoot}/Build\\${name}",
+ "installRoot": "${workspaceRoot}/Build/install/${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "-v",
+ "ctestCommandArgs": "",
+ "intelliSenseMode": "linux-gcc-arm",
+ "variables": [
+ {
+ "name": "EXECUTABLE_OUTPUT_PATH",
+ "value": "${workspaceRoot}/Build/${name}",
+ "type": "PATH"
+ },
+ {
+ "name": "ESP32_TOOLCHAIN_PATH",
+ "value": "C:/ESP32_TOOLS",
+ "type": "PATH"
+ },
+ {
+ "name": "TOOLCHAIN_PREFIX",
+ "value": "C:/ESP32_TOOLS",
+ "type": "PATH"
+ },
+ {
+ "name": "ESP32_IDF_PATH",
+ "value": "C:/ESP32_TOOLS/esp-idf-v3.3",
+ "type": "PATH"
+ },
+ {
+ "name": "ESP32_LIBS_PATH",
+ "value": "C:/ESP32_TOOLS/libs-v3.3",
+ "type": "PATH"
+ },
+ {
+ "name": "CMAKE_SYSTEM_NAME",
+ "value": "Generic",
+ "type": "STRING"
+ },
+ {
+ "name": "GIT_EXECUTABLE",
+ "value": "${env.VSINSTALLDIR}/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/cmd/git.exe",
+ "type": "FILEPATH"
+ },
+ {
+ "name": "GIT_VERSION_STRING",
+ "value": "2.19.0",
+ "type": "STRING"
+ },
+ {
+ "name": "TARGET_SERIES",
+ "value": "ESP32",
+ "type": "STRING"
+ },
+ {
+ "name": "ESP32_BOARD",
+ "value": "ESP32_WROOM_32",
+ "type": "STRING"
+ },
+ {
+ "name": "USE_RNG",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "TARGET_LIGHT_MATH",
+ "value": "FALSE",
+ "type": "BOOL"
+ },
+ {
+ "name": "TARGET_DP_FLOATINGPOINT",
+ "value": "FALSE",
+ "type": "BOOL"
+ },
+ {
+ "name": "TARGET_SUPPORT_ANY_BASE_CONVERSION",
+ "value": "FALSE",
+ "type": "BOOL"
+ },
+ {
+ "name": "RTOS",
+ "value": "FREERTOS_ESP32",
+ "type": "STRING"
+ },
+ {
+ "name": "NF_BUILD_RTM",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_TRACE_ERRORS",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_TRACE_HEADERS",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_TRACE_STATE",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_TRACE_NODATA",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_TRACE_ALL",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_IMPLEMENTS_CRC32",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_DEBUGGER",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_RTC",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_USE_APPDOMAINS",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_WATCHDOG",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_HAS_CONFIG_BLOCK",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_PLATFORM_NO_CLR_TRACE",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_CLR_NO_IL_INLINE",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_INTEROP_ASSEMBLIES",
+ "value": "False",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_NETWORKING_SNTP",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_SECURITY_MBEDTLS",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_nanoFramework.Devices.OneWire",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_System.Math",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_nanoFramework.ResourceManager",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_System.Net",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.Adc",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_System.Devices.Dac",
+ "value": "False",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.Gpio",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.I2c",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.Pwm",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.SerialCommunication",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.Spi",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.Wifi",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Networking.Sockets",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Storage",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Hardware.Esp32",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_USE_SPIFFS",
+ "value": "False",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_HAS_SDCARD",
+ "value": "True",
+ "type": "BOOL"
+ }
+ ]
+ },
+ {
+ "name": "STM769IDiscovery",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "inheritEnvironments": [ "gcc-arm" ],
+ "environments": [ { "PATH": "C:\\Windows\\system32;${env.PATH}" } ],
+ "buildRoot": "${env.nfRoot}Build/${name}",
+ "installRoot": "${workspaceRoot}/Build/install/${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "-v",
+ "ctestCommandArgs": "",
+ "intelliSenseMode": "linux-gcc-arm",
+ "variables": [
+ {
+ "name": "EXECUTABLE_OUTPUT_PATH",
+ "value": "${workspaceRoot}/Build/${name}",
+ "type": "STRING"
+ },
+ {
+ "name": "TOOLCHAIN_PREFIX",
+ "value": "${env.GNU_GCC_TOOLCHAIN_PATH}",
+ "type": "PATH"
+ },
+ {
+ "name": "CMAKE_SYSTEM_NAME",
+ "value": "Generic",
+ "type": "STRING"
+ },
+ {
+ "name": "TARGET_SERIES",
+ "value": "STM32F7xx",
+ "type": "STRING"
+ },
+ {
+ "name": "CHIBIOS_BOARD",
+ "value": "ST_STM32F769I_DISCOVERY",
+ "type": "STRING"
+ },
+ {
+ "name": "CHIBIOS_SOURCE",
+ "value": "C:/usr/src/NanoFramework/ChibiOS",
+ "type": "PATH"
+ },
+ {
+ "name": "CHIBIOS_VERSION",
+ "value": "",
+ "type": "STRING"
+ },
+ {
+ "name": "USE_RNG",
+ "value": "ON",
+ "type": "BOOL"
+ },
+ {
+ "name": "TARGET_LIGHT_MATH",
+ "value": "FALSE",
+ "type": "BOOL"
+ },
+ {
+ "name": "TARGET_DP_FLOATINGPOINT",
+ "value": "FALSE",
+ "type": "BOOL"
+ },
+ {
+ "name": "TARGET_SUPPORT_ANY_BASE_CONVERSION",
+ "value": "ON",
+ "type": "BOOL"
+ },
+ {
+ "name": "TOOL_HEX2DFU_PREFIX",
+ "value": "${env.HEX2DFU_PATH}",
+ "type": "PATH"
+ },
+ {
+ "name": "RTOS",
+ "value": "CHIBIOS",
+ "type": "STRING"
+ },
+ {
+ "name": "SWO_OUTPUT_OPTION",
+ "value": "TRUE",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_BUILD_RTM",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_TRACE_ERRORS",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_TRACE_HEADERS",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_TRACE_STATE",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_TRACE_NODATA",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_TRACE_ALL",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_WP_IMPLEMENTS_CRC32",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_DEBUGGER",
+ "value": "ON",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_RTC",
+ "value": "ON",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_USE_APPDOMAINS",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_WATCHDOG",
+ "value": "ON",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_HAS_CONFIG_BLOCK",
+ "value": "ON",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_HAS_SDCARD",
+ "value": "ON",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_PLATFORM_NO_CLR_TRACE",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_CLR_NO_IL_INLINE",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_INTEROP_ASSEMBLIES",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_NETWORKING_SNTP",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_SECURITY_MBEDTLS",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "MBEDTLS_SOURCE",
+ "value": "",
+ "type": "PATH"
+ },
+ {
+ "name": "API_nanoFramework.Devices.OneWire",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_System.Math",
+ "value": "ON",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_System.Net",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.Adc",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_System.Devices.Dac",
+ "value": "False",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.Gpio",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.I2c",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.Pwm",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.SerialCommunication",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Devices.Spi",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Networking.Sockets",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Windows.Storage",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_nanoFramework.Devices.Can",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Hardware.Esp32",
+ "value": "OFF",
+ "type": "BOOL"
+ },
+ {
+ "name": "API_Hardware.Stm32",
+ "value": "True",
+ "type": "BOOL"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/source/native/nf-interpreter/CMakeSettings.json b/source/native/nf-interpreter/CMakeSettings.json
new file mode 100644
index 00000000..4f1b76b0
--- /dev/null
+++ b/source/native/nf-interpreter/CMakeSettings.json
@@ -0,0 +1,460 @@
+{
+ "configurations": [
+ {
+ "name": "STM769IDiscovery",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "inheritEnvironments": [
+ "gcc-arm"
+ ],
+ "environments": [
+ {
+ "PATH": "C:\\Windows\\system32;${env.PATH}" // Work around for Ninja not finding Cmd.exe with add_custom_command
+ }
+ ],
+ "buildRoot": "${env.nfRoot}Build/${name}",
+ "installRoot": "${workspaceRoot}/Build/install/${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "-v",
+ "ctestCommandArgs": "",
+ "intelliSenseMode": "linux-gcc-arm",
+ "variables": [
+ {
+ "name": "EXECUTABLE_OUTPUT_PATH",
+ "value": "${workspaceRoot}/Build/${name}"
+ },
+ {
+ "name": "TOOLCHAIN_PREFIX:PATH",
+ "value": "${env.GNU_GCC_TOOLCHAIN_PATH}"
+ },
+ {
+ "name": "CMAKE_SYSTEM_NAME",
+ "value": "Generic"
+ },
+ {
+ "name": "GIT_EXECUTABLE",
+ "value": "${env.VSINSTALLDIR}/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/cmd/git.exe"
+ },
+ {
+ "name": "GIT_VERSION_STRING",
+ "value": "2.19.0"
+ },
+ {
+ "name": "TARGET_SERIES:STRING",
+ "value": "STM32F7xx"
+ },
+ {
+ "name": "CHIBIOS_BOARD:STRING",
+ "value": "ST_STM32F769I_DISCOVERY"
+ },
+ {
+ "name": "CHIBIOS_SOURCE:PATH", // manually download, problems at the moment with value="" which forces a auto copy; causes failure with access denied at build? ( on .git directory)
+ "value": "C:/usr/src/NanoFramework/ChibiOS"
+ },
+ {
+ "name": "CHIBIOS_VERSION", // default blank, set to specific version ( Not working with Visual Studio, clone and checkout specific manually)
+ "value": ""
+ },
+ {
+ "name": "USE_RNG:BOOL", //option to enable use of true random generator hardware block
+ "value": "ON"
+ },
+ {
+ "name": "TARGET_LIGHT_MATH:BOOL", //option to build without complex math function
+ "value": "FALSE"
+ },
+ {
+ "name": "TARGET_DP_FLOATINGPOINT:BOOL",
+ "value": "FALSE"
+ },
+ {
+ "name": "TARGET_SUPPORT_ANY_BASE_CONVERSION:BOOL", //"Option for string conversion to value from base 10 and partial for 16"
+ "value": "ON"
+ },
+ {
+ "name": "TOOL_HEX2DFU_PREFIX:PATH", //"PATH for HEX TOOL"
+ "value": "${env.HEX2DFU_PATH}"
+ },
+ {
+ "name": "RTOS:STRING", //"Selected Operating system
+ "value": "CHIBIOS"
+ },
+ {
+ "name": "SWO_OUTPUT_OPTION:BOOL", // Single Wire Output Option
+ "value": "TRUE"
+ },
+ {
+ "name": "NF_BUILD_RTM:BOOL", // OFF-default-ON-to-enable-RTM-build
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_TRACE_ERRORS:BOOL", //OFF-default-ON-to-enable-trace-error-messages-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_TRACE_HEADERS:BOOL", //OFF-default-ON-to-enable-trace-header-messages-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_TRACE_STATE:BOOL", //OFF-default-ON-to-enable-trace-state-messages-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_TRACE_NODATA:BOOL", //OFF-default-ON-to-enable-trace-no-data-messages-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_TRACE_ALL:BOOL", //OFF-default-ON-to-enable-trace-all-messages-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_IMPLEMENTS_CRC32:BOOL", //OFF-default-ON-to-enable-CRC32-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_FEATURE_DEBUGGER:BOOL", //OFF-default-ON-to-include-managed-app-debugging-capability
+ "value": "OFF"
+ },
+ {
+ "name": "NF_FEATURE_RTC:BOOL", //OFF-default-ON-to-enable-hardware-RTC
+ "value": "ON"
+ },
+ {
+ "name": "NF_FEATURE_USE_APPDOMAINS:BOOL", //OFF-default-ON-to-enable-support-for-Application-Domains
+ "value": "OFF"
+ },
+ {
+ "name": "NF_FEATURE_WATCHDOG:BOOL", //ON-to-enable-hardware-watchdog-ON-is-default
+ "value": "ON"
+ },
+ {
+ "name": "NF_FEATURE_HAS_CONFIG_BLOCK:BOOL", //OFF-default-ON-to-enable-configuration-block-storage
+ "value": "ON"
+ },
+ {
+ "name": "NF_FEATURE_HAS_SDCARD:BOOL", //OFF-default-ON-to-enable-sd-card
+ "value": "ON"
+ },
+ {
+ "name": "NF_PLATFORM_NO_CLR_TRACE:BOOL", //OFF-default-ON-to-disable-all-trace-on-CLR
+ "value": "OFF"
+ },
+ {
+ "name": "NF_CLR_NO_IL_INLINE:BOOL", //OFF-default-ON-to-disable-CLR-IL-inlining
+ "value": "OFF"
+ },
+ {
+ "name": "NF_INTEROP_ASSEMBLIES:BOOL", //OFF-default-ON-to-disable-CLR-IL-inlining
+ "value": "OFF"
+ },
+ {
+ "name": "NF_NETWORKING_SNTP:BOOL", //ON-default-to-add-SNTP-client-requires-networking
+ "value": "ON"
+ },
+ {
+ "name": "NF_SECURITY_MBEDTLS:BOOL", //OFF-default-ON-to-add-network-security-from-mbedTLS
+ "value": "ON"
+ },
+ {
+ "name": "MBEDTLS_SOURCE:PATH", //path-to-mbedtls-source-mind-the-forward-slashes
+ "value": ""
+ },
+ // LIBRARIES
+ {
+ "name": "API_nanoFramework.Devices.OneWire:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_System.Math:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_System.Net:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.Adc:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_System.Devices.Dac:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.Gpio:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.I2c:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.Pwm:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.SerialCommunication:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.Spi:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Networking.Sockets:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "OFF"
+ },
+ {
+ "name": "API_Windows.Storage:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_nanoFramework.Devices.Can:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Hardware.Esp32:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "OFF"
+ },
+ {
+ "name": "API_Hardware.Stm32:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ }
+ ]
+ },
+ {
+ "name": "ESP32",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "inheritEnvironments": [
+ "gcc-arm"
+ ],
+ "environments": [
+ {
+ // Work around for Ninja not finding Cmd.exe with add_custom_command
+ "PATH": "C:\\Windows\\system32;C:\\Program Files\\Espressif\\ESP-IDF Tools\\mconf-idf;c:\\python27;${env.PATH}",
+
+ // ESP32 paths set up in environment so we can use in variables
+ "ESP32_IDF_VERSION": "v3.3",
+ "ESP32_TOOLS": "C:\\ESP32_TOOLS",
+ "ESP32_IDF": "${env.ESP32_TOOLS}\\esp-idf-${env.ESP32_IDF_VERSION}",
+ "ESP32_LIB": "${env.ESP32_TOOLS}\\libs-${env.ESP32_IDF_VERSION}",
+ "ESP32_MBEDTLS_SOURCE": "${env.ESP32_IDF}/Components/mbedtls/mbedtls",
+
+ "IDF_PATH": "${env.ESP32_IDF}"
+ }
+ ],
+ "buildRoot": "${workspaceRoot}/Build\\${name}",
+ "installRoot": "${workspaceRoot}/Build/install/${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "-v",
+ "ctestCommandArgs": "",
+ "intelliSenseMode": "linux-gcc-arm",
+ "variables": [
+ {
+ "name": "EXECUTABLE_OUTPUT_PATH",
+ "value": "${workspaceRoot}/Build/${name}"
+ },
+ {
+ "name": "ESP32_TOOLCHAIN_PATH:PATH",
+ "value": "${env.ESP32_TOOLS}"
+ },
+ {
+ "name": "TOOLCHAIN_PREFIX:PATH",
+ "value": "${env.ESP32_TOOLS}"
+ },
+ {
+ "name": "ESP32_IDF_PATH:PATH",
+ "value": "${env.ESP32_IDF}"
+ },
+ {
+ "name": "ESP32_LIBS_PATH:PATH",
+ "value": "${env.ESP32_LIB}"
+ },
+ {
+ "name": "CMAKE_SYSTEM_NAME:STRING",
+ "value": "Generic"
+ },
+ {
+ "name": "GIT_EXECUTABLE:FILEPATH",
+ "value": "${env.VSINSTALLDIR}/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/cmd/git.exe"
+ },
+ {
+ "name": "GIT_VERSION_STRING:STRING",
+ "value": "2.19.0"
+ },
+ {
+ "name": "TARGET_SERIES:STRING",
+ "value": "ESP32"
+ },
+ {
+ "name": "ESP32_BOARD:STRING",
+ "value": "ESP32_WROOM_32"
+ },
+ {
+ "name": "USE_RNG:BOOL", //option to enable use of true random generator hardware block
+ "value": "ON"
+ },
+ {
+ "name": "TARGET_LIGHT_MATH:BOOL", //option to build without complex math function
+ "value": "FALSE"
+ },
+ {
+ "name": "TARGET_DP_FLOATINGPOINT:BOOL",
+ "value": "TRUE"
+ },
+ {
+ "name": "TARGET_SUPPORT_ANY_BASE_CONVERSION:BOOL", //"Option for string conversion to value from base 10 and partial for 16"
+ "value": "FALSE"
+ },
+ {
+ "name": "RTOS:STRING", //"Selected Operating system
+ "value": "FREERTOS_ESP32"
+ },
+ {
+ "name": "NF_BUILD_RTM:BOOL", // OFF-default-ON-to-enable-RTM-build
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_TRACE_ERRORS:BOOL", //OFF-default-ON-to-enable-trace-error-messages-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_TRACE_HEADERS:BOOL", //OFF-default-ON-to-enable-trace-header-messages-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_TRACE_STATE:BOOL", //OFF-default-ON-to-enable-trace-state-messages-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_TRACE_NODATA:BOOL", //OFF-default-ON-to-enable-trace-no-data-messages-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_TRACE_ALL:BOOL", //OFF-default-ON-to-enable-trace-all-messages-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_WP_IMPLEMENTS_CRC32:BOOL", //OFF-default-ON-to-enable-CRC32-wire-protocol
+ "value": "OFF"
+ },
+ {
+ "name": "NF_FEATURE_DEBUGGER:BOOL", //OFF-default-ON-to-include-managed-app-debugging-capability
+ "value": "ON"
+ },
+ {
+ "name": "NF_FEATURE_RTC:BOOL", //OFF-default-ON-to-enable-hardware-RTC
+ "value": "ON"
+ },
+ {
+ "name": "NF_FEATURE_USE_APPDOMAINS:BOOL", //OFF-default-ON-to-enable-support-for-Application-Domains
+ "value": "OFF"
+ },
+ {
+ "name": "NF_FEATURE_WATCHDOG:BOOL", //ON-to-enable-hardware-watchdog-ON-is-default
+ "value": "ON"
+ },
+ {
+ "name": "NF_FEATURE_HAS_CONFIG_BLOCK:BOOL", //OFF-default-ON-to-enable-configuration-block-storage
+ "value": "ON"
+ },
+ {
+ "name": "NF_PLATFORM_NO_CLR_TRACE:BOOL", //OFF-default-ON-to-disable-all-trace-on-CLR
+ "value": "OFF"
+ },
+ {
+ "name": "NF_CLR_NO_IL_INLINE:BOOL", //OFF-default-ON-to-disable-CLR-IL-inlining
+ "value": "OFF"
+ },
+ {
+ "name": "NF_INTEROP_ASSEMBLIES:BOOL", //OFF-default-ON-to-disable-CLR-IL-inlining
+ "value": "OFF"
+ },
+ {
+ "name": "NF_NETWORKING_SNTP:BOOL", //ON-default-to-add-SNTP-client-requires-networking
+ "value": "ON"
+ },
+ {
+ "name": "NF_SECURITY_MBEDTLS:BOOL",
+ "value": "ON"
+ },
+ {
+ "name": "MBEDTLS_SOURCE:PATH", //path-to-mbedtls-source-mind-the-forward-slashes
+ "value": "${env.ESP32_MBEDTLS_SOURCE}"
+ },
+ // LIBRARIES
+ {
+ "name": "API_nanoFramework.Devices.OneWire:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_System.Math:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_System.Net:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_nanoFramework.ResourceManager:BOOL",
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.Adc:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_System.Devices.Dac:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.Gpio:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.I2c:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.Pwm:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.SerialCommunication:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.Spi:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Windows.Devices.Wifi:BOOL",
+ "value": "True"
+ },
+ {
+ "name": "API_Windows.Networking.Sockets:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "OFF"
+ },
+ {
+ "name": "API_Windows.Storage:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "API_Hardware.Esp32:BOOL", //OFF-default-ON-to-add-this-API
+ "value": "ON"
+ },
+ {
+ "name": "NF_FEATURE_USE_SPIFFS",
+ "value": "False",
+ "type": "BOOL"
+ },
+ {
+ "name": "NF_FEATURE_HAS_SDCARD",
+ "value": "True",
+ "type": "BOOL"
+ }
+ ]
+ }
+ ]
+}
diff --git a/source/native/nf-interpreter/InteropAssemblies/CLR_RT_InteropAssembliesTable.cpp.in b/source/native/nf-interpreter/InteropAssemblies/CLR_RT_InteropAssembliesTable.cpp.in
new file mode 100644
index 00000000..78ae4af5
--- /dev/null
+++ b/source/native/nf-interpreter/InteropAssemblies/CLR_RT_InteropAssembliesTable.cpp.in
@@ -0,0 +1,23 @@
+//
+// Copyright (c) 2017 The nanoFramework project contributors
+// See LICENSE file in the project root for full license information.
+//
+
+//////////////////////////////////////////////////////////////////////////////
+// This file was automatically generated by a tool. //
+// Any changes you make here will be overwritten when it's generated again. //
+//////////////////////////////////////////////////////////////////////////////
+
+#include
+
+extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_mscorlib;
+extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Runtime_Native;
+@CLR_RT_NativeAssemblyDataDeclarations@
+
+const CLR_RT_NativeAssemblyData *g_CLR_InteropAssembliesNativeData[] =
+{
+ &g_CLR_AssemblyNative_mscorlib,
+ &g_CLR_AssemblyNative_nanoFramework_Runtime_Native,
+ @CLR_RT_NativeAssemblyDataTableEntries@
+ NULL
+};
diff --git a/source/native/nf-interpreter/InteropAssemblies/README.md b/source/native/nf-interpreter/InteropAssemblies/README.md
new file mode 100644
index 00000000..ff8e08be
--- /dev/null
+++ b/source/native/nf-interpreter/InteropAssemblies/README.md
@@ -0,0 +1,6 @@
+
+This folder contains the configuration file for the Assemblies Table collection.
+
+It's a placeholder for the Interop assemblies source files.
+The source files for each Interop assembly should be placed in it's own folder.
+Anything inside this folder is ignored by an exception pattern in .gitignore file.
diff --git a/source/native/nf-interpreter/LICENSE.md b/source/native/nf-interpreter/LICENSE.md
new file mode 100644
index 00000000..44a0d2d8
--- /dev/null
+++ b/source/native/nf-interpreter/LICENSE.md
@@ -0,0 +1,192 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+
+ Copyright 2017 The nanoFramework project contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/source/native/nf-interpreter/README.md b/source/native/nf-interpreter/README.md
new file mode 100644
index 00000000..a7ee1155
--- /dev/null
+++ b/source/native/nf-interpreter/README.md
@@ -0,0 +1,103 @@
+[](https://opensource.org/licenses/Apache-2.0) [](https://github.com/nanoframework/Home/blob/master/CONTRIBUTING.md)
+ [](https://discord.gg/gCyBu8T)
+
+
+
+
+-----
+Document Language: [English](README.md) | [中文简体](README.zh-cn.md)
+
+### Welcome to the **nanoFramework** Interpreter repository!
+
+This repo contains:
+
+* **nanoFramework** agnostic blocks
+ * [CLR](src/CLR)
+ * [HAL](src/HAL)
+ * [PAL](src/PAL)
+* Target reference for CMSIS OS
+ * [ChibiOS](targets/CMSIS-OS/ChibiOS)
+ * Reference target boards
+ * [Mikrobus QUAIL](targets/CMSIS-OS/ChibiOS/MBN_QUAIL)
+ * [ST NUCLEO64 F091RC](targets/CMSIS-OS/ChibiOS/ST_NUCLEO64_F091RC)
+ * [ST STM32F429I DISCOVERY](targets/CMSIS-OS/ChibiOS/ST_STM32F429I_DISCOVERY)
+ * [ST STM32F769I DISCOVERY](targets/CMSIS-OS/ChibiOS/ST_STM32F769I_DISCOVERY)
+ * [Wilderness Labs Netduino3 WiFi](targets/CMSIS-OS/ChibiOS/NETDIUNO3_WIFI)
+ * ChibiOS overlay for **nanoFramework**
+ * [STM32 1.Wire driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_onewire)
+ * [STM32 CRC32 driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_crc)
+ * [STM32 Flash driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_flash)
+ * [STM32 Flexible Memory Controller driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_fsmc)
+ * [STM32 Random number generator driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_rng)
+* Target reference for FreeRTOS
+ * [ESP32_WROOM_32](targets/FreeRTOS_ESP32/ESP32_WROOM_32)
+* Target references for TI SimpleLink
+ * [TI CC3220SF_LAUNCHXL](targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL)
+* Target reference for other OSes
+ * [Win32 OS (test project only at this time)](targets/os/win32)
+* [CMake files for the build system](CMake)
+
+
+## Build status
+
+| Component | Build Status | Build Status (develop) |
+|:-|---|---|
+| nanoBooter + nanoCLR | [](https://dev.azure.com/nanoframework/nf-interpreter/_build/latest?definitionId=34?branchName=master) | [](https://dev.azure.com/nanoframework/nf-interpreter/_build/latest?definitionId=34?branchName=develop) |
+| Win32 test project | [](https://dev.azure.com/nanoframework/nf-interpreter/_build/latest?definitionId=34?branchName=master) | [](https://dev.azure.com/nanoframework/nf-interpreter/_build/latest?definitionId=34?branchName=develop) |
+
+
+## Firmware for reference boards
+
+
+Each of the following ZIP files contains the image files for nanoBooter and nanoCLR in various formats (HEX, BIN and DFU). They should be flashed in the target boards using an appropriate software utility.
+
+The **stable** versions are RTM builds with the smallest possible size. They include the latest stable version. The debugging feature is disabled and only minimal (or none) error messages.
+
+The **preview** versions are continuous builds of the reference targets. They include the latest version of all features and bug corrections. They also have the debugging feature enabled along with detailed error messages.
+
+
+| Target | Stable | Preview |
+|:-|---|---|
+| ST_STM32F429I_DISCOVERY | [  ](https://bintray.com/nfbot/nanoframework-images/ST_STM32F429I_DISCOVERY/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/ST_STM32F429I_DISCOVERY/_latestVersion) |
+| ST_NUCLEO64_F091RC | [  ](https://bintray.com/nfbot/nanoframework-images/ST_NUCLEO64_F091RC/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/ST_NUCLEO64_F091RC/_latestVersion) |
+| ST_STM32F769I_DISCOVERY | [  ](https://bintray.com/nfbot/nanoframework-images/ST_STM32F769I_DISCOVERY/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/ST_STM32F769I_DISCOVERY/_latestVersion) |
+| MBN_QUAIL | [  ](https://bintray.com/nfbot/nanoframework-images/MBN_QUAIL/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/MBN_QUAIL/_latestVersion) |
+| NETDUINO3_WIFI | [  ](https://bintray.com/nfbot/nanoframework-images/NETDUINO3_WIFI/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/NETDUINO3_WIFI/_latestVersion) |
+| ESP32_WROOM_32 | [  ](https://bintray.com/nfbot/nanoframework-images/ESP32_WROOM_32/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/ESP32_WROOM_32/_latestVersion) |
+| TI_CC3220SF_LAUNCHXL | [  ](https://bintray.com/nfbot/nanoframework-images/TI_CC3220SF_LAUNCHXL/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/TI_CC3220SF_LAUNCHXL/_latestVersion) |
+
+
+The above firmware builds include support for the class libraries and features marked below.
+
+
+| Target | Gpio | Spi | I2c | Pwm | Adc | Dac | Serial | OneWire | Events | SWO | Networking | Large Heap |
+|:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |
+| ST_STM32F429I_DISCOVERY | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: |
+| ST_NUCLEO64_F091RC | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
+| ST_STM32F769I_DISCOVERY | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
+| MBN_QUAIL | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | |
+| NETDUINO3_WIFI | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | |
+| ESP32_WROOM_32 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | |
+| TI_CC3220SF_LAUNCHXL | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | | :heavy_check_mark: | | :heavy_check_mark: | |
+
+
+## Feedback and documentation
+
+For documentation, providing feedback, issues and finding out how to contribute please refer to the [Home repo](https://github.com/nanoframework/Home).
+
+Join our Discord community [here](https://discord.gg/gCyBu8T).
+
+
+## Credits
+
+The list of contributors to this project can be found at [CONTRIBUTORS](https://github.com/nanoframework/Home/blob/master/CONTRIBUTORS.md).
+
+
+## License
+
+The nanoFramework Interpreter is licensed under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0).
+
+
+## Code of Conduct
+This project has adopted the code of conduct defined by the [Contributor Covenant](CODE_OF_CONDUCT.md)
+to clarify expected behavior in our community.
diff --git a/source/native/nf-interpreter/README.zh-cn.md b/source/native/nf-interpreter/README.zh-cn.md
new file mode 100644
index 00000000..7cdd04f7
--- /dev/null
+++ b/source/native/nf-interpreter/README.zh-cn.md
@@ -0,0 +1,101 @@
+[](https://opensource.org/licenses/Apache-2.0) [](https://github.com/nanoframework/Home/blob/master/CONTRIBUTING.md)
+ [](https://discord.gg/gCyBu8T)
+
+
+
+
+-----
+文档语言: [English](README.md) | [中文简体](README.zh-cn.md)
+
+### 欢迎使用 **nanoFramework** 解析器!
+
+本库包括:
+
+* **nanoFramework** 核心板块
+ * [CLR](src/CLR)
+ * [HAL](src/HAL)
+ * [PAL](src/PAL)
+* CMSIS OS 移植
+ * [ChibiOS](targets/CMSIS-OS/ChibiOS)
+ * 板卡移植
+ * [Mikrobus QUAIL](targets/CMSIS-OS/ChibiOS/MBN_QUAIL)
+ * [ST NUCLEO64 F091RC](targets/CMSIS-OS/ChibiOS/ST_NUCLEO64_F091RC)
+ * [ST STM32F429I DISCOVERY](targets/CMSIS-OS/ChibiOS/ST_STM32F429I_DISCOVERY)
+ * [ST STM32F769I DISCOVERY](targets/CMSIS-OS/ChibiOS/ST_STM32F769I_DISCOVERY)
+ * [Wilderness Labs Netduino3 WiFi](targets/CMSIS-OS/ChibiOS/NETDIUNO3_WIFI)
+ * ChibiOS 增强 **nanoFramework**
+ * [STM32 1.Wire driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_onewire)
+ * [STM32 CRC32 driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_crc)
+ * [STM32 Flash driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_flash)
+ * [STM32 Flexible Memory Controller driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_fsmc)
+ * [STM32 Random number generator driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_rng)
+* FreeRTOS 移植
+ * [ESP32_WROOM_32](targets/FreeRTOS_ESP32/ESP32_WROOM_32)
+* TI SimpleLink 移植
+ * [TI CC3220SF_LAUNCHXL](targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL)
+* 其它系统移植
+ * [Win32 OS (test project only at this time)](targets/os/win32)
+* [CMake 编译文件](CMake)
+
+
+## 编译状态
+
+| 组件 | 编译状态 | 编译状态(开发) |
+|:-|---|---|
+| nanoBooter + nanoCLR | [](https://dev.azure.com/nanoframework/nf-interpreter/_build/latest?definitionId=34?branchName=master) | [](https://dev.azure.com/nanoframework/nf-interpreter/_build/latest?definitionId=34?branchName=develop) |
+| Win32 test project | [](https://dev.azure.com/nanoframework/nf-interpreter/_build/latest?definitionId=34?branchName=master) | [](https://dev.azure.com/nanoframework/nf-interpreter/_build/latest?definitionId=34?branchName=develop) |
+
+
+## 评估板固件
+
+
+以下每个ZIP文件包括了nanoBooter和nanoCLR镜像(HEX,BIN,DFU)。可以使用相应烧写工具把它们写入目标板卡中。
+
+**稳定** 版是RTM最小大小编译。它包含了最后稳定版本,关闭调试功能,仅有最少或没有错误信息。
+**预览** 版是目标板持续编译。它包含所有功能和错误修正的最后版本,也包括调试信息和详细错误信息。
+
+
+| 目标 | 稳定 | 预览 |
+|:-|---|---|
+| ST_STM32F429I_DISCOVERY | [  ](https://bintray.com/nfbot/nanoframework-images/ST_STM32F429I_DISCOVERY/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/ST_STM32F429I_DISCOVERY/_latestVersion) |
+| ST_NUCLEO64_F091RC | [  ](https://bintray.com/nfbot/nanoframework-images/ST_NUCLEO64_F091RC/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/ST_NUCLEO64_F091RC/_latestVersion) |
+| ST_STM32F769I_DISCOVERY | [  ](https://bintray.com/nfbot/nanoframework-images/ST_STM32F769I_DISCOVERY/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/ST_STM32F769I_DISCOVERY/_latestVersion) |
+| MBN_QUAIL | [  ](https://bintray.com/nfbot/nanoframework-images/MBN_QUAIL/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/MBN_QUAIL/_latestVersion) |
+| NETDUINO3_WIFI | [  ](https://bintray.com/nfbot/nanoframework-images/NETDUINO3_WIFI/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/NETDUINO3_WIFI/_latestVersion) |
+| ESP32_WROOM_32 | [  ](https://bintray.com/nfbot/nanoframework-images/ESP32_WROOM_32/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/ESP32_WROOM_32/_latestVersion) |
+| TI_CC3220SF_LAUNCHXL | [  ](https://bintray.com/nfbot/nanoframework-images/TI_CC3220SF_LAUNCHXL/_latestVersion) | [  ](https://bintray.com/nfbot/nanoframework-images-dev/TI_CC3220SF_LAUNCHXL/_latestVersion) |
+
+
+以上固件支持以下类库和功能。
+
+
+| Target | Gpio | Spi | I2c | Pwm | Adc | Dac | Serial | OneWire | Events | SWO | Networking | Large Heap |
+|:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |:-: |
+| ST_STM32F429I_DISCOVERY | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: |
+| ST_NUCLEO64_F091RC | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
+| ST_STM32F769I_DISCOVERY | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
+| MBN_QUAIL | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | |
+| NETDUINO3_WIFI | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | |
+| ESP32_WROOM_32 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | |
+| TI_CC3220SF_LAUNCHXL | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | | :heavy_check_mark: | | :heavy_check_mark: | |
+
+
+## 文档反馈
+
+有关文档、提供反馈、问题以及如何做出贡献的信息,请参阅 [Home repo](https://github.com/nanoframework/Home).
+
+加入我们的讨论社区 [here](https://discord.gg/gCyBu8T).
+
+
+## Credits
+
+本项目贡献者可在 [CONTRIBUTORS](https://github.com/nanoframework/Home/blob/master/CONTRIBUTORS.md) 中找到。
+
+
+## 授权
+
+nanoFramework 解析器基于 [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0) 授权。
+
+
+## 行为准则
+本项目采用了 [Contributor Covenant](CODE_OF_CONDUCT.md) 规范来阐明社区预期行为。
diff --git a/source/native/nf-interpreter/RunCmd.bat b/source/native/nf-interpreter/RunCmd.bat
new file mode 100644
index 00000000..d998f942
--- /dev/null
+++ b/source/native/nf-interpreter/RunCmd.bat
@@ -0,0 +1,26 @@
+ @echo off
+ REM Call with first parameter as timeout, number of seconds to delay after command finishes
+ REM Rest of parameters are the command to run and arguments to be passed to it
+ REM If timeout = 0, always wait for user input. timeout < 0, wait for user only if error
+ setlocal
+ set errwait=0
+ set dly=%1
+ if %1 lss 0 set errwait=1 & set /A dly=0-%1
+ set _tail=%*
+ call set _tail=%%_tail:*%1=%%
+ %_tail%
+ if %ERRORLEVEL% neq 0 goto :cmderror
+ if %dly% equ 0 goto :waitforuser
+
+:tick
+ timeout %dly%
+ exit 0
+
+:cmderror
+ Echo "Error %ERRORLEVEL% processing command"
+ if %errwait% equ 0 goto :tick
+:waitforuser
+ pause
+ exit 0
+
+
diff --git a/source/native/nf-interpreter/SetNFRoot.bat b/source/native/nf-interpreter/SetNFRoot.bat
new file mode 100644
index 00000000..91118ad5
--- /dev/null
+++ b/source/native/nf-interpreter/SetNFRoot.bat
@@ -0,0 +1,132 @@
+@echo off
+REM SetNFRoot - Find/Create and return short path for current directory
+REM DAV 01APR19
+setlocal
+
+if %1.==. goto :set_path
+
+:check_opts
+if /I %1==-h goto :help
+if /I %1==-d set rmsubst=-d
+
+:set_path
+set _mypath=%~dp0
+call :setshortpath %_mypath%
+rem pushd %shortpath%
+if [%rmsubst%]==[-d] goto :remsubst
+goto :end
+
+:remsubst
+set v=%shortpath:~0,2%
+echo Remove subst of %mypath% on %v%
+if [%rmsubst%]==[-d] subst /D %v%
+endlocal & set "nfRoot=%_mypath%"
+setx nfRoot %nfRoot% >nul
+echo %nfRoot%
+goto :eof
+
+:end
+:: Clear %errorlevel%
+call set _a=a > nul
+endlocal & set "nfRoot=%shortpath%"
+setx nfRoot %nfRoot% >nul
+echo %nfRoot%
+rem popd
+::exit
+goto :eof
+
+:: ============ Utility commands =====
+
+:: === Help
+:help
+echo:
+echo Usage: %0 [opt]
+echo:
+echo opt = -d Delete subst if exists
+echo opt = -h Display this help message
+echo:
+echo Command line tool to find or create a short directory path
+echo for the current directory using the subst command
+echo:
+goto :eof
+
+REM ==========================================================
+REM Utility Functions
+REM
+REM Call to set a short path to try avoid overflowing 250 char file path limit
+:setshortpath
+set "mypath=%~1"
+set shortpath=%mypath%
+rem echo mypath = %_mypath%
+
+REM Are we already on short path?
+set t=%mypath:~0,3%
+if /I %t%==%mypath% goto :haveshortpath
+
+REM Not on short path - is there already a subst for it?
+FOR /F "tokens=1,3" %%G IN ('subst') DO (
+ if /I "%%H\"=="%mypath%" (
+ set sdg=%%G
+ goto :foundsubst
+ )
+)
+REM No subst short path found - create one
+call :freedrive driveletter && goto :cont
+echo ERROR: No free drive letter found, staying on original path
+goto :haveshortpath
+
+:cont
+echo Found free drive letter: %driveletter% 1>&2
+pushd %mypath%
+subst %driveletter% .
+popd
+set shortpath=%driveletter%\
+echo Created new subst for %mypath% on %driveletter% 1>&2
+echo You can remove it with subst %driveletter% /D 1>&2
+goto :haveshortpath
+
+:foundsubst
+set shortpath=%sdg:~0,3%
+echo Using existing subst for %mypath% on %shortpath% 1>&2
+goto :haveshortpath
+
+:haveshortpath
+echo Using short path %shortpath% for %mypath% 1>&2
+REM So now we have a short path if it was possible
+goto :eof
+
+rem Finds a free drive letter.
+rem
+rem Parameters:
+rem %1 = Output variable name.
+rem
+rem Example:
+rem call :freedrive mydriveletter && goto :cont
+rem echo ERROR: No free drive letter found.
+rem goto :EOF
+rem :cont
+rem echo Found drive letter: %mydriveletter%
+:freedrive
+setlocal EnableDelayedExpansion
+set exitcode=0
+set "output_var=%~1"
+for %%i in (B,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) do (
+ set "drive=%%i:"
+ rem If 'subst' fails, the drive letter is already in use.
+ rem This way we can even detect optical drives that have a drive
+ rem letter but no media in them, a case that goes undetected when
+ rem using 'if exist'.
+ subst !drive! %SystemDrive%\ >nul
+ if !errorlevel! == 0 (
+ subst !drive! /d >nul
+ goto :freedrive0
+ )
+)
+set exitcode=1
+set drive=
+:freedrive0
+endlocal & set "%output_var%=%drive%" & exit /b %exitcode%
+
+:exit
+
+:eof
diff --git a/source/native/nf-interpreter/VisualStudioDevelopment/CopyBuildOutput.cmd b/source/native/nf-interpreter/VisualStudioDevelopment/CopyBuildOutput.cmd
new file mode 100644
index 00000000..4579ec18
--- /dev/null
+++ b/source/native/nf-interpreter/VisualStudioDevelopment/CopyBuildOutput.cmd
@@ -0,0 +1,19 @@
+Rem --------------------------------------------------------------------------------
+Rem -- Open a command prompt at your build target root to run the following commands
+Rem -- For example
+Rem -- Open a command prompt at "Build\"
+Rem --------------------------------------------------------------------------------
+
+copy nanobooter.elf ..\nanobooter.elf
+"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Linux/gcc_arm/bin/arm-none-eabi-objcopy.exe" -Oihex nanobooter.elf ..\nanobooter.hex
+"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Linux/gcc_arm/bin/arm-none-eabi-objcopy.exe" -Osrec nanobooter.elf ..\nanobooter.s19
+"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Linux/gcc_arm/bin/arm-none-eabi-objcopy.exe" -Obinary nanobooter.elf ..\nanobooter.bin
+"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Linux/gcc_arm/bin/arm-none-eabi-objdump.exe" -d -EL -S nanobooter.elf > ..\nanobooter.lst
+"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Linux/gcc_arm/bin/arm-none-eabi-size.exe" nanobooter.elf > ..\nanobooter.size.txt
+
+copy nanoCLR.elf ..\nanoCLR.elf
+"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Linux/gcc_arm/bin/arm-none-eabi-objcopy.exe" -Oihex nanoCLR.elf ..\nanoCLR.hex
+"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Linux/gcc_arm/bin/arm-none-eabi-objcopy.exe" -Osrec nanoCLR.elf ..\nanoCLR.s19
+"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Linux/gcc_arm/bin/arm-none-eabi-objcopy.exe" -Obinary nanoCLR.elf ..\nanoCLR.bin
+"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Linux/gcc_arm/bin/arm-none-eabi-objdump.exe" -d -EL -S nanoCLR.elf > ..\nanoCLR.lst
+"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Linux/gcc_arm/bin/arm-none-eabi-size.exe" nanoCLR.elf > ..\nanoCLR.size.txt
diff --git a/source/native/nf-interpreter/VisualStudioDevelopment/README.md b/source/native/nf-interpreter/VisualStudioDevelopment/README.md
new file mode 100644
index 00000000..b391c601
--- /dev/null
+++ b/source/native/nf-interpreter/VisualStudioDevelopment/README.md
@@ -0,0 +1,138 @@
+### Developing firmware for the nanoframework using Visual Studio 2017 community edition
+
+##### 🚧 IMPORTANT : The firmware build for Visual Studio is under construction. 🚧
+Some compromises were required to get this to a working stage.
+I made a decision to put the code at the top level to reduce path length of files which caused warnings of the potential to overflow the command line.
+>Hard coded paths are used to ensure it works with the current CMake coding and the Microsoft usage of CMake
+>There are some issues with the CMakeSettings.json file with path separators.
+
+