Question/Issue:
[Describe the question or issue in detail]
After importing the CMSIS pack exported from Edge Impulse into Keil, it can only run in debug mode. Moreover, After debugging and running to ‘EI_IMPULSE_ERROR res = run_classifier(&features_signal, &result, true);’
the serial port reports an error: ERR: Failed to run DSP process (-1002) run_classifier returned: -5
Thanks for any advice in advance!
looking into error -1002 in the code it looks like enum constant for -1002 is EIDSP_OUT_OF_MEM which would imply that you do not have enough of heap memory for DSP process to allocate for its work.
HI @Mickey_C ,
Thank you for the reminder. According to the error code, that’s correct, but the chart shows the RAM and ROM usage of my model. In reality, the STM32F407VET6 has much larger capacity than this.
oh! I modified the stack size in the startup file, and it ran. Before, I never adjusted it.I don’t have this concept, naively thinking that having a large memory would be enough.
thk u @Mickey_C .
just a quick look into the code shows that that error is most likely caused by ei_malloc or ei_calloc functions failing, which do try to allocate memory dynamically from heap.
I don’t know if you changed heap size in startup, or stack, as stack is used for different purposes,
You might want to figure out what exactly went wrong, otherwise, you might be on limit of something that works by accident and will cause problems later on.