Example #1
0
        public ESPxxOpenOCDSettingsEditor(IBSPConfiguratorHost host, string baseDir, ESPxxOpenOCDSettings settings, KnownInterfaceInstance context, bool isESP32)
            : base(host, baseDir, settings ?? (isESP32 ? (OpenOCDSettings) new ESP32OpenOCDSettings() : new ESP8266OpenOCDSettings()), context)
        {
            IsESP32             = isESP32;
            Device.SelectedItem = new ScriptSelector <QuickSetupDatabase.TargetDeviceFamily> .Item {
                Script = isESP32 ? "target/esp32.cfg" : "target/esp8266.cfg"
            };
            if (settings == null)
            {
                ExplicitFrequencyEnabled = true;
                if (!isESP32)
                {
                    AutofeedWatchdog        = true;
                    NoInterruptsDuringSteps = true;
                }
            }

            var loadCommand = ProvideLoadCommand();
            var idx         = Settings.StartupCommands.IndexOf("mon reset halt");

            if (idx < 0 || idx > loadCommand)
            {
                Settings.StartupCommands.Insert(loadCommand, "mon reset halt");
            }

            if (Settings.FLASHResources != null)
            {
                foreach (var r in Settings.FLASHResources)
                {
                    FLASHResources.Add(r);
                }
            }

            FLASHResources.CollectionChanged += (s, e) => { Settings.FLASHResources = FLASHResources.ToArray(); OnPropertyChanged(nameof(FLASHResources)); };
        }
Example #2
0
        public ESPxxOpenOCDSettingsEditor(IBSPConfiguratorHost host, string baseDir, ESPxxOpenOCDSettings settings, KnownInterfaceInstance context, bool isESP32)
            : base(host, baseDir, settings ?? (isESP32 ? (OpenOCDSettings) new ESP32OpenOCDSettings() : new ESP8266OpenOCDSettings()), context)
        {
            IsESP32 = isESP32;

            _ESPIDFMode = host.MCU.Configuration.ContainsKey("com.sysprogs.esp32.idf.sdkconfig");

            Device.SelectedItem = new ScriptSelector <QuickSetupDatabase.TargetDeviceFamily> .Item {
                Script = isESP32 ? "target/esp32.cfg" : "target/esp8266.cfg"
            };
            if (settings == null)
            {
                ExplicitFrequencyEnabled = true;
                if (!isESP32)
                {
                    AutofeedWatchdog        = true;
                    NoInterruptsDuringSteps = true;
                }
            }

            var loadCommand = ProvideLoadCommand();
            var idx         = Settings.StartupCommands.IndexOf("mon reset halt");

            if (idx < 0 || idx > loadCommand)
            {
                Settings.StartupCommands.Insert(loadCommand, "mon reset halt");
            }

            if (Settings.SuggestionLogicRevision < SuggestionLogicRevision)
            {
                if (isESP32 && Settings.StartupCommands.IndexOf(BreakpointFixCommand) == -1)
                {
                    Settings.SuggestionLogicRevision = SuggestionLogicRevision;
                    for (int i = 0; i < Settings.StartupCommands.Count; i++)
                    {
                        if (Settings.StartupCommands[i].StartsWith("target "))
                        {
                            Settings.StartupCommands.Insert(i + 1, BreakpointFixCommand);
                            break;
                        }
                    }
                }
            }

            if (Settings.FLASHResources != null)
            {
                foreach (var r in Settings.FLASHResources)
                {
                    FLASHResources.Add(r);
                }
            }

            FLASHResources.CollectionChanged += (s, e) => { Settings.FLASHResources = FLASHResources.ToArray(); OnPropertyChanged(nameof(FLASHResources)); };
        }
Example #3
0
 public ESP8266GDBStub(ESP8266DebugController controller, DebugStartContext context, OpenOCDCommandLine cmdLine, IExternalToolInstance tool, ESPxxOpenOCDSettings settings, int gdbPort, int telnetPort, string temporaryScript)
     : base(cmdLine, tool, settings, gdbPort, telnetPort, temporaryScript)
 {
     _Controller = controller;
     _Context    = context;
 }