Digit Recognition AI/ML Application on SAM E51 IGAT Curiosity Evaluation Kit using MPLAB Harmony v3: Step6

Step 6.1: Configure TensorFlow Lite for Microcontroller

The TensorFlow Lite for Microcontroller (TFLite Micro) block is added to enable the TFLite Micro runtime engine and the TFLite Micro library to run the Digit Recognition Machine Learning Model on SAM E51 MCU.


Under the left tab Resource Management (MCC), go to Device Resources and expand Libraries > Third Party Libraries > Tensor Flow.

Click on the green_plus.png symbol beside TFLite Micro to add the TFLite Micro library to the project.


Select the TFLite Micro in the Project Graph and verify the default TFLite Micro library configuration on Configuration Options.



  • The CMSIS-NN Library check box enables the TFLite Micro library to override the default floating-point mathematical operations to use integer quantized CMSIS neural network functions.
  • This option works only when the model is converted to TFLite format with 8-bit integer quantization, and the CMSIS NN library package is added to the project; otherwise, the TFLite Micro library uses the default floating-point mathematical functions.

Step 6.2: Configure CMSIS NN Package


The CMSIS is added by default to the project graph. Select the CMSIS in the Project Graph and configure the CMSIS pack on the Configuration Options.

  • CMSIS DSP software library is a set of common signal processing functions for use on Cortex®-M and Cortex-A processor-based devices.
  • The CMSIS NN is a software library, it is a collection of developed neural network kernels to maximize the performance and minimize the memory footprint of neural networks on Cortex-M processor cores. The library has several functions like,
    • Convolution Functions
    • Activation Functions
    • Fully-connected Layer Functions
    • SVDF Layer Functions
    • Pooling Functions
    • Softmax Functions
    • Basic math Functions

Also, the library has separate functions to work on different weight and activation data types including 8-bit integers and 16-bit integers.

  • These library APIs are used by the TFLite model to implement the machine learning capabilities in the application.

Step 6.3: Configure STDIO library

  • Ensure you add and configure the STDIO library to enable debug message printing on a serial console. This is needed to enable error message printing from the TFLte library, which maps the macro TF_LITE_REPORT_ERROR to the printf function.
  • STDIO is already configured with SECOM2 in Step 2.1

Next Step >

© 2022 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.