CMSIS Version 5

repository·develop·Indexed 23 days ago

https://github.com/arm-software/cmsis_5

Cortex Microcontroller Software Interface Standard (CMSIS) Version 5 provides a standardized hardware abstraction layer and software components for Arm Cortex-M, Cortex-A, and SecurCore processors. It includes components such as Core(M), Core(A), Driver, RTOS v1/v2, DAP firmware, and SVD. The repository provides tools for CMSIS-Core validation, CMSIS-DAP debug unit validation, and templates for device-specific support files.

Tokens
3.2K
Snippets
3
Records
19
Agent score
81%

What's inside CMSIS_5

  1. Overview of CMSIS-DAP v2 firmware for LPC-Link2

    develop

    This firmware implements the CMSIS-DAP v2 protocol for the NXP LPC-Link2 debug probe. Unlike previous versions, CMSIS-DAP v2 utilizes USB bulk endpoints for communication with the host PC, resulting in higher performance.

    Key features:

    • High-speed communication: Uses USB bulk endpoints.
    • SWO Trace Support: Optional support for streaming Serial Wire Output (SWO) trace via an additional USB endpoint.

    Supported target configurations:

    • LPC-Link2: Configured as a stand-alone debug probe.
    • LPC-Link2 on-board: Configured as an integrated debug probe for specific evaluation kits (e.g., LPC55S69-EVK, MIMXRT1064-EVK).
  2. Overview of CMSIS Version 5 Components

    develop

    CMSIS (Cortex Microcontroller Software Interface Standard) Version 5 provides a standardized set of software components for Arm Cortex processors. Key components include:

    • Core(M): Standardized API for Cortex-M and SecurCore, including SIMD intrinsic functions.
    • Core(A): API and runtime system for Cortex-A5/A7/A9.
    • Driver: Generic peripheral driver interfaces to connect hardware with middleware (e.g., file systems, communication stacks).
    • NN: Efficient neural network kernels optimized for Cortex-M.
    • RTOS v1: Common API for real-time operating systems (Cortex-M0/M0+/M3/M4/M7).
    • RTOS v2: Extended RTOS API with Armv8-M support, dynamic object creation, and multi-core provisions.
    • Pack: Delivery mechanism for software components and device parameters (part of Open CMSIS Pack).
    • Build: Tools and workflows for productivity (being replaced by CMSIS-Toolbox).
    • SVD: Peripheral descriptions for debuggers and header files.
    • DAP: Firmware for debug units interfacing with CoreSight Debug Access Ports.
    • Zone: Methods to partition system resources into multiple projects/execution areas.
  3. Device folder directory structure

    develop

    The standard directory structure for a CMSIS device support package is as follows:

    <Vendor>
          |
          +-- <Device>
                |
                +-- Include
                |     +-- Template (Armv8-M/v8.1-M TrustZone only)
                |     |     +- partition_<Device>.h           (Secure/Non-Secure configuration)
                |     +- <Device>.h                           (header file)
                |     +- system_<Device>.h                    (system include file)
                +-- Source
                      |
                      +- startup_<Device>.c                   (C startup file)
                      +- system_<Device>.c                    (system source file)
                      |
                      +-- ARM (Arm ARMCLang toolchain)
                      |    +- startup_<Device>.s              (ASM startup file for ARMCC - deprecated)
                      |    +- startup_<Device>.S              (ASM startup file for ARMClang - deprecated)
                      |    +- <Device>.sct                    (Scatter file)
                      |
                      +-- GCC (Arm GNU toolchain)
                      |    +- startup_<Device>.S              (ASM startup file - deprecated)
                      |    +- <Device>.ld                    (Linker description file)
                      |
                      +-- IAR (IAR toolchain)
                           +- startup_<Device>.s              (ASM startup file)
  4. Use the Device folder and template files

    develop

    The Device folder provides a template structure for creating device-specific support files for CMSIS. To use these templates, copy the entire folder structure and perform the following replacements:

    1. Folder Names:

      • Replace <Vendor> with your vendor abbreviation (e.g., NXP).
      • Replace <Device> with your specific device name (e.g., LPC17xx).
    2. Filenames:

      • Replace <Device> in all filenames with your specific device name (e.g., startup_LPC17xx.c).
    3. Placeholders within files:

      • <Device>: Replace with your specific device name (e.g., LPC17xx).
      • <DeviceInterrupt>: Replace with a specific interrupt name (e.g., TIM1).
      • <DeviceAbbreviation>: Replace with a device family abbreviation (e.g., LPC).
      • Cortex-M#: Replace with the specific Cortex-M core number (e.g., Cortex-M3).

    Important: Template files such as startup_<Device>.s and system_<Device>.c are application-specific. You should copy them into your application project folder before use.

  5. Prerequisites for CMSIS-Core Validation

    develop

    Before building and running the CMSIS-Core validation test suite, ensure the following tools are installed and available on your PATH:

    • CMSIS-Toolbox: version 1.3.0 or higher
    • Build Tools: CMake, Ninja build
    • Compilers:
      • Arm Compiler 6 (AC6)
      • GNU Compiler (GCC)
      • IAR Compiler
    • Runtime/Simulation:
      • Arm Virtual Hardware Models
    • Scripting:
      • Python 3.8 or higher

    You must also install the required Python dependencies using pip from the project directory.

  6. Configure CMSIS-DAP debug unit validation for a hardware target

    develop

    To use the CMSIS-DAP debug unit validation test with a specific hardware target in µVision, follow these steps:

    1. Open the provided µVision project.
    2. Select the specific device mounted on your hardware target. This step ensures the correct flash algorithm is selected for downloading.
    3. Ensure CMSIS-DAP is selected as the debugger.
    4. Build the project.
  7. Program CMSIS-DAP v2 firmware on NXP MCU-LINK

    develop

    To update the firmware on an NXP MCU-LINK debug probe to use CMSIS-DAP v2, follow these steps:

    1. Install the Installer: Download and install the MCU-LINK_installer from the NXP MCU-LINK resource page.
    2. Prepare Hardware:
      • Disconnect the MCU-LINK from the USB port (J1).
      • Set the "firmware update" jumper (J3).
      • Reconnect the MCU-LINK to the USB port (J1).
    3. Prepare Firmware File: Copy the pre-built firmware hex file located at .. extbackslash CMSIS\DAP\Firmware\Examples\MCU-LINK\Objects\CMSIS_DAP.hex into the scripts sub-directory of your MCU-LINK_installer installation (default: C:\nxp\MCU-LINK_installer\scripts).
    4. Execute Update: Open a Command Window, navigate to the scripts directory, and run the programming command.

    Note: CMSIS-DAP v2 uses USB bulk endpoints for faster communication with the host PC and can optionally support streaming SWO trace via an additional USB endpoint.

  8. Build and run CMSIS-Core Validation tests

    develop

    Use the build.py script to build and execute tests for specific configurations. You must specify the compiler (-c), the device (-d), and the optimization level (-o). You can optionally pass build and run as arguments to control the execution flow.

    Command Syntax:

    ./build.py -c <compiler> -d <device> -o <optimize> [build] [run]

    Example: To build and run the tests using GCC for Cortex-M3 with low optimization:

    ./build.py -c GCC -d CM3 -o low build run

    Outputs:

    • The test results are written to a JUnit report file named: Core_Validation-<compiler>-<optimize>-<device>-<timestamp>.junit.
    CMSIS_5/CMSIS/CoreValidation/Project $ ./build.py -c GCC -d CM3 -o low build run
  9. Generate CMSIS Pack and Documentation

    develop

    To generate a complete CMSIS pack or documentation from the source repository on a Windows PC, you must have the following tools installed:

    • doxygen.exe (Version 1.8.6 or compatible)
    • mscgen.exe (Version 0.20)
    • 7z.exe (7-Zip) (Version 16.02)

    Tasks

    Generate CMSIS Documentation Run the gen_doc.sh batch file located in ./CMSIS/Doxygen.

    Generate CMSIS Software Pack Run the gen_pack.sh batch file located in ./CMSIS/Utilities.

    Note: The gen_pack.sh script does not generate documentation, and pre-built libraries for RTX4 and RTX5 are not included in this repository.

  10. Locate the CMSIS-NN repository

    develop

    The CMSIS-NN component has been moved from the cmsis_5 repository to its own dedicated repository. For the latest version and development, visit ARM-software/CMSIS-NN.

    Note for users of pre-TFLM quantization APIs: If your project relies on older pre-TensorFlow Lite Micro (TFLM) quantization APIs, you should use the 5.9.0 release of the cmsis_5 repository, as these APIs are no longer present in the standalone CMSIS-NN repository.