I’ve been trying to run an Image Classifier impulse on my STM32H745I-Disco Board, which has two MCUs: Arm-M4 and Arm-M7. However, even when I try to run a simple use case as in https://docs.edgeimpulse.com/docs/using-cubeai, I keep getting a lot of undefined reference errors (for the functions: ei_calloc, ei_free, ei_malloc, ei_printf_float, ei_read_timer_ms, and ei_run_impulse_check_canceled). I checked where these functions are defined and I only found their prototypes in the ei_classifier_porting.h file.
I’m using STM32CubeIDE, and it seems like an error when including new libraries. If my understanding is correct, when I program a dual-core board such as from the H7 series, then I must treat each MCU as a different CubeIDE project. This seems a bit confusing, below there’s a capture of the errors I’m hitting after following instructions carefully.
Thanks for reaching out. Can you check if the macro EI_PORTING_STM32_CUBEAI is defined in your project. This guards around the implementation of the missing functions.
As seen below, there are two Middlewares folders, one for the general project (in this case, named EI-H745-ImageClassifier), and another one for the project associated with the Arm-M7 MCU (named EI-H745-ImageClassifier_CM7). It looks like the source code for the script ei_classifier_porting.h that is copied into the MCU’s directory, is the one for the HIMAX board, for some reason. I solved the problem by copying the content of the ei_classifier_porting.cpp from the stm32-cubeai folder into the one in the file: EI-H745-ImageClassifier_CM7>Middlewares>MachineLearning>image-classifier>Core>ei_classifier_porting.cpp.
Tried repeating the process again to check if it was an error from my side, but it doesn’t seem to be. Would appreciate if you guys could see if there is something missing when adding the Software Package associated to the .pack file.
However, now I’m hitting another error due to memory allocation, this is what I’m getting, maybe it’s related to the previous issue:
Thanks for the detailed description of the issue and workaround, I was able to reproduce this issue on my end as well.
For the arena issue, that’s most often a legitimate error due to being too low on RAM to load the model. A similar error was actually recently discussed a bit here if you hadn’t already seen it.
Interestingly enough, they didn’t seem to run into the cmsis-pack issue we saw.