From 4d61275ffe7a962ea89a09d2789ce59fea375fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85strand?= Date: Mon, 22 Feb 2021 09:50:54 +0100 Subject: Move queue to global memory The FreeRTOS port resets the stack when the scheduler starts. Move the queue to global memory for it to not be overwritten. Change-Id: I98f2360a14a0f74a65353694c6e2f60d37461ecf --- applications/freertos/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/applications/freertos/main.cpp b/applications/freertos/main.cpp index b926d1e..539dff5 100644 --- a/applications/freertos/main.cpp +++ b/applications/freertos/main.cpp @@ -252,9 +252,12 @@ void inferenceJobTask(void *pvParameters) { } // namespace +/* Keep the queue ouf of the stack sinde freertos resets it when the scheduler starts.*/ +QueueHandle_t inferenceProcessQueue; + int main() { // Inference process - QueueHandle_t inferenceProcessQueue = xQueueCreate(10, sizeof(xInferenceJob *)); + inferenceProcessQueue = xQueueCreate(10, sizeof(xInferenceJob *)); xTaskCreate(inferenceProcessTask, "inferenceProcess", 2 * 1024, inferenceProcessQueue, 1, nullptr); // Inference job task -- cgit v1.2.1