diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 30990adcd..7cf139aae 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -99,10 +99,15 @@ void toggleLatencySwitch() void checkValidMCU(void) { -#if !defined(SIMU) +#if !defined(SIMU) && !defined(BOOT) // Checks the radio MCU type matches intended firmware type uint32_t idcode = DBGMCU->IDCODE & 0xFFF; +#if defined(RADIO_TLITE) + #define TARGET_IDCODE_SECONDARY 0x413 + // Tlite ELRS have a CKS F4 run as an F2 (F4 firmware won't run on those) +#endif + #if defined(STM32F205xx) #define TARGET_IDCODE 0x411 #elif defined(STM32F407xx) @@ -116,10 +121,16 @@ void checkValidMCU(void) #define TARGET_IDCODE 0x0 #endif +#if defined(TARGET_IDCODE_SECONDARY) + if(idcode != TARGET_IDCODE && idcode != TARGET_IDCODE_SECONDARY) { + runFatalErrorScreen("Wrong MCU"); + } +#else if(idcode != TARGET_IDCODE) { runFatalErrorScreen("Wrong MCU"); } #endif +#endif } void per10ms()