Problem while receiving accelerometer data via run impulse command

Hi everyone. I created a new motion recognition project. It contains 12 moves and I have added over 20 minutes long sample. Before that, another project I created is just like the example of continuous motion recognition tutorial video and it worked well in my STM32F407VGT board.

However, this time, when I run “edge-impulse-run-impulse --raw” everything is printed but the classification values. The major difference between these two projects I mentioned is the accuracy of the last project is about 50% as the first one has like 95%. Rest of the others are performed the same. What could the problem be? I really need those classification values.

Hello @oddyses,

How did you flash your board? With the downloaded binary or using CubeAI library?
I had the same issue in one of my code on STM32 SoC where I could not print classified values. I had to convert the float values to int:

// print the predictions
	ei_printf(
			"Predictions (DSP: %d ms., Classification: %d ms., Anomaly: %d ms.): \n",
			result.timing.dsp, result.timing.classification,
			result.timing.anomaly);
	for (size_t ix = 0; ix < EI_CLASSIFIER_LABEL_COUNT; ix++) {
		int val = (int)((result.classification[ix].value * 100) + 0.5);
		ei_printf("    %s: \t %i%%\r\n", result.classification[ix].label, val);
	}

However, I could see the predicted values when I was enabling the debug flag in the run_classifier function:

EI_IMPULSE_ERROR res = run_classifier(&features_signal, &result, true /* debug */);

Regards,

Louis

Okay I solved it. First of all, I use STM32CubeIDE so the library I use is IDE’s default library for my board. The thing is a setting must be changed to use float values in print commands (ei_printf included). Go Project/Properties/C/C++ Build/Settings/MCU settings, then check the "Use float with printf from newlib-nano(-u _printf_float). And it is done.

1 Like