fix: TLite V2 is using another MCU (#3789)

* fix: TLite V2 is using another MCU

* fix: exclude MCU check from bootloader

* chore: add explanation comment

* fix : comment in wrong place
This commit is contained in:
3djc
2023-07-12 10:10:19 +10:00
committed by GitHub
parent efd580e0ea
commit c5aa250dd9
+12 -1
View File
@@ -99,10 +99,15 @@ void toggleLatencySwitch()
void checkValidMCU(void) void checkValidMCU(void)
{ {
#if !defined(SIMU) #if !defined(SIMU) && !defined(BOOT)
// Checks the radio MCU type matches intended firmware type // Checks the radio MCU type matches intended firmware type
uint32_t idcode = DBGMCU->IDCODE & 0xFFF; 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) #if defined(STM32F205xx)
#define TARGET_IDCODE 0x411 #define TARGET_IDCODE 0x411
#elif defined(STM32F407xx) #elif defined(STM32F407xx)
@@ -116,10 +121,16 @@ void checkValidMCU(void)
#define TARGET_IDCODE 0x0 #define TARGET_IDCODE 0x0
#endif #endif
#if defined(TARGET_IDCODE_SECONDARY)
if(idcode != TARGET_IDCODE && idcode != TARGET_IDCODE_SECONDARY) {
runFatalErrorScreen("Wrong MCU");
}
#else
if(idcode != TARGET_IDCODE) { if(idcode != TARGET_IDCODE) {
runFatalErrorScreen("Wrong MCU"); runFatalErrorScreen("Wrong MCU");
} }
#endif #endif
#endif
} }
void per10ms() void per10ms()