Skip to content

Commit 79d0082

Browse files
committed
Align tensorArena in IMU_Classifier to 16 bytes
The TensorFlowLite library checks that the supplied arena memory is aligned to 16 bytes, and crashes if it is not. This change ensures the memory is aligned as expected.
1 parent 5f17cac commit 79d0082

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

GestureToEmoji/ArduinoSketches/IMU_Classifier/IMU_Classifier.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ TfLiteTensor* tflOutputTensor = nullptr;
5050
// Create a static memory buffer for TFLM, the size may need to
5151
// be adjusted based on the model you are using
5252
constexpr int tensorArenaSize = 8 * 1024;
53-
byte tensorArena[tensorArenaSize];
53+
byte tensorArena[tensorArenaSize] __attribute__((aligned(16)));
5454

5555
// array to map gesture index to a name
5656
const char* GESTURES[] = {

0 commit comments

Comments
 (0)