public ESPxxGDBStubSettingsControl(IBSPConfiguratorHost host, ICustomSettingsTypeProvider provider)
 {
     host.InstallStyles(this);
     InitializeComponent();
     TypeProvider = provider;
     _Host        = host;
 }
        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)); };
        }
        public ESPxxGDBStubSettingsEditor(ESPxxGDBStubSettingsBase settings, KnownInterfaceInstance context, IBSPConfiguratorHost host, bool esp32Mode)
        {
            _Context = context;
            _Host    = host;
            IsESP32  = esp32Mode;
            Settings = settings;
            if (Settings == null)
            {
                if (esp32Mode)
                {
                    Settings = new ESP32GDBStubSettings();
                }
                else
                {
                    Settings = new ESP8266GDBStubSettings();
                }
            }

            if (context.COMPortNumber.HasValue)
            {
                Settings.COMPort          = "COM" + context.COMPortNumber;
                COMPortSelectorVisibility = Visibility.Collapsed;
            }

            if (Settings.FLASHResources != null)
            {
                foreach (var r in Settings.FLASHResources)
                {
                    FLASHResources.Add(r);
                }
            }
            FLASHResources.CollectionChanged += (s, e) => { Settings.FLASHResources = FLASHResources.ToArray(); OnSettingsChanged(); };
        }
        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)); };
        }
        public XDSDebugMethodConfigurator(XDSDebugController debugController, LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host)
        {
            host.InstallStyles(this);

            InitializeComponent();
            _DebugController = debugController;
            _Method          = method;
            _Host            = host;

            SetConfiguration(null, default(KnownInterfaceInstance));
        }
Exemple #6
0
        public ESPxxOpenOCDSettingsControl(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host, ICustomSettingsTypeProvider typeProvider, bool isESP32)
        {
            _Method      = method;
            _Host        = host;
            _IsESP32     = isESP32;
            TypeProvider = typeProvider;
            host.InstallStyles(this);
            InitializeComponent();

            host.MakeSearchableComboBox(InterfaceComboBox, (i, f) => _Editor?.FilterItem(i, f) ?? false, Resources["interfaceScriptSelectionControl"]);
        }
Exemple #7
0
        public RISCVOpenOCDSettingsControl(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host, RISCVOpenOCDDebugController controller)
        {
            _Method      = method;
            _Host        = host;
            TypeProvider = _Controller = controller;
            host.InstallStyles(this);

            InitializeComponent();

            host.MakeSearchableComboBox(InterfaceComboBox, (i, f) => _Editor?.FilterItem(i, f) ?? false, Resources["interfaceScriptSelectionControl"]);
            host.MakeSearchableComboBox(DeviceComboBox, (i, f) => _Editor?.FilterItem(i, f) ?? false, Resources["deviceScriptSelectionControl"]);
        }
