I am trying to run the Edge Impulse C++ library on the MAX32660 microcontroller, which I’ve been developing on using the Maxim SDK. The Maxim SDK toolchain is completely in C and so I’m stuck trying to figure out how to get the C++ library to work in C.
I have been trying to convert the Maxim SDK code so I can use a C++ compiler, but I wanted to see if anyone knew (maybe in broad strokes) how to use this C++ library in C code.
It seems to me that the Makefile in the example is looking for the downloaded library folders, so I would unzip and copy in the “edge-impule-sdk”, “tflite-model”, and “model-parameters” folders into the project layout shown on Github. At this point, would I need to modify my current Makefile to include the g++ compiler and all the other sources as shown in the example? I’m not familiar with Makefile configurations, so I’d appreciate some guidance over which are the important parts and/or if this example will still work when I cross compile for a microcontroller.
I got the same integration problem on my project. On way I was thinking of going arround this by building the C++ code generated from edge impulse into a .a or .lib shared library file (standelone project) and link that artifact to the C project with the headers files (necessary for the compiler the symbol defined in the lib object). I did not implemented it so I don’t know if it is feasible.
We had to enable extra features and limitations at the same time, complete list of the defines that we use for C standalone inferencing on PSoC62 can be found below. Please take a look and let me know if you have more questions.
additional defines to the build process for C standalone inferencing on PSoC 62
It is target specific and sometimes adding EIDSP_SIGNAL_C_FN_POINTER=1 and EI_C_LINKAGE=1 is not enough, therefore I encourage you to open a dedicated forum topic where we could discuss what is your use case, SDK, hardware and exact issue(compiler error). I am happy to help
Thank you for the suggestions. I decided to use C++ as I realized I could build and link C++ code successfully with the MaximSDK libraries. For anyone else in the future who is interested, the iostream.h library does not work in the MaximSDK toolchain, as of right now, but using the default GNU tools compiles C/C++ code using gcc/g++ properly.
I did end up running into a lot more issues trying to modify the Makefile and getting the C++ library to work properly, but I’ve started a new thread for that issue as it’s rather different.