Question/Issue: New built model causes compilation error while previous ones didn’t
Project ID:265837
Context/Use case:
Hello Edge Impulse team!
I’m working on Key Word Spotting demo project and already have 4 versions of models sucessfully integrated to the FW. My environment is:
HW: nRF52 devkit based on nRF52832
IDE: Segger Embedded Studio V7.10 (also tried the most recent V7.32)
Edge Impulse export type: C++ library for generic Cortex M4F MCU (also tried for nRF52840 with the same result)
I used to create model, include the exported code to my template project and sucessfully run it. But starting from the some point exported code started to throw compiling errors like this (file cinttypes):
I also noticed that files in \libedgeimpulse\edge-impulse-sdk\tensorflow\lite\micro directory have changed and added some new ones. I suspect that new edge-impulse-sdk code uses some features from standard C++ libraries that are not supported by C++ libraries included to Segger Embedded Studio packet. I tried to install the latest SES version and checked C++ libraries version in package manager, everything seems up to date. Looks like SES supports C++17 as maximum, do you use more recent standard in your code?
How can I handle this issue?
Any help is appreciated!
Thanks!
Hi @Dmitriy_L
Our SDK requires only C++11 features.
We are not supporting Segger Embedded Studio, but it looks like you are missing some files in your project and/or preprocessor definitions.
From my experience, such IDEs, like SES or Eclipse-based, are very error-prone to what is listed on their explorer file list. So, please check carefully if you have all files from our SDK added. As you noted, we recently upgraded the TFLite Micro library which is a part of our SDK. So, some new files were added, some may be removed, etc.
Please take a look at our simple C++ example as a reference: GitHub - edgeimpulse/example-standalone-inferencing: Builds and runs an exported impulse locally (C++)
P.S.
I tried to import an example KWS project freshly deployed from our Studio to SES with a simple C++ inference example, and it builds fine (after adding some defines, including paths, etc.)
Thank you for responce! In my project all code related to Edge Impulse SDK is compiling separately from application code and then included as a library in entire solution. Sources are added to project automatically by recursive search through sdk directories, however you were right, it missed a couple of files. Unfortunately it did not solved the problem, I did some more search and figured out that errors i described in start topic appeared in cinntypes file included to micro_profiler.cc Here is comparison of old and new version of this file.
I commented out cinttypes and project sucessfully built, inference working and able to recognize keywords.
I understand that it’s kinda dirty trick and sdk code must remain untouched by user. Just curious what the purpose of including cinttypes as the project can work without it and why it caused errors.
Hi @Dmitriy_L
This header file was pulled in from the TFLite micro codebase. It should be a part of the standard C++ library in C++11 and newer. We are checking if this could be removed, but first, I recommend checking if that is not an SES error.
What compiler do you use in your project, Segger or GNU GCC?
I see there were some issues in the past with Segger compiler regarding the inttypes library.
I’m using GNU GCC compiiler.
Path to the standard C++ library directory is correct, at least rest of included files from the same directory as cinttypes are accessible.
I tried additionally 2 another models. Both are successfully built if cinttypes commented out. So this solution works for me.
Many thanks for your help!