How to upgrade a STM32 project
for STM32 target, based on ST Edge AI Core Technology 2.2.0
r1.1
Overview
This article describes how to upgrade a STM32CubeMX-based or proprietary source tree with a new version of the X-CUBE-AI library. The update of generated c-model files is described in the “Update an ioc-based project” section. For the interface between them, backward or/and forward compatibility is never considered, if the generated c-model files are updated with a new version of the X-CUBE-AI tools, the X-CUBE-AI library files should be also aligned. Without specific notification/advice, (see [“API Breaking changes”][X_CUBE_AI_API_BREAK] article [[BREAK]][X_CUBE_AI_API_BREAK]) at source level, no breaking change to the [embedded inference API][X_CUBE_AI_API] that can break the client’s application is expected.
Typical source tree (%ROOT_PRJ_DIR%
indicates the
root directory of the project):
If the project source tree has been generated through a STM32CubeMX-based project with the X-CUBE-AI expansion pack, the IOC-file can be re-load to update the project including a new version of the X-CUBE-AI pack.
Command to update the c-model files with the CLI:
<my_model> <my_options> -o %ROOT_PRJ_DIR%/model/ $ stm32ai generate
Manual update
The C-header files and network runtime library can be directly
copied from the X-CUBE-AI pack.
[%X_CUBE_AI_DIR%
][X_CUBE_AI_SETTING] indicates the root
location where the X-CUBE-AI pack is installed.
directory | contains |
---|---|
%X_CUBE_AI_DIR%/Middlewares/ST/AI/Inc |
all C-header files requested to build the generated c-model files |
%X_CUBE_AI_DIR%/Middlewares/ST/AI/Lib |
by STM32 series and by IDE, the network runtime libraries |
tool-chain | contains |
---|---|
ABI2.1 | the library for the IAR Embedded Workbench® IDE - ARM v8.x tool-chain |
GCC | the library for the GNU ARM Embedded-based project - STMicroelectronics - STM32CubeIDE version 1.0.1 or late |
MDK | the library for the Keil® - MDK-ARM Professional Version - µVision® V5.25.2.0 tool-chain |
In each <tool-chain>
directory, this is one
sub-directory by STM32 series. According the targeted STM32 device,
specialized STM32 series should be selected first else generic STM32
Cortex M should be used.
STM32 | for which STM32 device |
---|---|
STM32WL | specialized library for the STM32WLxx devices |
STM32MP1 | specialized library for the CortexM4 core inside a STM32MP1 device |
STM32H7 | specialized library for the STM32H7xx devices |
ARMCortexM4 | generic library for the STM32 devices based on the ARM Cortex M4, STM32F3xx, STM32L4xx, STM32F4xx |
ARMCortexM7 | generic library for the STM32 devices based on the ARM Cortex M7, STM32F7xx |
ARMCortexM33 | generic library for the STM32 devices based on the ARM Cortex M33, STM32L5xx, STM32U5xx |
Warning
When the project source tree is updated, don’t forget to update also the associated build system to use the new library file.
Note
Library files with the name suffixed with _PIC
should be not used.
Upgrading the X-CUBE-AI library for a STM32F411 device and GCC-base build system
# remove the previous files
rm %ROOT_PRJ_DIR%/Middelwares/ST/AI/Inc/*.h
rm %ROOT_PRJ_DIR%/Middelwares/ST/AI/Lib/*.a
# copy the new files
cp %X_CUBE_AI_DIR%/Middlewares/ST/AI/Inc/* %ROOT_PRJ_DIR%/Middelwares/ST/AI/Inc/
cp %X_CUBE_AI_DIR%/Middlewares/ST/AI/Lib/GCC/ARMCortexM4/NetworkRuntime700_CM4_GCC.a
%ROOT_PRJ_DIR%/Middelwares/ST/AI/Lib/
Upgrading the X-CUBE-AI library for a STM32H7xx device and Keil IDE
# remove the previous files
rm %ROOT_PRJ_DIR%/Middelwares/ST/AI/Inc/*.h
rm %ROOT_PRJ_DIR%/Middelwares/ST/AI/Lib/*.a
# copy the new files
cp %X_CUBE_AI_DIR%/Middlewares/ST/AI/Inc/* %ROOT_PRJ_DIR%/Middelwares/ST/AI/Inc/
cp %X_CUBE_AI_DIR%/Middlewares/ST/AI/Lib/MDK/STM32H7/NetworkRuntime700_CM7_Keil.lib
%ROOT_PRJ_DIR%/Middelwares/ST/AI/Lib/