Exemple #8
0
        public override object TryConvertLegacyConfiguration(IBSPConfiguratorHost host, string methodDirectory, Dictionary <string, string> legacyConfiguration)
        {
            ESPxxOpenOCDSettingsEditor editor = new ESPxxOpenOCDSettingsEditor(host, methodDirectory, null, default(KnownInterfaceInstance), _IsESP32);
            string value;

            if (legacyConfiguration.TryGetValue("com.sysprogs.esp8266.openocd.iface_script", out value))
            {
                editor.ReplaceScript(true, value);
            }
            else
            {
                return(null);    //Not an OpenOCD configuration
            }
            editor.RebuildStartupCommands();

            if (editor.FLASHSettings is ESP8266BinaryImage.ESP8266ImageHeader hdr8266)
            {
                if (legacyConfiguration.TryGetValue("com.sysprogs.esp8266.xt-ocd.flash_size", out value))
                {
                    hdr8266.Size = ESP8266BinaryImage.ParseEnumValue <ESP8266BinaryImage.FLASHSize>(value);
                }
                if (legacyConfiguration.TryGetValue("com.sysprogs.esp8266.xt-ocd.flash_mode", out value))
                {
                    hdr8266.Mode = ESP8266BinaryImage.ParseEnumValue <ESP8266BinaryImage.FLASHMode>(value);
                }
                if (legacyConfiguration.TryGetValue("com.sysprogs.esp8266.xt-ocd.flash_freq", out value))
                {
                    hdr8266.Frequency = ESP8266BinaryImage.ParseEnumValue <ESP8266BinaryImage.FLASHFrequency>(value);
                }
            }
            else if (editor.FLASHSettings is ESP8266BinaryImage.ESP32ImageHeader hdr32)
            {
                if (legacyConfiguration.TryGetValue("com.sysprogs.esp8266.xt-ocd.flash_size", out value))
                {
                    hdr32.Size = ESP8266BinaryImage.ParseEnumValue <ESP8266BinaryImage.ESP32FLASHSize>(value);
                }
                if (legacyConfiguration.TryGetValue("com.sysprogs.esp8266.xt-ocd.flash_mode", out value))
                {
                    hdr32.Mode = ESP8266BinaryImage.ParseEnumValue <ESP8266BinaryImage.FLASHMode>(value);
                }
                if (legacyConfiguration.TryGetValue("com.sysprogs.esp8266.xt-ocd.flash_freq", out value))
                {
                    hdr32.Frequency = ESP8266BinaryImage.ParseEnumValue <ESP8266BinaryImage.FLASHFrequency>(value);
                }
            }

            if (!legacyConfiguration.TryGetValue("com.sysprogs.esp8266.xt-ocd.program_flash", out value) || string.IsNullOrEmpty(value))
            {
                editor.ProgramMode = ProgramMode.Disabled;
            }

            return(editor.Settings);
        }
        internal RedLinkSettingsControl(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host, RedLinkDebugController debugController)
        {
            host.InstallStyles(this);

            Controller = new ControllerImpl(method, host, debugController, this);
            InitializeComponent();

            host.MakeSearchableComboBox(DeviceComboBox, (i, f) => Controller.FilterItem(i, f), Resources["deviceScriptSelectionControl"]);

            _ServerCheckTimer = new DispatcherTimer(TimeSpan.FromMilliseconds(500), DispatcherPriority.Normal, (s, e) => Controller.UpdateServerStatus(), Dispatcher)
            {
                IsEnabled = false
            };
            Loaded           += (s, e) => _ServerCheckTimer.IsEnabled = true;
            Unloaded         += (s, e) => _ServerCheckTimer.IsEnabled = false;
            IsVisibleChanged += (s, e) => _ServerCheckTimer.IsEnabled = IsVisible;
        }
            internal ControllerImpl(LoadedBSP.LoadedDebugMethod method,
                                    IBSPConfiguratorHost host,
                                    RedLinkDebugController debugController,
                                    object control)
            {
                _Method      = method;
                _Host        = host;
                TypeProvider = debugController;

                Control = control;

                ResetMode = new DerivedSetting(this, "--reset=", RedLinkServerCommandLine.SettingMode.Prefix, "SYSRESETREQ/system", "VECTRESET/core", "Software/soft");;;
                Interface = new DerivedSetting(this, "--wire", RedLinkServerCommandLine.SettingMode.Separated, "SWD/swd", "JTAG/jtag");
                Core      = new DerivedSetting(this, RedLinkServerCommandLine.CoreIndex, RedLinkServerCommandLine.SettingMode.Prefix)
                {
                    LoadChoices = GetAvailableCores
                };

                SetConfiguration(null, default);
            }
        public ESPxxGDBStubSettingsEditor(ESPxxGDBStubSettingsBase settings, KnownInterfaceInstance context, IBSPConfiguratorHost host, bool esp32Mode)
        {
            _Context = context;
            _Host    = host;
            IsESP32  = esp32Mode;
            Settings = settings;
            if (Settings == null)
            {
                if (esp32Mode)
                {
                    Settings = new ESP32GDBStubSettings();
                }
                else
                {
                    Settings = new ESP8266GDBStubSettings();
                }
            }

            if (context.COMPortNumber.HasValue)
            {
                Settings.COMPort          = "COM" + context.COMPortNumber;
                COMPortSelectorVisibility = Visibility.Collapsed;
            }
            else if (host.AdvancedModeContext is IExternallyProgrammableProjectDebugContext ectx)
            {
                ExternalCOMPortSelectionHint = ectx.ExternalProgrammingOptionHint;
                if (ExternalCOMPortSelectionHint != null)
                {
                    COMPortSelectorVisibility = DirectFLASHProgrammingOptionVisibility = Visibility.Collapsed;
                }
            }

            if (Settings.FLASHResources != null)
            {
                foreach (var r in Settings.FLASHResources)
                {
                    FLASHResources.Add(r);
                }
            }
            FLASHResources.CollectionChanged += (s, e) => { Settings.FLASHResources = FLASHResources.ToArray(); OnSettingsChanged(); };
        }
        public object TryConvertLegacyConfiguration(IBSPConfiguratorHost host, string methodDirectory, Dictionary <string, string> legacyConfiguration)
        {
            if (legacyConfiguration == null)
            {
                return(null);
            }

            AVaRICEDebugSettings result = new AVaRICEDebugSettings();
            string tmp;

            if (legacyConfiguration.TryGetValue("com.sysprogs.avr.avarice.adapter", out tmp))
            {
                result.DebugAdapterType = tmp;
            }
            else
            {
                return(null);
            }

            if (legacyConfiguration.TryGetValue("com.sysprogs.avr.avarice.iface", out tmp))
            {
                result.DebugInterface = tmp;
            }

            if (legacyConfiguration.TryGetValue("com.sysprogs.avr.avarice.bitrate", out tmp))
            {
                result.DebugBitrate = tmp;
            }

            result.EraseFLASH   = legacyConfiguration.TryGetValue("com.sysprogs.avr.avarice.erase", out tmp) && tmp == "--erase";
            result.ProgramFLASH = legacyConfiguration.TryGetValue("com.sysprogs.avr.avarice.program", out tmp) && tmp == "--program";
            result.VerifyFLASH  = legacyConfiguration.TryGetValue("com.sysprogs.avr.avarice.verify", out tmp) && tmp == "--verify";

            if (legacyConfiguration.TryGetValue("com.sysprogs.avr.avarice.extraargs", out tmp))
            {
                result.ExtraArguments = tmp;
            }

            return(result);
        }
 public virtual ICustomDebugMethodConfigurator CreateConfigurator(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host)
 {
     return(new GUI.RISCVOpenOCDSettingsControl(method, host, this));
 }
