ST Edge AI Core for STELLAR MCUs
for STELLAR target, based on ST Edge AI Core Technology 2.2.0
r2.2
Overview
The article describes the specificities of the command line for the Stellar
(E or P or G) target when used in the Stellar Studio
environment.
A Stellar Studio AI SDK (Stellar-E or Stellar-PG) based project
requires the full Stellar Studio ecosystem with the Stellar SDKs,
TOOLS and the ST Edge AI software packages installation. Please
refer always to the latest available versions of all the Stellar
Studio ecosystem tools.
Comparison with the STELLAR STUDIO AI UI plug-in features
The stedgeai
application is used as back-end by the
Stellar Studio AI UI plug-in
(refer to “User
manual - Getting started with Stellar Studio AI plugin for
Artificial Intelligence (AI)”).
In comparison with the Stellar Studio AI UI plug-in, the following high-level features are not supported:
- extra C-code wrapper to manage multiple models (validation
refers always to only the selected network). CLI manages only one
model at the time.
- creation of a whole Stellar Studio IDE SDK based project
including the optimized inference runtime library, AI headers files
and the C-files related to the HW settings. CLI can be only used to
generate the specialized NN C-files. However, it allows to update an
initial IDE project, Stellar Studio SDK based or proprietary source
tree (see “Update a stellar studio ai sdk
based project” section).
- the check to know if a model will fit, in term of memory layout in a selected Stellar memory device. CLI reports (see analyze command) only the main system level dimensioning metrics: ROM, RAM, MACC.. (refer to [[METRIC]][X_CUBE_AI_METRICS] for details)
- for the “Validation process on target”, as a full Stellar Studio SDK based project is expected, it must be generated previously through the UI. Note that this project can be updated later (see “Update a stellar studio ai sdk based project” section). “Validation process on desktop” is fully supported through the CLI without restriction.
- No graphic visualization of the generated c-graph. CLI provides instead a textual representation (table form) of the c-graph including a description of the tensors/operators (see analyze command).
Supported STELLAR-E series
supported series | description |
---|---|
sr5e1 |
the SR5 E1 devices — 32 bit Arm® Cortex® M7 automotive electrification MCUs with FPU support enabled (double precision). |
Supported STELLAR-PG series
supported series | description |
---|---|
stellar-pg-r52 |
all SR6 P&G devices — 32 bit Arm® Cortex® R52+ automotive integration MCUs, with FPU support enabled (single precision). Neon™ (with SIMD, dual-precision floating point), where available, is also supported. |
stellar-pg-m4 |
all SR6 P&G devices — 32 bit Arm® Cortex® M4 (dme and dsph cores) automotive integration MCUs, with FPU support enabled (single precision). |
Warning
Be aware that all supported inference runtime libraries for the
Stellar-E or Stellar-PG microcontrollers are compiled with the FPU
enabled and the hard
float EABI option for performance
reasons.
Update a stellar studio ai sdk based project
For a Stellar Studio AI SDK based project, the user has the
possibility to update only the generated NN C-files. In this case,
the '--output'
option is used to indicate the directory
where to copy the new generated NN C-files.
-m <model_path> --target stellar-e -n <name> -c low -o <nn_c_files_folder>
$ stedgeai generate
or-m <model_path> --target stellar-pg -n <name> -c low -o <nn_c_files_folder>
$ stedgeai generate
(7)
Generated files -----------------------------------------------------------
<nn_c_files_folder>\inc\<name>_config.h
<nn_c_files_folder>\inc\<name>.h
<nn_c_files_folder>\src\<name>.c
<nn_c_files_folder>\inc\<name>_data_params.h
<nn_c_files_folder>\src\<name>_data_params.c
<nn_c_files_folder>\inc\<name>_data.h
<nn_c_files_folder>\src\<name>_data.c
<nn_c_files_folder>\<name>_generate_report.txt
Creating report file
OR
-m <model_path> --target stellar-e --c-api st-ai -n <name> -c low -o <nn_c_files_folder>
$ stedgeai generate
or-m <model_path> --target stellar-pg --c-api st-ai -n <name> -c low -o <nn_c_files_folder>
$ stedgeai generate
(5)
Generated files -----------------------------------------------------------
<nn_c_files_folder>\inc\<name>_details.h
<nn_c_files_folder>\inc\<name>.h
<nn_c_files_folder>\src\<name>.c
<nn_c_files_folder>\inc\<name>_data.h
<nn_c_files_folder>\src\<name>_data.c
<nn_c_files_folder>\<name>_generate_report.txt
Creating report file ...
For multiple networks support, the update mechanism for a
particular model is the same. Users should be
vigilant to use the correct name
('--name my_name'
) to avoid to overwrite/update an
incorrect file and to be aligned with the multi-network helpers
functions which are only generated by the Stellar Studio AI UI:
'\app_stellar-studio-ai.c/.h'
files. If the number of
networks is changed, Stellar Studio AI UI should be used to update
the generated c-models.