Command Line Development#
This guide covers developing with the MCUXpresso SDK using command line tools and the west build system. This workflow applies to both GitHub Repository SDK and Repository-Layout SDK Package distributions.
Prerequisites#
GitHub Repository SDK workspace initialized OR Repository-Layout SDK Package extracted
Development tools installed per Installation Guide
Target board connected via USB
Understanding Board Support#
Use the west extension to discover available examples for your board:
west list_project -p examples/demo_apps/hello_world
This shows all supported build configurations. You can filter by toolchain:
west list_project -p examples/demo_apps/hello_world -t armgcc
Basic Build Commands#
Standard Build Process#
Build with default settings (armgcc toolchain, first debug config):
west build -b your_board examples/demo_apps/hello_world
Specifying Build Configuration#
# Release build
west build -b your_board examples/demo_apps/hello_world --config release
# Debug build with specific toolchain
west build -b your_board examples/demo_apps/hello_world --toolchain iar --config debug
Multicore Applications#
For multicore devices, specify the core ID:
west build -b evkbmimxrt1170 examples/demo_apps/hello_world --toolchain iar -Dcore_id=cm7 --config flexspi_nor_debug
For multicore projects using sysbuild:
west build -b evkbmimxrt1170 --sysbuild ./examples/multicore_examples/hello_world/primary -Dcore_id=cm7 --config flexspi_nor_debug --toolchain=armgcc -p always
Shield Support#
For boards with shields:
west build -b mimxrt700evk --shield a8974 examples/issdk_examples/sensors/fxls8974cf/fxls8974cf_poll -Dcore_id=cm33_core0
Advanced Build Options#
Clean Builds#
Force a complete rebuild:
west build -b your_board examples/demo_apps/hello_world -p always
Dry Run#
See what commands would be executed:
west build -b your_board examples/demo_apps/hello_world --dry-run
Device Variants#
For boards supporting multiple device variants:
west build -b your_board examples/demo_apps/hello_world --device MK22F12810 --config release
Project Configuration#
CMake Configuration Only#
Run configuration without building:
west build -b evkbmimxrt1170 examples/demo_apps/hello_world -Dcore_id=cm7 --cmake-only -p
Interactive Configuration#
Launch the configuration GUI:
west build -t guiconfig
Flashing and Debugging#
Flash Application#
Flash the built application to your board:
west flash -r linkserver
Debug Session#
Start a debugging session:
west debug -r linkserver
IDE Project Generation#
Generate IDE project files for traditional IDEs:
# Generate IAR project
west build -b evkbmimxrt1170 examples/demo_apps/hello_world --toolchain iar -Dcore_id=cm7 --config flexspi_nor_debug -p always -t guiproject
IDE project files are generated in mcuxsdk/build/<toolchain> folder.
Note: Ruby installation is required for IDE project generation. See Installation Guide for setup instructions.
Troubleshooting#
Build Failures#
Use pristine builds to resolve dependency issues:
west build -b your_board examples/demo_apps/hello_world -p always
Toolchain Issues#
Verify environment variables are set correctly:
# Check ARM GCC
echo $ARMGCC_DIR
arm-none-eabi-gcc --version
# Check IAR (if using)
echo $IAR_DIR
Getting Help#
Display help information:
west build -h
west flash -h
west debug -h
Check Supported Configurations#
If unsure about supported options for an example:
west list_project -p examples/demo_apps/hello_world
Best Practices#
Project Organization#
Keep custom projects outside the SDK tree
Use version control for your application code
Document any SDK modifications
Build Efficiency#
Use
-p alwaysfor clean builds when troubleshootingLeverage
--dry-runto understand build processesUse specific configs and toolchains to reduce build time
Development Workflow#
Start with existing examples closest to your requirements
Copy and modify rather than building from scratch
Test with hello_world before moving to complex examples
Use configuration tools for pin muxing and clock setup
Next Steps#
Explore VS Code Development for integrated development experience
Review Workspace Structure to understand SDK organization
Refer build system documentation for advanced configurations