From 1a260cc4b202269c1aaf414328c50df778f71d8c Mon Sep 17 00:00:00 2001 From: Kristoffer Richardsson Date: Mon, 20 Mar 2023 11:28:16 +0100 Subject: [PATCH] Initialize mem sub system before decks --- src/modules/src/crtp_mem.c | 2 ++ src/modules/src/system.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/src/crtp_mem.c b/src/modules/src/crtp_mem.c index 43311580a1..266a9bb2f0 100644 --- a/src/modules/src/crtp_mem.c +++ b/src/modules/src/crtp_mem.c @@ -111,6 +111,8 @@ static void memTask(void* param) { // there might be late arrivals for the registration that will // trigger assert. + systemWaitStart(); + // Do not allow registration of new handlers after this point as clients now can start // to query for available memories memBlockHandlerRegistration(); diff --git a/src/modules/src/system.c b/src/modules/src/system.c index 5f8bf92b59..b822b873c4 100644 --- a/src/modules/src/system.c +++ b/src/modules/src/system.c @@ -209,6 +209,7 @@ void systemTask(void *arg) // This should probably be done later, but deckInit() takes a long time if this is done later. uartslkEnableIncoming(); + memInit(); deckInit(); estimator = deckGetRequiredEstimator(); stabilizerInit(estimator); @@ -217,7 +218,6 @@ void systemTask(void *arg) platformSetLowInterferenceRadioMode(); } soundInit(); - memInit(); crtpMemInit(); #ifdef PROXIMITY_ENABLED @@ -279,6 +279,10 @@ void systemTask(void *arg) pass = false; DEBUG_PRINT("mem [FAIL]\n"); } + if (crtpMemTest() == false) { + pass = false; + DEBUG_PRINT("CRTP mem [FAIL]\n"); + } if (watchdogNormalStartTest() == false) { pass = false; DEBUG_PRINT("watchdogNormalStart [FAIL]\n");