diff --git a/nanoFirmwareFlasher/Esp32Operations.cs b/nanoFirmwareFlasher/Esp32Operations.cs index 81f4192f..d702556d 100755 --- a/nanoFirmwareFlasher/Esp32Operations.cs +++ b/nanoFirmwareFlasher/Esp32Operations.cs @@ -125,19 +125,46 @@ internal static async System.Threading.Tasks.Task UpdateFirmwareAsync { var revisionSuffix = "REV0"; var psRamSegment = ""; + var otherSegment = ""; if (esp32Device.ChipName.Contains("revision 3")) { revisionSuffix = "REV3"; } + if (esp32Device.Crystal.StartsWith("26")) + { + // this one requires the 26MHz version + // and we only have a PSRAM version for this + + // check that + if (esp32Device.PSRamAvailable != PSRamAvailability.Yes) + { + Console.ForegroundColor = ConsoleColor.Red; + + Console.WriteLine(""); + Console.WriteLine("The connected ESP32 device has a 26MHz crystal and no PSRAM."); + Console.WriteLine("We currently don't have a firmware image for that combination. Please report this to the project team."); + Console.WriteLine(""); + + Console.ForegroundColor = ConsoleColor.White; + + return ExitCodes.E9000; + } + + // OK to force rev0 even if that's higher + revisionSuffix = "REV0"; + + otherSegment = "_XTAL26"; + } + if (esp32Device.PSRamAvailable == PSRamAvailability.Yes) { psRamSegment = "_PSRAM"; } // compose target name - targetName = $"ESP32{psRamSegment}_{revisionSuffix}"; + targetName = $"ESP32{psRamSegment}{otherSegment}_{revisionSuffix}"; } } else if (esp32Device.ChipType == "ESP32-S2")