cancel
Showing results for 
Search instead for 
Did you mean: 

ModusToolbox Blog

srnu_276571
Contributor

Improving mbed Build Times Using ModusToolbox 1.1 and mbed-cli on Windows 10

On Windows 10, mbed build times are greatly affected by Windows Defender scan. To speed up the builds, follow the steps below. The steps basically add process and folder exclusions to Windows Defender.

  • Open Windows PowerShell:
    • Click Start
    • Type in PowerShell
    • Right Click Windows PowerShell in the search results and then click Run as Administrator
    • Run the following commands depending upon the toolchain that you are using

Add-MpPreference -ExclusionPath "C:\mbed-cli\" <-- replace with your mbed cli folder path

Add-MpPreference -ExclusionPath "D:\mbed\" <--  replace with your mbed working folder path

Add-MpPreference -ExclusionProcess "cmd.exe"

Add-MpPreference -ExclusionProcess "make.exe"

Add-MpPreference -ExclusionProcess "python.exe”

Add-MpPreference -ExclusionProcess "cc1.exe”

Add-MpPreference -ExclusionProcess "cc1plus.exe”

Add-MpPreference -ExclusionProcess "mbed.exe”

Add-MpPreference -ExclusionProcess "sh.exe”

Add-MpPreference -ExclusionProcess "as.exe”

Using GCC ARM ToolChain

Add-MpPreference -ExclusionPath "C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin\" <-- change this to your GCC installation path

Add-MpPreference -ExclusionProcess "arm-none-eabi-gcc.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-cpp.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-g++.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-objcopy.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-as.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-ar.exe"

Using GCC ARM ToolChain Provided with ModusToolbox

Add-MpPreference -ExclusionPath "C:\Users\snvn\ModusToolbox_1.1\tools\gcc-7.2.1-1.0\bin\" <-- change this to your ModusToolbox installation path

Add-MpPreference -ExclusionProcess "ModusToolbox.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-gcc.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-cpp.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-g++.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-objcopy.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-as.exe"

Add-MpPreference -ExclusionProcess "arm-none-eabi-ar.exe"

Using IAR ToolChain

Add-MpPreference -ExclusionPath "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.8\arm" <-- change this to your IAR installation path

Add-MpPreference -ExclusionProcess "iccarm.exe”

Add-MpPreference -ExclusionProcess "iasmarm.exe”

Add-MpPreference -ExclusionProcess "ilinkarm.exe”

Using ARMCC ToolChain

Add-MpPreference -ExclusionPath "C:\Keil_v5\ARM" <-- change this to your ARMCC installation path

Add-MpPreference -ExclusionProcess "armar.exe”

Add-MpPreference -ExclusionProcess "armasm.exe”

Add-MpPreference -ExclusionProcess "armcc.exe”

Add-MpPreference -ExclusionProcess "armlink.exe”

  • By default, mbed cli uses parallel builds, that’s why you will notice that a simple mbed compile command spawns a lot of processes. That feature is not enabled by default in ModusToolbox 1.1 for mbed imports. Please follow the page below to enable it for each project. Set it to an optimal number as suggested by the IDE.

How do I enable parallel builds within Eclipse?

  • Further, Eclipse/ModusToolbox 1.1, by default, tries to refresh the workspace and index the files as the build progresses. This will slow down your machine. Follow the page below to stop that from happening:

Eclipse stop background refresh

  • If your mbed working folder is inside your corporate OneDrive sync folder, pause the OneDrive sync. The sync process hogs CPU and will slow down the build time further

  • Build speed could be further increased by using a pre-built static library of the mbed-os. Thanks to my colleague K Aadhi Vairava Sundaram for this tip.
    • Import required example:
    • Git clone mbed-os separately
      • use mbed import <commit code> from above
      • change directory to mbed-os
      • Run mbed compile -m <your compile target> -t <your toolchain> --library
    • copy generated library to example folder
      • copy BUILD/libraries/mbed-os/*  ../mbed-os-example-blinky/mbed-os
    • Build example
      • mbed compile --toolchain <your toolchain> --target <your compile target>

Note that although mbed-os library can be built for multiple targets and multiple toolchains, only one library at time can be copied to example folder.

0 Likes
1 Comment
SrikanthD_56
Employee

For ARM Compiler 6, you can also add armclang.exe to the windows Defender exclusion.

Add-MpPreference -ExclusionProcess "armclang.exe".

0 Likes
Top labels