Skip to content

Community.Hardware.SystemSettings

NicolasG3 edited this page Sep 8, 2013 · 3 revisions

Community.Hardware.SystemSettings allows access to some extended system settings

  • change debug interface
  • get hardware serial number

Usage
The debug interface change allows your STM32F4 board to be used as an USB device. The hardware serial number can easily be used as Guid to identify your USB device. Note that the debug interface must be the same in your Visual Studio NETMF project properties.

Sample code

//Use COM3 debug interface when then PA9 pin is tied to ground
InputPort debugPort = new InputPort(FEZCerberus.Pin.PA9, false, Port.ResistorMode.PullUp);
if (debugPort.Read()) {
    //Restore the default debug interface if the pin is left unconnected
    SystemSettings.SetDebugInterface(SystemSettings.Port.USB1);
    }
else
    SystemSettings.SetDebugInterface(SystemConfig.Port.COM3);
//Configure USB client for your own use and debug on COM3
//...