MLBEDSW-4228 Building on Windows

Changes to facilitate building on Windows systems.

Signed-off-by: Jonas Ohlsson <jonas.ohlsson@arm.com>
Change-Id: Ib95bd89fe476790333bafccc3f6fa402b6569166
diff --git a/README.md b/README.md
index 5dd5090..046f406 100644
--- a/README.md
+++ b/README.md
@@ -40,6 +40,9 @@
 $ make
 ```
 
+Please see [README_WINDOWS.md](README_WINDOWS.md) for additional information
+regarding building on a Windows system.
+
 ### Testing
 
 Assuming that the Corstone-300 FVP has been downloaded, installed and placed in
@@ -82,7 +85,7 @@
 Title of the commit
 
 Short description of the change.
-   
+
 Signed-off-by: John Doe john.doe@example.org
 Signed-off-by: Foo Bar foo.bar@example.org
 ```
diff --git a/README_WINDOWS.md b/README_WINDOWS.md
new file mode 100644
index 0000000..d453cd9
--- /dev/null
+++ b/README_WINDOWS.md
@@ -0,0 +1,48 @@
+# Building on Windows Systems
+Linux is the main development environment recommended ("Windows Subsystem for
+Linux" can be used for a full Linux Bash environment under Windows), especially
+with regards to building the TensorFlow Lite for Microcontrollers (TFLu)
+library, which depends on GNU Make and are using a number of Bash shell scripts.
+However, there are a number of possibilities for building on a Windows system.
+
+## Requirements
+- **CMake**. E.g. Windows native CMake, MSYS CMake, Cygwin CMake, or MinGW
+  CMake. (Note: Supported generators may differ).
+- **make tool**. E.g. GNU Make, NMAKE, Jom, mingw32-make, GNU Make under MSYS or
+  Cygwin.
+- **ARM toolchain**.
+  [Arm Clang](https://developer.arm.com/tools-and-software/embedded/arm-compiler)
+  or
+  [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm)
+
+### Building with TensorFlow Lite for Microcontrollers
+- **Shell**. E.g. "MSYS shell", "GIT Bash", or "Cygwin Terminal"
+- **GNU Make**. (NOTE: required when building TFLu even if another generator is
+  used in CMake).
+- **GNU Wget**.
+
+### Using a prebuilt TensorFlow Lite for Microcontrollers library
+A prebuilt TFLu library can be supplied via the variable
+ `TFLU_PREBUILT_LIBRARY_PATH`. The project can then be built without the
+requirements under
+[Building with TensorFlow Lite for Microcontrollers](#Building-with-TensorFlow-Lite-for-Microcontrollers)
+(apart from the initially build of the library).
+
+## Troubleshooting
+There are many options for tools and environment to build in, and the behaviour
+in each specific development environment might differ slightly.
+
+* Cross drive locations might not work. If this is the case mount to a usable
+  path in the shell used.
+* There might be issues with NSYS/CMake and some toolchain paths, i.e. 'Program
+  Files (x86)'. Can be solved by mounting in MSYS to a usable path, or the
+  native Windows CMake can be called from the MSYS shell.
+* GNU Wget is needed for downloads in TFLu.
+* There might be issues rebuilding with CMake 3.20, with erroneous dependency
+  make files generated. Update to CMake 3.20.1, or downgrade to an earlier CMake
+  version.
+* May need to unset TMPDIR environmental variable to get FlatBuffers download in
+  TFLu to work.
+* When using Cygwin Terminal there might be error messages concerning '\r' in
+  the TFLu Bash scripts. In this case run dos2unix on these scripts.
+
diff --git a/targets/corstone-300/CMakeLists.txt b/targets/corstone-300/CMakeLists.txt
index a9e69ec..4e766df 100644
--- a/targets/corstone-300/CMakeLists.txt
+++ b/targets/corstone-300/CMakeLists.txt
@@ -26,7 +26,7 @@
     set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/toolchain/armclang.cmake")
 endif()
 
-set(ETHOSU_COMMAND_DEFAULT ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/run_ctest.py -t corstone-300)
+set(ETHOSU_COMMAND_DEFAULT python3 ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/run_ctest.py -t corstone-300)
 
 option(CPU_CACHE_ENABLE "Enable CPU instruction- and data cache" ON)
 
@@ -34,6 +34,8 @@
 # Project
 #############################################################################
 
+# Note: On Windows systems CMake 3.20.0 might cause issues with errouneous dependency make files.
+#       Issues solved with CMake 3.20.1.
 cmake_minimum_required(VERSION 3.15.6)
 
 project(ethos-u-corstone-300 VERSION 0.0.1)