Exemple #14
0
 public RISCVOpenOCDSettingsEditor(IBSPConfiguratorHost host, string baseDir, RISCVOpenOCDSettings settings, KnownInterfaceInstance context)
     : base(host, baseDir, settings ?? new RISCVOpenOCDSettings(), context, settings == null)
 {
 }
 public RISCVOpenOCDSettingsEditor(IBSPConfiguratorHost host, LoadedBSP.LoadedDebugMethod method, RISCVOpenOCDSettings settings, RISCVOpenOCDDebugController controller, KnownInterfaceInstance context)
     : base(host, method.Directory, settings, context, controller, settings == null)
 {
 }
Exemple #16
0
 public override ICustomDebugMethodConfigurator CreateConfigurator(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host)
 {
     return(new GUI.ESPxxOpenOCDSettingsControl(method, host, this, _IsESP32));
 }
Exemple #17
0
 public ICustomDebugMethodConfigurator CreateConfigurator(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host) => new XDSDebugMethodConfigurator(this, method, host);
Exemple #18
0
 public ControllerImpl(RenesasDebugSettingsControl control, LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host, RenesasDebugController controller)
 {
     Control      = control;
     TypeProvider = controller;
     _CommandLine = new RenesasGDBServerCommandLine(new RenesasDebugSettings().CommandLineArguments);
 }
 public ICustomDebugMethodConfigurator CreateConfigurator(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host)
 {
     return(new ESP32GDBStubSettingsControl(host, this));
 }
 public virtual object TryConvertLegacyConfiguration(IBSPConfiguratorHost host, string methodDirectory, Dictionary <string, string> legacyConfiguration) => null;
 public ICustomDebugMethodConfigurator CreateConfigurator(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host)
 {
     return(new GUI.RedLinkSettingsControl(method, host, this).Controller);
 }
Exemple #22
0
 public AVaRICESettingsControl(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host, AVaRICEDebugController controller)
 {
     InitializeComponent();
     DataContext = Controller = new ControllerImpl(this, method, host, controller);
 }
 public object TryConvertLegacyConfiguration(IBSPConfiguratorHost host, string methodDirectory, Dictionary <string, string> legacyConfiguration)
 {
     return(null);
 }
Exemple #24
0
 public ControllerImpl(AVaRICESettingsControl control, LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host, AVaRICEDebugController controller)
 {
     Control      = control;
     TypeProvider = controller;
     _Settings    = new AVaRICEDebugSettings();
 }