MCUXpresso SDK: CMake Usage - Build Options

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCUXpresso SDK: CMake Usage - Build Options

MCUXpresso SDK: CMake Usage - Build Options

Exploring CLI Build Options

In a previous article, we demonstrated how to build a simple project using the CLI. However, we can easily build more complex projects using west build options. We can specify a specific toolchain, compiler, core, etc. To view the complete list of build options run the command:

west build -h

 

Dual Core Device Example

For single core devices there is no need to specify a core ID. However, this must be done when working with a dual core device. For example, to build Hello_World for the FRDM MCXN947, the following command needs to be run:

west build -b frdmmcxn947 example/demo_apps/hello_world -Dcore_id=cm33_core0

joseOcampoHernandez_0-1736800312855.png

 

Specifying a Toolchain

The MCUXpresso SDK supports several toolchains. To take the example above and build for IAR, we simply specify the IAR toolchain with a build option as follows:

west build -b frdmmcxn947 example/demo_apps/hello_world -Dcore_id=cm33_core0 --toolchain iar

joseOcampoHernandez_1-1736800353601.png

 

Specifying a Different Build Directory

As you can see the CLI is quick and easy to use for building projects. So far, we have covered some of the major build options to consider. What happens when we want to evaluate with different builds simultaneously? Well, we can specify different build directories within our workspace. To designate a different build directory for the project above, simply run:

west build -b frdmmcxn947 examples/demo_apps/hello_world -Dcore_id=cm33_core0 --toolchain iar -d C:\temp-sdk\mcuxsdk\custom_build

joseOcampoHernandez_0-1736804302394.png

*Note the path shown has been personalized. The path for your system will vary.

Labels (1)
No ratings
Version history
Last update:
‎02-04-2025 04:07 PM
Updated by: