Skip to content

Commit 9a79312

Browse files
authored
User/rywinter/toolchain update (#143)
* update get-toolchain to be more resilient * remove ninja from installation, as its now in the repository * fix wifi configuration for mxchip
1 parent 7b094d4 commit 9a79312

File tree

11 files changed

+87
-95
lines changed

11 files changed

+87
-95
lines changed

MXChip/AZ3166/readme.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,12 @@ The cloned repo contains a setup script that installs and configures the require
5555
> Note: The setup script installs the following tools:
5656
> * [GCC](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm): Compile
5757
> * [CMake](https://cmake.org): Build
58-
> * [Ninja](https://ninja-build.org): Build
5958
> * [Termite](https://www.compuphase.com/software_termite.htm): Monitor COM port output for connected devices
6059
> * [Azure IoT Explorer](https://github.com/Azure/azure-iot-explorer/releases): Cross-platform utility to monitor and manage Azure IoT resources
6160
6261
To run the setup script:
6362

64-
1. Open a console app with administrator privileges, go to the following path in the repo, and run the setup script named *get-toolchain.bat*. If you use File Explorer, right-click the file and select **Run As Administrator**.
63+
1. From File Explorer, navigate to the following path in the repo and run the setup script named *get-toolchain.bat*:
6564

6665
> *getting-started\tools\get-toolchain.bat*
6766
@@ -155,22 +154,13 @@ To connect the MXChip DevKit to Azure, you'll modify a configuration file for Wi
155154
156155
### Add configuration
157156
158-
1. In VSCode or any other text editor, edit the file `getting-started/MXChip/AZ3166/app/azure_config.h` to set the Wi-Fi constants to the following values from your local environment.
157+
1. In a text editor, edit the file *getting-started\MXChip\AZ3166\app\azure_config.h* to set the Wi-Fi constants to the following values from your local environment.
159158
160159
|Constant name|Value|
161160
|-------------|-----|
162161
|`WIFI_SSID` |{*Your Wi-Fi ssid*}|
163162
|`WIFI_PASSWORD` |{*Your Wi-Fi password*}|
164-
|`WIFI_SECURITY` |{*Your Wi-Fi security type*}|
165-
166-
For the value of the `WIFI_SECURITY` constant, you can use one of the most common Wi-Fi modes from the following list, or check the file */MXChip/AZ3166/lib/wiced_sdk/43xxx_Wi-Fi/wwd_constants.h* for a complete list of Wi-Fi mode values.
167-
168-
|Wi-Fi security mode|Value to assign to the `WIFI_SECURITY` constant|
169-
|-------------|-----|
170-
|None |`WICED_SECURITY_OPEN`|
171-
|WEP |`WICED_SECURITY_WEP_PSK`|
172-
|WPA2_PSK_AES |`WICED_SECURITY_WPA2_AES_PSK`|
173-
|WPA2_PSK_TKIP |`WICED_SECURITY_WPA2_MIXED_PSK`|
163+
|`WIFI_MODE` |{*Your Wi-Fi security type*}|
174164
175165
1. Edit the same file to set the Azure IoT device information constants to the values that you saved after you created Azure resources.
176166
@@ -188,7 +178,7 @@ In your console or in File Explorer, run the script *rebuild.bat* at the followi
188178
189179
After the build completes, confirm that the binary files were created in the following path:
190180
191-
> *getting-started/MXChip/AZ3166/build/app/mxchip_azure_iot.bin*
181+
> *getting-started\MXChip/AZ3166\build\app\mxchip_azure_iot.bin*
192182
193183
### Flash the image
194184

Microchip/ATSAME54-XPRO/readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ The cloned repo contains a setup script that installs and configures the first s
5959
6060
> * [GCC](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm): Compile
6161
> * [CMake](https://cmake.org): Build
62-
> * [Ninja](https://ninja-build.org): Build
6362
> * [Termite](https://www.compuphase.com/software_termite.htm): Monitor
6463
> * [Azure IoT Explorer](https://github.com/Azure/azure-iot-explorer/releases): Cross-platform utility to monitor and manage Azure IoT resources
6564
6665
To run the setup script:
6766

68-
1. Open a console app with administrator privileges, go to the following path in the repo, and run the setup script named *get-toolchain.bat*. If you use File Explorer, right-click the file and select **Run As Administrator**.
67+
1. From File Explorer, navigate to the following path in the repo and run the setup script named *get-toolchain.bat*:
6968

7069
> *getting-started\tools\get-toolchain.bat*
7170

NXP/MIMXRT1060-EVK/readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ The cloned repo contains a setup script that installs and configures the first s
5757
5858
> * [GCC](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm): Compile
5959
> * [CMake](https://cmake.org): Build
60-
> * [Ninja](https://ninja-build.org): Build
6160
> * [Termite](https://www.compuphase.com/software_termite.htm): Monitor
6261
> * [Azure IoT Explorer](https://github.com/Azure/azure-iot-explorer/releases): Cross-platform utility to monitor and manage Azure IoT resources
6362
6463
To install the tools:
6564

66-
1. Open a console app with administrator privileges, go to the following path in the repo, and run the setup script named *get-toolchain.bat*. If you use File Explorer, right-click the file and select **Run As Administrator**.
65+
1. From File Explorer, navigate to the following path in the repo and run the setup script named *get-toolchain.bat*:
6766

6867
> *getting-started\tools\get-toolchain.bat*
6968

STMicroelectronics/STM32L4_L4+/readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ The cloned repo contains a setup script that installs and configures the require
5757
> Note: The setup script installs the following tools:
5858
> * [GCC](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm): Compile
5959
> * [CMake](https://cmake.org): Build
60-
> * [Ninja](https://ninja-build.org): Build
6160
> * [Termite](https://www.compuphase.com/software_termite.htm): Monitor COM port output for connected devices
6261
> * [Azure IoT Explorer](https://github.com/Azure/azure-iot-explorer/releases): Cross-platform utility to monitor and manage Azure IoT resources
6362
6463
To run the setup script:
6564

66-
1. Open a console app with administrator privileges, go to the following path in the repo, and run the setup script named *get-toolchain.bat*. If you use File Explorer, right-click the file and select **Run As Administrator**.
65+
1. From File Explorer, navigate to the following path in the repo and run the setup script named *get-toolchain.bat*:
6766

6867
> *getting-started\tools\get-toolchain.bat*
6968

cmake/arm-gcc-cortex-m4.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ set(VFP_FLAGS "-mfloat-abi=hard -mfpu=fpv4-sp-d16")
66
set(LD_FLAGS "")
77
set(SPECS_FLAGS "--specs=nano.specs -u _printf_float")
88

9-
include(${CMAKE_CURRENT_LIST_DIR}/arm-gcc-toolchain.cmake)
9+
include(${CMAKE_CURRENT_LIST_DIR}/arm-gcc-cortex-toolchain.cmake)

cmake/arm-gcc-cortex-m7.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ set(VFP_FLAGS "-mfloat-abi=hard -mfpu=fpv5-sp-d16")
66
set(LD_FLAGS "")
77
set(SPECS_FLAGS "--specs=nano.specs -u _printf_float")
88

9-
include(${CMAKE_CURRENT_LIST_DIR}/arm-gcc-toolchain.cmake)
9+
include(${CMAKE_CURRENT_LIST_DIR}/arm-gcc-cortex-toolchain.cmake)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ set(TARGET_TRIPLET "arm-none-eabi-")
88
# do some windows specific logic
99
if(WIN32)
1010
set(TOOLCHAIN_EXT ".exe")
11+
12+
# use the repo version of ninja on Windows as there is no Ninja installer
13+
set(CMAKE_MAKE_PROGRAM ${CMAKE_CURRENT_LIST_DIR}/ninja CACHE STRING "Ninja location")
14+
15+
# locate if the arm gcc compiler is installed via visual studio
1116
execute_process(
1217
COMMAND ${CMAKE_CURRENT_LIST_DIR}/vswhere.exe -latest -requires Component.MDD.Linux.GCC.arm -find **/gcc_arm/bin
1318
OUTPUT_VARIABLE VSWHERE_PATH
@@ -78,3 +83,5 @@ set(CMAKE_C_FLAGS_RELEASE "-O3")
7883
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
7984
set(CMAKE_ASM_FLAGS_RELEASE "")
8085
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-flto")
86+
87+

cmake/ninja.exe

527 KB
Binary file not shown.

tools/get-toolchain.bat

Lines changed: 2 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -3,77 +3,6 @@
33

44
@echo off
55

6-
echo Installing prerequisites. Please leave the window open until the installation completes.
6+
PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dpn0.ps1""' -Verb RunAs}"
77

8-
net session >nul 2>&1
9-
if NOT %errorLevel% == 0 (
10-
echo.
11-
echo Error: Unable to install, please execute bat file with Administrator privilages.
12-
echo.
13-
goto finish
14-
)
15-
16-
echo.
17-
18-
set cmake_path=https://github.com/Kitware/CMake/releases/download/v3.18.2
19-
set cmake_file=cmake-3.18.2-win32-x86.msi
20-
set cmake_name=CMake v3.18.2
21-
22-
set gccarm_path=https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4
23-
set gccarm_file=gcc-arm-none-eabi-9-2019-q4-major-win32-sha2.exe
24-
set gccarm_name=GCC-ARM 9-2019q4-major
25-
26-
set ninja_path=https://github.com/ninja-build/ninja/releases/download/v1.10.1
27-
set ninja_file=ninja-win.zip
28-
set ninja_name=Ninja v1.10.1
29-
30-
set termite_path=https://www.compuphase.com/software
31-
set termite_file=termite-3.4.exe
32-
set termite_name=Termite v3.4
33-
34-
set iot_explorer_path=https://github.com/Azure/azure-iot-explorer/releases/download/v0.11.4
35-
set iot_explorer_file=Azure.IoT.Explorer.preview.0.11.4.msi
36-
set iot_explorer_name=Azure IoT Explorer v0.11.4
37-
38-
echo Downloading packages...
39-
echo (1/5) %cmake_name%
40-
powershell (New-Object System.Net.WebClient).DownloadFile('%cmake_path%/%cmake_file%', '%TEMP%\%cmake_file%')
41-
42-
echo (2/5) %gccarm_name%
43-
powershell (New-Object System.Net.WebClient).DownloadFile('%gccarm_path%/%gccarm_file%', '%TEMP%\%gccarm_file%')
44-
45-
echo (3/5) %ninja_name%
46-
powershell (New-Object System.Net.WebClient).DownloadFile('%ninja_path%/%ninja_file%', '%TEMP%\%ninja_file%')
47-
48-
echo (4/5) %termite_name%
49-
powershell (New-Object System.Net.WebClient).DownloadFile('%termite_path%/%termite_file%', '%TEMP%\%termite_file%')
50-
51-
echo (5/5) %iot_explorer_name%
52-
powershell (New-Object System.Net.WebClient).DownloadFile('%iot_explorer_path%/%iot_explorer_file%', '%TEMP%\%iot_explorer_file%')
53-
54-
echo.
55-
56-
echo Installing packages...
57-
echo (1/5) %cmake_name%
58-
"%TEMP%\%cmake_file%" ADD_CMAKE_TO_PATH=System /passive
59-
60-
echo (2/5) %gccarm_name%
61-
"%TEMP%\%gccarm_file%" /S /P /R
62-
63-
echo (3/5) %ninja_name%
64-
if not exist "%ProgramFiles(x86)%\ninja" mkdir "%ProgramFiles(x86)%\ninja"
65-
"%~dp0\pathman.exe" /as "%ProgramFiles(x86)%\ninja"
66-
powershell Microsoft.PowerShell.Archive\Expand-Archive -Force -Path '%TEMP%\%ninja_file%' -DestinationPath '%ProgramFiles(x86)%\ninja'
67-
68-
echo (4/5) %termite_name%
69-
"%TEMP%\%termite_file%" /S
70-
71-
echo (5/5) %iot_explorer_name%
72-
"%TEMP%\%iot_explorer_file%" /passive
73-
74-
echo.
75-
echo Installation complete! Successfully installed CMake, GCC-ARM, Ninja, Termite and Azure IoT Explorer.
76-
echo.
77-
78-
:finish
79-
pause
8+
::pause

tools/get-toolchain.ps1

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
echo "`nInstalling prerequisites. Please leave the window open until the installation completes."
5+
6+
$cmake_path = 'https://github.com/Kitware/CMake/releases/download/v3.18.3'
7+
$cmake_file = 'cmake-3.18.3-win32-x86.msi'
8+
$cmake_name = 'CMake v3.18.3'
9+
$cmake_hash = 'F39D53371F5330F0C18C544A78F9654B9F799050B157783BD9E0E20F28F27821'
10+
11+
$gccarm_path = 'https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4'
12+
$gccarm_file = 'gcc-arm-none-eabi-9-2019-q4-major-win32-sha2.exe'
13+
$gccarm_name = 'GCC-ARM 9-2019q4-major'
14+
$gccarm_hash = '3580550590B3D2C0998DCF01673EBAD7D9DFD4F6F0436F86CF2C507539C62450'
15+
16+
$termite_path = 'https://www.compuphase.com/software'
17+
$termite_file = 'termite-3.4.exe'
18+
$termite_name = 'Termite v3.4'
19+
$termite_hash = 'CA440B6C7F6EAA812BA5F8BF42AED86E02022CA50A1C72585168C9B671D0FE19'
20+
21+
$iot_explorer_path = 'https://github.com/Azure/azure-iot-explorer/releases/download/v0.11.4'
22+
$iot_explorer_file = 'Azure.IoT.Explorer.preview.0.11.4.msi'
23+
$iot_explorer_name = 'Azure IoT Explorer v0.11.4'
24+
$iot_explorer_hash = '8CAA36336C1C4C55C70D868904639263F56D5D20CB59DC0A18F6817DC0AEC900'
25+
26+
echo "`nDownloading packages..."
27+
28+
echo "(1/4) $cmake_name"
29+
if ( -not (Test-Path "$env:TEMP\$cmake_file") -Or ((Get-FileHash "$env:TEMP\$cmake_file").Hash -ne $cmake_hash))
30+
{
31+
(New-Object System.Net.WebClient).DownloadFile("$cmake_path\$cmake_file", "$env:TEMP\$cmake_file")
32+
}
33+
34+
echo "(2/4) $gccarm_name"
35+
if ( -not (Test-Path "$env:TEMP\$gccarm_file") -Or ((Get-FileHash "$env:TEMP\$gccarm_file").Hash -ne $gccarm_hash))
36+
{
37+
(New-Object System.Net.WebClient).DownloadFile("$gccarm_path\$gccarm_file", "$env:TEMP\$gccarm_file")
38+
}
39+
40+
echo "(3/4) $termite_name"
41+
if ( -not (Test-Path "$env:TEMP\$termite_file") -Or ((Get-FileHash "$env:TEMP\$termite_file").Hash -ne $termite_hash))
42+
{
43+
(New-Object System.Net.WebClient).DownloadFile("$termite_path\$termite_file", "$env:TEMP\$termite_file")
44+
}
45+
46+
echo "(4/4) $iot_explorer_name"
47+
if ( -not (Test-Path "$env:TEMP\$iot_explorer_file") -Or ((Get-FileHash "$env:TEMP\$iot_explorer_file").Hash -ne $iot_explorer_hash))
48+
{
49+
(New-Object System.Net.WebClient).DownloadFile("$iot_explorer_path\$iot_explorer_file", "$env:TEMP\$iot_explorer_file")
50+
}
51+
52+
echo "`nInstalling packages..."
53+
54+
echo "(1/4) $cmake_name"
55+
Start-Process -wait -FilePath "$env:TEMP\$cmake_file" -ArgumentList "ADD_CMAKE_TO_PATH=System /passive"
56+
57+
echo "(2/4) $gccarm_name"
58+
Start-Process -wait -FilePath "$env:TEMP\$gccarm_file" -ArgumentList "/S /P /R"
59+
60+
echo "(3/4) $termite_name"
61+
Start-Process -wait -FilePath "$env:TEMP\$termite_file" -ArgumentList "/S"
62+
63+
echo "(4/4) $iot_explorer_name"
64+
Start-Process -wait -FilePath "$env:TEMP\$iot_explorer_file" -ArgumentList "/passive"
65+
66+
echo "`nInstallation complete!"
67+
68+
echo "`nPress any key to continue..."
69+
Read-Host

0 commit comments

Comments
 (0)