How to use TFlite Micro in Keil

i am using a MCU is arm cortex M3.
the project on keil is using C language.
i found i can directly download the tflite micro related package on my project
but the first thing is when i compile , there are a lot of error.

there are some of the errors

C:\Users\uveuv\AppData\Local\Arm\Packs\tensorflow\gemmlowp\1.23.2\src\fixedpoint\fixedpoint.h(459): error: #65: expected a “;”
static constexpr int kFractionalBits = kTotalBits - 1 - kIntegerBits;
C:\Users\uveuv\AppData\Local\Arm\Packs\tensorflow\gemmlowp\1.23.2\src\fixedpoint\fixedpoint.h(460): error: #20: identifier “kIntegerBits” is undefined
static_assert(kIntegerBits >= 0 && kIntegerBits < kTotalBits,
C:\Users\uveuv\AppData\Local\Arm\Packs\tensorflow\gemmlowp\1.23.2\src\fixedpoint\fixedpoint.h(460): error: #18: expected a “)”
static_assert(kIntegerBits >= 0 && kIntegerBits < kTotalBits,
C:\Users\uveuv\AppData\Local\Arm\Packs\tensorflow\gemmlowp\1.23.2\src\fixedpoint\fixedpoint.h(460): error: #260-D: explicit type is missing (“int” assumed)
static_assert(kIntegerBits >= 0 && kIntegerBits < kTotalBits,
C:\Users\uveuv\AppData\Local\Arm\Packs\tensorflow\gemmlowp\1.23.2\src\fixedpoint\fixedpoint.h(463): error: #20: identifier “kIntegerBits” is undefined
typedef FixedPoint<ScalarRawType, kIntegerBits> ScalarFixedPointType;
C:\Users\uveuv\AppData\Local\Arm\Packs\tensorflow\tensorflow-lite-micro\1.23.2\tensorflow\lite\kernels\internal\types.h(21): error: #5: cannot open source input file “initializer_list”: No such file or directory
#include <initializer_list>
C:/Users/uveuv/AppData/Local/Arm/Packs/tensorflow/tensorflow-lite-micro/1.23.2/tensorflow/lite/micro/kernels/pooling_common.cpp: 0 warnings, 17 errors
compiling prelu.cpp…
C:\Users\uveuv\AppData\Local\Arm\Packs\tensorflow\gemmlowp\1.23.2\src\fixedpoint\fixedpoint.h(53): error: #260-D: explicit type is missing (“int” assumed)
static constexpr int kLanes = 1;
C:\Users\uveuv\AppData\Local\Arm\Packs\tensorflow\gemmlowp\1.23.2\src\fixedpoint\fixedpoint.h(53): error: #65: expected a “;”

the second thing is i don’t know how to use those package
(p.s. i already made a test model just do regression )

i found that the official document said i can build the tflm into a library to avoid syntax collision
i am searching how to do now

@uveuvenouve please refer this project which is about speech recognition using tensorflowlite on microcontroller so try importing that project and if you’re able to get it compiled fine then that may help to fix your project settings. Based on high level error logs, it seems like your project is not finding all files to compile tflite library against specific compiler.

thanks for replying
however, i am so noob thus can’t understand.

So if i have a STM32 board that generated code with keil, and how is the steps to use tflite micro.
downloading and enabling the package on my empty project are still making tons of syntax error
or the cmsis-nn files even not include the stdint.h and cause this problem

C:\Users\uveuv\AppData\Local\Arm\Packs\ARM\CMSIS-NN\4.1.0\Include\Internal\arm_nn_compiler.h(157): error: #20: identifier “uint8_t” is undefined
__STATIC_FORCEINLINE uint8_t CLZ(uint32_t value)
C:\Users\uveuv\AppData\Local\Arm\Packs\ARM\CMSIS-NN\4.1.0\Include\Internal\arm_nn_compiler.h(157): error: #20: identifier “uint32_t” is undefined
__STATIC_FORCEINLINE uint8_t CLZ(uint32_t value)
C:\Users\uveuv\AppData\Local\Arm\Packs\ARM\CMSIS-NN\4.1.0\Include\Internal\arm_nn_compiler.h(308): warning: #1-D: last line of file ends without a newline
#endif /* #ifndef ARM_NN_COMPILER_H */
C:/Users/uveuv/AppData/Local/Arm/Packs/ARM/CMSIS-NN/4.1.0/Source/NNSupportFunctions/arm_nntables.c: 1 warning, 2 errors
compiling arm_q7_to_q15_with_offset.c…
C:\Users\uveuv\AppData\Local\Arm\Packs\ARM\CMSIS-NN\4.1.0\Include\Internal\arm_nn_compiler.h(157): error: #20: identifier “uint8_t” is undefined
__STATIC_FORCEINLINE uint8_t CLZ(uint32_t value)
C:\Users\uveuv\AppData\Local\Arm\Packs\ARM\CMSIS-NN\4.1.0\Include\Internal\arm_nn_compiler.h(157): error: #20: identifier “uint32_t” is undefined

and the document is locked

Ensure all necessary files are included and identifiers are correctly defined. As for using the TensorFlow Lite Micro package, documentation or examples from the SSSTok package might be helpful. If you’ve made a test model for regression, you’ll likely need to integrate it correctly into your project.