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.
- 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