MCUXpresso Training Hub

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MCUXpresso Training Hub

讨论

排序依据:
Overview In the evolving landscape of embedded systems development, workflows that support automation and efficiency are becoming more essential. This article explores how to build a robust CI/CD pipeline tailored for embedded projects using GitHub Actions, Docker, the MCUXpresso SDK, and Visual Studio Code. By integrating these tools, developers can automate builds, run tests, and ensure consistent firmware delivery across teams and environments. We begin by outlining the benefits of CI/CD in embedded workflows, including faster iteration cycles, reduced human error, and improved collaboration. Then, we dive into the practical setup: using Docker to encapsulate the build environment, GitHub Actions to orchestrate builds and tests, and MCUXpresso SDK within VS Code to manage and develop firmware projects. Real-world examples and reusable templates will guide readers through creating a pipeline that’s scalable, maintainable, and optimized for NXP-based development boards. Whether you're an embedded engineer looking to modernize your workflow or a product manager aiming to improve delivery timelines, this guide will help you harness the power of automation in your development lifecycle.   Prerequisites MCUXpresso for VS Code MCUXpresso SDK 24.12 or later Git GitHub account Docker   Table of Contents Benefits of CI/CD in Embedded Workflows Containers - Docker Automation - GitHub Actions Using the pipeline Conclusion   1. Benefits of CI/CD in Embedded Workflows Implementing Continuous Integration and Continuous Deployment (CI/CD) in embedded systems development offers transformative advantages, especially when working with complex toolchains like the MCUXpresso SDK and hardware-specific constraints. Here are the key benefits: Automated Builds and Testing CI/CD pipelines eliminate manual build steps by automating compilation, linking, and flashing processes. This ensures that every code change is validated against a consistent build environment, reducing the risk of human error and saving valuable engineering time. Early Detection of Issues By integrating automated unit tests, static analysis, and hardware-in-the-loop (HIL) testing into the pipeline, developers can catch bugs and regressions early before they reach production hardware. This leads to more stable firmware and fewer surprises during integration. Consistent Environments with Docker Using Docker to containerize the build environment ensures consistency across development machines and CI runners. Developers no longer need to worry about mismatched toolchain versions or missing dependencies—everything is defined and reproducible. Improved Collaboration and Code Quality CI/CD encourages frequent commits and pull requests, which are automatically validated. This fosters better collaboration among team members, enforces coding standards, and ensures that only tested code is merged into the main branch. Faster Iteration and Deployment With automated pipelines, firmware updates can be built, tested, and deployed to target devices or staging environments quickly. This accelerates development cycles and enables rapid prototyping, especially useful in agile or iterative development models. Traceability and Auditability CI/CD systems log every build, test result, and deployment, providing a clear history of changes. This is crucial for debugging, compliance, and maintaining high-quality standards in regulated industries like automotive or medical devices. Scalability Across Projects Once a pipeline is established, it can be reused or adapted across multiple embedded projects. This scalability reduces setup time for new boards or applications and promotes best practices across teams.   2. Containers - Docker What Are Containers? Containers are lightweight, portable units of software that package up code along with all its dependencies, libraries, and configuration files—so it can run reliably across different computing environments. Think of a container as a self-contained box that includes everything your application needs to run. There are several platforms that can be used to containerize a workspace. For this guide, we focus on Docker. What Is Docker? Docker is an open-source platform that enables developers to build, package, and run applications in containers. It simplifies the process of creating isolated environments that include everything an application needs such as code, libraries, tools, and settings to run consistently across different systems. At its core, Docker helps solve the problem of "it works on my machine" by ensuring that the development, testing, and deployment environments are identical, whether you're working locally or in the cloud. Steps to Containerize the MCUXpresso SDK and Build System using Docker The following components are required to containerize the MCUXpresso SDK and build system with Docker. Dockerfile - This is a text file that defines the steps to build a Docker image such as installing packages, copying files, and setting environment variables. Docker Image - This is a snapshot of a container environment. It’s built from a Dockerfile and used to create containers. Docker Container - A running instance of a Docker image. It’s isolated, lightweight, and portable.   Writing the dockerfile 1. Open a text editor (e.g VS Code) 2. Create a new text file. Name it dockerfile. Save this file as a Docker file type. 3. When creating a dockerfile to containerize the MCUXpresso SDK and build system, you must specify all of the components you need. We have provided a template below which you can copy and paste it in your dockerfile.  What the template does: - Uses Ubuntu 22.04 as the foundation for the container. This provides a stable Linux environment for building and running embedded tools. - Prevents interactive prompts during the installation - Installs all the packages necessary (some optional) to work with the MCUXpresso SDK - Installs the ARM GNU 13.2 toolchain - Sets up a workspace to clone the MCUXpresso SDK in with West - Configures the toolchain path environment variable  # Use Ubuntu 22.04 as the base image FROM ubuntu:22.04 # Set environment variables for non-interactive installations ENV DEBIAN_FRONTEND=noninteractive # Install necessary packages /some optional RUN apt update && apt install -y \ curl \ wget \ ca-certificates \ xz-utils \ libncurses5 \ cmake \ ninja-build \ git \ python3 \ python3-pip \ build-essential \ device-tree-compiler \ unzip \ && rm -rf /var/lib/apt/lists/* # =========================================================================================================== # Notes on flags used: # (-LO) follows http redirects and saves the downloaded file with same name as in URL # (-k) ignores SSL certificate verification. This is needed when system security prevents certain actions # Contact IT to whitelist arm servers if needed. # ============================================================================================================ RUN curl -LO -k https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz && \ tar xf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz && \ rm arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz # Install additional Python packages RUN pip3 install --upgrade west imgtool requests # Set the workspace directory WORKDIR /workspace # Clone the mcuxsdk-manifests repository RUN git clone https://github.com/nxp-mcuxpresso/mcuxsdk-manifests.git # Set the MCUXpresso SDK path environment variable ENV MCUX_SDK_PATH=/workspace/mcuxsdk-manifests # Initialize and update the west workspace RUN cd $MCUX_SDK_PATH && \ west init -l . && \ west update # ARMGCC ENV variable ENV ARMGCC_DIR=/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi # Default command: Start a shell CMD ["/bin/bash"]   Building the Container Image Before we continue, it is a good idea to set up a GitHub repository and configure credentials to use in the later steps. 1. Create a new repository. Leave it empty for now. Later, it will contain the following items: .github/workflows/docker-build.yml my_app dockerfile README.md 2. Generate a Personal Access Token (PAT). This will allow you to access the GitHub API. - Click on your profile icon   - Select Settings > Developer settings > Personal access tokens > Tokens(classic)   - Select Generate new token (classic) - The scopes can be custom for your needs. Use the following scopes for this guide: delete:packages, repo, write:packages - Click Generate Token. Make sure to copy and save the token once it is generated. - Next, store the personal access token (PAT) as a GitHub secret. The GitHub Secret will be used for authentication in the workflow file. This is done to enhance reusability, security, and rotation without modifying the workflow file.   - Navigate to the repository that was created and click on Setttings.   - Select Secrets and variables and click on Actions. - Here we will add 2 secrets. One for our username and the second for our personal access token. Click New repository secret. Secret for username - This can be personalized. However, in the workflow file that will be covered later in the guide, the variable is set as GH_USERNAME. Set the name as GH_USERNAME. In the Secret field enter your GitHub username. Secret for token - The workflow has the variable set as GH_PAT. Set the name as GH_PAT. In the Secret field paste your personal access token. 3. We can now build the container image from the command line. - Clone a local copy of your repository. Open the command line interface to that location. - Save the dockerfile to the root directory of your cloned repository. - Login to GitHub Container Registry. Run: echo <your personal access token> | docker login ghcr.io -u <your GitHub username> --password-stdin Ouput: -Build the container image. This is the lengthiest step in this guide, but images only need to be built once before they are pushed to ghcr to be used. Run: docker build -t <your image name> . Output:   - To verify your image details run: docker images   - Tag the Docker image. This command doesn't create a new image; it just gives an existing image a new name and tag. This is especially useful when you're preparing to push the image to a registry like GHCR. Docker requires the image to be tagged with the registry URL and repository name before it can be pushed. Run: docker tag <your image tag> <your location>   - Push the image to the container registry. Run: docker push <your location> **Note: The Output might show as failed due to a server error. If it does, simply attempt by running the command once more. Running the command once more: Congratulations! The MCUXpresso SDK and build system are now in a container image are ready to use to build your projects. Next, we will configure GitHub for automation.   3. Automation - GitHub Actions Why use GitHub Actions? GitHub Actions is a built-in automation tool in GitHub that lets you define workflows to build, test, and deploy your code based on events like pushes or pull requests. It uses YAML files to configure these workflows, making it easy to set up CI/CD pipelines directly in your repository. 1. Clone your repository locally. Then navigate to its root directory. - Create a .github/workflows directory inside your project root. - Navigate to VS Code and create a new file. Name it: docker-build.yml - We have provided a template below which you can copy and paste it in your docker-build.yml.  What the template does: Runs on push or PR Uses a container with MCUXpresso SDK tools Checks out your repo Copies your app into the west workspace Builds it for the FRDM-MCXA153 using west   name: Build MCUXpresso Project on: push: # branches: [ main ] pull_request: jobs: build: runs-on: ubuntu-latest container: image: ghcr.io/nxp-jose/mcuxpresso-sdk:latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Copy my_app into west workspace run: | cp -r $GITHUB_WORKSPACE/my_app /workspace/mcuxsdk-manifests/my_app - name: Build project using west working-directory: /workspace/mcuxsdk-manifests run: | echo "Building project..." west build -b frdmmcxa153 my_app   4. Using the Pipeline Complete your workspace setup The last step in the process is creating a project to use in our pipeline. 1. Open MCUXpresso for VS Code 2. Click Import example from Repository 3. Import a project from MCUXpresso SDK 24.12 or later as a freestanding example. Set the import location to the root directory of your cloned repository. 4. Stage, commit and push the changes to your repository. Your repository should now contain: *Note: You will see a .vscode directory if you build the project locally. It is completely optional to push this directory to your repository. 5. Once the push is completed, enable workflows on GitHub. Once the workflow is enabled. Successive pushes or pull requests will trigger automatic project builds. 6. Examine the build details. - Navigate to the Actions tab on GitHub   - The Actions tab will show the all the instances where the workflow has run.   - Click on a build to view the details.   - The details displayed are individual steps executed during the build process. Click on the steps to view specific details.   5. Conclusion The CI/CD pipeline outlined in this guide provides a simple yet effective starting point for automating builds with Docker, the MCUXpresso SDK, and GitHub Actions. While the example focuses on a basic workflow, it can be extensively customized to meet project-specific needs such as integrating automated tests, adding quality checks, or using custom MCUXpresso SDK manifests. By leveraging these tools, teams can streamline development, ensure consistency, and scale their processes with minimal manual intervention.  
查看全文
Documentation MCUXpresso Config Tools | Software Development for NXP Microcontrollers (MCUs) | NXP Semiconductors This training currently covers the following areas: MCUXpresso Config Tools: How-Tos MCUXpresso Config Tools: Zephyr Pins Setup System Manager configuration via Config tools for i.MX
查看全文
Overview MCUXpresso SDK 24.12 introduced enhanced support for custom manifests, enabling developers to define precisely which components, drivers, middleware, and board support packages are included in their workspace. This feature is especially valuable in modern embedded workflows where minimalism, reproducibility, and CI/CD integration are key. Customization of the MCUXpresso SDK is enabled by West. The West tool is used to manage multi-repository projects. By leveraging custom west.yml files, developers can: Reduce SDK footprint by excluding unused components. Accelerate build times and simplify dependency management. Align SDK content with specific hardware targets or application domains. Improve collaboration across teams by standardizing SDK configurations. This guide walks through the process of creating and using a custom manifest to tailor your MCUXpresso SDK setup, ensuring your development environment is optimized for performance and maintainability. This guide has the following components: Cloning the MCUXpresso SDK manifests Creating a custom manifest file Initializing the West workspace Completing the import with West Test and build a project   Cloning the MCUXpresso SDK manifests - Ensure that Git is installed and available in the system path - Open a terminal - Navigate to or create a directory to store the SDK - Run:  git clone https://github.com/nxp-mcuxpresso/mcuxsdk-manifests.git Output:   - Navigate to the mcuxsdk-manifests directory. We will modify the west.yml file in the next step     Creating a custom manifest file - Open the file in an editor (e.g VS Code).   - Make a copy of the west.yml file. Give the copy a relevant name: mcuxpresso_sdk_custom_mcx.yml. - The following items contain component-specific manifests that can be explicitly included in the import relevant to a particular use case. Devices. Explore /submanifests/devices. The list of manifest files are ALL imported if NOT specifically listed. Middleware. Explore /submanifests/middleware. The list of manifest files are ALL imported if NOT specifically listed. RTOS. Currently there is only 1 manifest file. Future updates may offer alternate RTOS manifests. In this guide, we will replace the devices and middleware lines with an explicit submanifest. Replace the devices and middleware lines with a specific submanifest that includes only the components you need. To further reduce the amount of content imported, remove the rtos and internal components. import: - submanifests/base.yml - submanifests/devices/MCX.yml - submanifests/middleware/eIQ.yml   - Save the modified mcuxpresso_sdk_custom_mcx.yml file. The file should now contain:      Initializing the West workspace - In your terminal, navigate to the mcuxsdk-manifests directory - Create a West workspace in the current directory using the updated manifest file run: west init -l --mf mcuxpresso_sdk_custom_mcx.yml  *Note: -l : Stands for "local" --mf : Specifies a custom manifest file to use instead of the default file west.yml. Output:     Completing the import with West After initializing the West workspace, we are now ready to import. - Run: west update Output: *This image is concatenated to show that the import process has begun.   Test import and build a project At this point the custom MCUXpresso SDK manifest is ready for use. To test, import an example project into MCUXpresso for VS Code and build it. - Import the custom SDK into MCUXpresso for VS Code.   - Import an example from the custom MCUXpresso SDK   - Build the project.   Output: **Note: This step assumes that the user has already installed dependencies (e.g toolchain, CMake, etc). Follow the steps below to install dependencies with the MCUXpresso Installer if not yet done so.   - Open the MCUXpresso Installer.   - Select MCUXpresso Developer. Click install.  
查看全文
The following video demonstrates how to import a GUI Guider project to VS Code:
查看全文
The NXP MCUXpresso SDK team is developing West Extension commands to help customers utilize the SDK.  In 25.06.00 SDK release on GitHub, the team introduced west explore command.  A user can gain access to the command with the following instructions.  Also demonstrated in the video below. Install Visual Studio Code Install the MCUXpresso for VS Code extension from the Marketplace Use MCUXpresso Installer to properly set up work environment with tool dependencies. Import the MCUXpresso SDK from GitHub.  Use Import Repositories wizard in VS Code   Select "24.12 or newer" Remote tab Select Version = 25.06.00 or newer Import repository.  It will clone the manifest repository, then run west update to import the repositories associated with the SDK. Open a terminal.  In Terminal Tab select "MCUXpresso Terminal" Select to open Terminal in MCUXpresso SDK mode Select target of GitHub SDK installed in step 4 Change folder to the root of the /mcuxsdk.  There will be several SDK folders including /examples Type command 'west explore' Use keywords and drop down options to filter thousands of SDK Examples Select and copy a single command from the bottom of the GUI. Paste and run the command.   MCUXpresso SDK Project will build and run for the filtered example you selected. NOTE: You can add "-d /pathname_example" to have the example stored in a unique folder
查看全文
The MCUXpresso Installer is a tool developed by NXP Semiconductors to simplify the setup of embedded development environments, especially for users working with NXP microcontrollers. Here's an overview of its key features and functionality: Purpose The installer is designed to handle the complex dependencies involved in embedded development, such as: Compilers Linkers Debuggers Libraries Build systems Debug probe support   Key Features Streamlined Setup: Users can configure their development environment with a single click using high-level options. Cross-Platform Support: Available for Windows, Ubuntu, and macOS. Developer Profiles: MCUXpresso SDK Developer Zephyr Developer Matter Developer   Dependencies Managed The installer automatically installs and configures: Python & West: For scripting and repository management Git: For version control CMake & Ninja: For build system infrastructure Zephyr SDK: For Zephyr-based development GNU Arm Toolchain: For MCUXpresso SDK development   Standalone Tools Included MCUXpresso Configuration Tools: For pin/clock/peripheral setup MCUXpresso SEC: Secure provisioning tool GUI Guider: UI development FreeMASTER: Real-time debug and data visualization   Installation Process The installer provides an intuitive UI to select software kits, debug probes, and individual components. It ensures that paths are correctly set (e.g., adding tools to the system PATH variable). Available for download via NXP's official site .   MCUXpresso Installer in VS Code The MCUXpresso Installer can be obtained directly from VS Code.  Click Open MCUXpresso Installer from the Quickstart Panel. If the Installer is not installed, the user will be prompted to directly install it then.   Once the installation is complete, the MCUXpresso Installer will launch in a new window.     MCUXpresso Installer Usage To install components such as the MCUXpresso SDK Developer tools select it from the menu. The component will be shown with a blue marker on the left to denote it has been selected. Hovering over the component will show the specific items the Installer will install for that component.   To inspect and control the details of the installation, select the component and click the Show details button. In the Installation details view, select/deselect tools to complete a custom installation.   To inspect the installation logs, click the menu icon on the top right and click Open log folder.      
查看全文
🔧 What is LinkFlash? LinkFlash is a powerful graphical utility designed to simplify flash programming tasks for NXP microcontrollers. Whether you're programming, erasing, verifying, or recovering devices, LinkFlash provides a user-friendly interface to perform these operations efficiently. This guide walks you through its features and how to use them effectively.   LinkFlash can be launched from the LinkServer directory via terminal using: ./LinkFlash or ./LinkServer gui flash   It interfaces with LinkServer probes and supports a wide range of NXP devices, offering a visual alternative to command-line flash operations.   🖥️Application Layout The LinkFlash interface is organized into five main sections: Menu Bar Probe and Device Options Flash Commands Logs Status Bar Menu Bar The menu bar provides access to configuration management and help: - **File**   - **Load Configuration...**: Load a previously saved setup.   - **Save Configuration...**: Save the current setup.   - **Reset Configuration**: Revert to default settings. - **Help**   - **About**: Displays application information. Probe and Device Options This section allows you to select the hardware and connection settings: - **Probe**: Choose from connected LinkServer probes. Use **Refresh** to rescan. - **Device**: Select your target MCU from a searchable dropdown. - **Protocol**: Choose between `SWD` or `JTAG` (typically `SWD`). - **Wirespeed**: Set the communication speed in Hz, or leave blank to use the default. Flash Commands LinkFlash supports five main flash operations, each accessible via tabs: 1. Program Upload a file to flash memory. - **File**: Select or drag-and-drop the file. - **Address**: Required for binary files (not ELF/HEX/SREC). - **Mass erase before programming**: Optional full erase. - **Reset target after programming**: Auto-reset post-programming. 2. Erase Perform a mass erase of the flash memory. 3. Resurrect Recover locked devices (MCXC and Kinetis series only). 4. Save Extract a flash memory region to a file. - **Address**: Start address. - **Size**: Region size. - **File**: Destination file. 5. Verify Check if flash contents match a given file. - **File**: Reference file. - **Address**: Required for binary files. > **Note:** Input validation occurs only upon execution. Errors like missing files or invalid formats will trigger a pop-up.  Logs Two tabs provide feedback and traceability: - **Log**: Displays detailed output of the last command. - **Commands**: Shows a history of executed commands, which can be reused in CLI. Status Bar Displays the result of the most recent operation, helping you quickly verify success or failure.   Configuration Management LinkFlash automatically saves your session to: <user_home>/.linkserver/.gui_flash_last_sess.json   You can also load a specific configuration at startup: ./LinkServer gui flash --config my_saved_state.json   Command-Line Options For advanced users, LinkFlash supports CLI options: Load a specific configuration. --config <file>   Display help information. --help   Conclusion LinkFlash is a versatile and intuitive tool for developers working with NXP microcontrollers. Its GUI simplifies complex flash operations, making it ideal for both beginners and experienced users. Whether you're debugging, programming, or recovering a device, LinkFlash streamlines the process with clarity and control.
查看全文
Documentation LinkServer Integration with MCUXpresso IDE   This training currently covers the following areas: General Usage Getting Started with LinkFlash: A GUI-Based Flash Programming Utility - NXP Community NXP LinkServer 24.9.75: New GUI for Flash Programming | MCU on Eclipse
查看全文
RTOS DETAILS View The RTOS DETAILS view shows various information about RTOS Tasks/Threads. The view appears in the bottom pane, once a debug session is started, and disappears after debugging ends. The view is independent of the debug probe being used, as it only uses GDB commands to receive information from the target. The supported RTOSes are: FreeRTOS  Zephyr    FreeRTOS Usage The RTOS DETAILS view will display the following for FreeRTOS projects. However, the project must be configured properly. TCB#: Task Control Block.  configUSE_TRACE_FACILITY  needs to be set to 1. Task Name: Name of task.  configMAX_TASK_NAME_LEN  needs to be greater than 1. Task Handle: Address of the task handle. Task State: Current task state. Rows are also colored based on the state. Priority: Task actual priority and task base priority. Stack Usage: Graphical view of current stack usage, peak usage and total size for the task. Hovering over the cell reveals more information about the stack.  configRECORD_STACK_HIGH_ADDRESS  needs to be set to 1. Runtime: Task runtime with percentage value.  configGENERATE_RUN_TIME_STATS  needs to be set to 1. Note: The Runtime view needs a patch to FreeRTOS to access runtime counters. See Erich Styger's blog for explanation and patch.     For the FreeRTOS portion of this article, I'll be working with the frdmrw612_freertos_sem example project obtained from the FRDMRW612 SDK. To configure the settings on this project, open the FreeRTOSConfig_Gen.h file. In the FreeRTOSConfig_Gen.h file, use Ctrl+F to quickly find and set the defines highlighted in red above. Save the file.   Once the settings have been configured, build the example and flash the board. The RTOS DETAILS View is available in the bottom pane. To view the data, suspend the target and the view will detect the RTOS type and read information about the tasks/threads. Every time the target stops (suspended or stepped), the RTOS DETAILS view will refresh with updated information.   RTOS DETAILS view has the following capabilities: Resize columns by dragging their edges. Sort columns by clicking on them. Hover over each cell and header to get more information. Color rows by task/thread state. Display warning icons when missing certain RTOS configurations. The warning icons can be hovered for more help on how to solve the issue.     Zephyr Usage The RTOS DETAILS view will display the following for Zephyr projects. Name: Name of the thread.  CONFIG_THREAD_NAME  needs to be enabled. Handle: Address of the thread handle. Priority: Priority of the thread. State: Current task state. Rows are also colored based on the state. Stack Usage: Graphical view of the stack delta offset, current usage and total size for the thread. Hovering over the cell reveals more information about the stack.  CONFIG_THREAD_STACK_INFO  needs to be enabled.   For the Zephyr portion of this article, I'll be working with the philosophers example project obtained from the Zephyr 4.1.0 SDK. To configure the settings on this project, open the prj.conf file. Add the highlighted items above and save the file.   Next, build the project and flash the board. The RTOS DETAILS view will appear on the bottom pane during a debug session as it did for the FreeRTOS example. Expect the behavior to be similar with only a change in the columns.
查看全文
Overview The MCUXpresso SDK 24.12.00 is fully hosted on GitHub. Users are able to clone the SDK and easily keep up to date with changes. Version control transparency allows users to review commits, tags, diffs, etc.   Source Control The MCUXpresso SDK on GitHub is composed of multiple groups of software distributed among different repositories. The MCUXpresso SDK uses the popular west manifest to specify what software is included. This method of delivering software was inspired by Zephyr. The manifests folder contains the manifest file to initialize and update the west workspace. In the mcuxsdk folder you'll find the MCUXpresso SDK source code, examples, middleware integration and script files. Both of these folders contain a .git directory that contains information to track changes, branches, and history of the project.   Visual Studio Code: CLI To interact with the repo within VS Code through a CLI, open a Terminal. The Terminal can be opened from the menu in the top left of the screen. Alternatively, the Terminal and other monitors are hidden in a bar at the bottom of the screen. Navigate to the bottom of the screen, use the cursor to drag the bar and reveal the Terminal.   Once in the CLI, git commands can be run to track the status of the MCUXpresso SDK repositories.   Visual Studio Code: GUI The command line is useful for many things, however, sometimes a gui might be productive. The source control gui that VS Code provides can be accessed through the menu on the top left of the screen or in the extensions sidebar.   The source control gui in Visual Studio Code contains three sections: Source Control Repositories - These are the repositories that are currently visible to the workspace. Each repository contains a menu that allows the user to pull, push, navigate across branches, etc.     Source Control - This tracks changes made by the user. Here, you will see staged changes, commits, etc. *Note: Contribution to the MCUXpresso SDK is currently not open.     Source Control Graph - This provides a comprehensive overview of the project. The graph shows a representation of commits and their related data. The image below shows the source control graph for the MCUXpresso SDK. Hovering over a commit will show the author, commit date, documentation messages, and the commit ID.       Viewing Changes to source One of the main benefits of hosting the MCUXpresso SDK on GitHub is that enables better project management. Users now have access to the entire MCUXpresso SDK project history. Navigate to the Source Control Graph view and select any entry. Doing so will open the diff view highlighting the changes across the modified files in the commit.          
查看全文
Overview Previously, we covered an overview of Kconfig in this article. We also covered, the process of launching the Kconfig GUI from the CLI. In this article, we will look at the process for launching the Kconfig GUI from MCUXpresso for VS Code.   Process Before we can get started with the Kconfig GUI, we need to import a project into VS Code. For this article let's focus on the freertos_hello example as we did in the Kconfig article for the CLI.   To open the Kconfig GUI, navigate to the PROJECTS view. Right click on the freertos-hello project and select Configure > Open Kconfig GUI Configuration.   The Kconfig GUI should launch, you'll now be able to make changes/selections in the GUI.   For example, you can modify the project to use heap 3 rather than heap 4. After selecting the component, you'll see a brief overview and description of the component.     After completing changes with the Kconfig GUI, click the Save button. If your project requires it, make the changes to code in other parts of your project. To verify that changes made from the Kconfig GUI were applied: navigate to the PROJECTS view, expand the project, expand the Project Files, expand the build configuration, and open the .config file. You can view this file directly in the workspace. Use Ctrl + F to find the components that you modify. The verification step is not required. Users are able to attempt a build as soon as they save their changes in the Kconfig GUI.   
查看全文
MCUXpresso SDK The MCUXpresso SDK has been reengineered to make use of CMake and Kconfig. This article will demonstrate how to use the SDK in VS Code.   *Note: The SDK has switched to CalVer versioning convention. *Note: The SDK will contain previews of possible changes for a later release. The previews are available for early evaluation but are not intended to substitute a release.     Importing the SDK Navigate to the QUICKSTART PANEL in the MCUXpresso for VS Code extension. Click on Import Repository. Select the REMOTE option if you have not yet obtained the SDK. Designate a destination to save locally in the Location field.   Select the latest release of the MCUXpresso SDK in the Repository field. The latest version for this walkthrough is MCUXpresso SDK - 24.12.00. Select the main revision in the Revision field.  Note: The SDK can be cloned directly from GitHub. Select the Local option to import if you've already obtained the SDK.   Importing an example project The process of importing a project into MCUXpresso for VS Code does not vary from previous versions. To do so, simply use the Import Example from Repository option.   Exploring the CMake format You will notice several folders when navigating the SDK directory. To examine the CMake project format, let's take a look at the led_blinky_peripheral project. This project is found in examples/demo_apps/led_blinky_peripheral. In this directory, you will find generic project files including the CMakeLists file.   For example, the file that holds the main function in this example project can reference different board files and their respective peripherals.   The files are generic to allow reusability and support for many other devices. This reduces the overall size of the SDK. The CMakeLists file is used to specify the device and project options for the build. In another article, we will cover how the variables in the CMakeLists files are referenced when a build for a specific device is initiated. For now, let's take a look at structure of the file. You'll notice that the variables in this file are generic and will be referenced later for the build. For example, the following two variables are needed for the build system to know which board to build for and where to reference the files. SdkRootDirPath - This specifies the root path to the SDK. board - This specifies the board name.   Once the build is initiated all the necessary files will be drawn in to the project.  
查看全文
Kconfig Usage You can interact with Kconfig via graphical menu interface. Once you have completed the CMake configuration process, you can invoke the Kconfig gui with the following command:   west build -t guiconfig   In this interface, the user selects the options and features desired, and saves a configuration file, which is then used as an input to the build process.   Kconfig Example In this exercise, we will use the simple freertos Hello_World example to demonstrate how to launch and interact with the Kconfig gui. Build the project on the CLI using West       Launch the Kconfig gui by running:        The previous command launches the following gui:       Use the dropdown menus or the Jump to... button to find components   Select a component and click Save to update   Once you have finalized changes to any components, simply rebuild the project.
查看全文
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   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   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 *Note the path shown has been personalized. The path for your system will vary.
查看全文
Kconfig Overview Kconfig is a selection-based configuration system originally developed for the Linux kernel. Kconfig is now found more and more in use for other projects beyond the Linux kernel. In the MCUXpresso SDK, Kconfig is used to configure the build in run time which includes component selection with dependency resolve, component configuration with feature enable, disable and customization.   Interface menuconfig and guiconfig are two available interactive configuration interfaces to start a GUI to do run time selection and configuration for Kconfig options. menuconfig is a curses-based interface that runs in the terminal while guiconfig is a graphical configuration interface.   Process Flow The Kconfig files and related prj.conf with priority are put into the Kconfig processor. The direct output is the .config and config headers. Any updates in input Kconfig, output .config and config header will trigger a Kconfig process in next build cmd.   prj.conf is the pre set value for Kconfig symbols. It is the input for the Kconfig process.  The prj.conf search paths can be provided through 3 ways with priority. Fixed prj.conf search paths The priority is from low to high. High priority prj.conf data will override low priority prj.conf data. Specifying customized prj.conf search path in project CMakelists.txt “project” with “CUSTOM_PRJ_CONF_PATH” The “CUSTOM_PRJ_CONF_PATH” argument can be used in project CMakelists.txt “project” macro to specify the customized prj.conf search paths. The prj.conf search paths of CUSTOM_PRJ_CONF_PATH is with higher priority than the fixed prj.conf search paths. -DCONF_FILE=<customized config file> You can directly provide customized prj.conf with -DCONF_FILE=<customized config file>. The customized project config file has the highest priority overall.   Config Headers The Kconfig symbols and the values will be generated into config headers placed in build binary folder. Kconfig symbols and values can also be generated into customized headers. Refer to the online SDK Documentation for this.  
查看全文
Brief Look at MCUXpresso SDK CMake projects   The CMakelists.txt file (as shown above) is used by CMake to configure the project build. This is a text file that contains both standard CMake functions such as include, project, etc. However, for projects found in the MCUXpresso SDK, you will also find MCUXpresso CMake extension functions.  The file shown above displays two MCUXpresso CMake extension functions. mcux_add_source - specifies the path to the project's source files. mcux_convert_binary - specifies the output binary format. For more information regarding this MCUXpresso CMake extension functions, reference the online SDK Documentation.   Building a Project using the CLI Once you have set up your environment and have obtained the MCUXpresso SDK, you can build projects from the command line. To do this, we will be using West commands. To begin, simply launch your preferred CLI and navigate to the directory where you have stored the MCUXpresso SDK. For the complete list of West commands available run: west -h     For this exercise, we will simply build the Hello World example project for the FRDM MCXA153. To do this, the command to run is as follows: west build -b frdmmcxa153 examples/demo_apps/hello_world   Breaking it down The build command that is shown above builds from the root directory of the SDK. In this particular version, the root is the mcuxsdk directory. There are many examples in the MCUXpresso SDK that are supported for many different devices. Hence, there is a need to specify the frdmmcxa153 with the -b flag. Since the build was performed from the root directory, the path to the project was also specified.  
查看全文
MCUXpresso with CMake MCUXpresso aims to greatly reduce build data development and maintenance efforts through the use of CMake. There are many MCUXpresso CMake extensions provided for you to facilitate component, project and misc data record for all toolchains. All extension functions start with prefix mcux_. For the complete list of MCUXpresso CMake extensions, visit the online MCUXpresso documentation. The online documentation explicitly defines all of the MCUXpresso CMake extension functions. This is done through listing argument names, types, and an explanation. Overall, the versatility of managing the build with a custom CMake extension gives the user full control of what goes into their project. In the next section, we will discuss how NXP uses CMake with the SDK examples.
查看全文
Installation The installation process is fairly simple when using the MCUXpresso Installer. The installer automates most of the installation process by installing the following dependencies: Python West CMake Ninja Kconfig Toolchain The MCUXpresso installer can be obtained from MCUXpresso Installer or the MCUXpresso for VS Code extension.  For users that prefer to complete the installation manually, the entire steps can be followed on the MCUXpresso SDK Documentation.   Obtaining the MCUXpresso SDK The SDK is entirely available on GitHub. To obtain the SDK, clone the manifest repository and initialize a west workspace. To do this, open a Command Line Interface(CLI) and run: west init -m https://github.com/nxp-mcuxpresso/mcuxsdk-manifests Once the west workspace has been initialized, update the west projects by running in your designated directory: west update   Exploring The MCUXpresso SDK Once the clone is complete in your designated directory, you will notice two distinct folders besides the .west folder.   The first is the manifests folder. This is the manifest repo which contains the manifest file to initialize and update the west workspace.     The second mcuxsdk folder contains the MCUXpresso SDK source code, examples, middleware integration and script files.     The SDK example projects are found in examples folder within the mcuxsdk folder. Here you will also find all of the other components included in the SDK such as drivers, middleware, and rtos folders.
查看全文
MCUXpresso SDK The MCUXpresso SDK has been reengineered to make use of CMake and Kconfig.   CMake is a software build system that allows easier access and customization of projects obtained from the MCUXpresso SDK. The decision to use CMake was taken with the aim to improve consistency and readability across SDK examples. The MCUXpresso SDK is a comprehensive product including hundreds of boards and devices, thousands of components and examples, for all mainstream toolchains. The MCUXpresso CMake extensions aims to greatly reduce build data development and maintenance efforts. The image below shows the cmakelists.txt file for a sample project in the SDK.   Kconfig is a selection-based configuration system originally developed for the Linux kernel. In MCUXpresso SDK, Kconfig is used to configure the build in run time. This includes component selection with dependency resolve, component configuration with feature enable/disable and customization.    Follow this link for a quick overview exercise that demonstrates how to obtain the SDK and a brief overview on folder structure.
查看全文
Documentation MCUXpresso SDK Documentation  This training currently covers the following areas: MCUXpresso SDK - Intro to CMake and Kconfig  MCUXpresso SDK - CMake and Kconfig: Getting Started MCUXpresso SDK: CMake Usage - Part I   MCUXpresso SDK: CMake Usage - Part II MCUXpresso SDK: CMake Usage - Build Options MCUXpresso SDK: Kconfig Usage MCUXpresso SDK: Kconfig - Exercise MCUXpresso SDK: GitHub + VS Code MCUXpresso SDK: Custom Manifests MCUXpresso SDK: CI/CD Pipelines  MCUXpresso SDK: Migration Guide - Archive SDK to MCUXpresso SDK 24.12 or Newer  MCUXpresso for VS Code: Importing Projects from the MCUXpresso SDK  MCUXpresso for VS Code: Using Kconfig GUI with MCUXpresso SDK Projects Using west explore from CLI to browse MCUXpresso SDK examples     
查看全文