private void StartDebug() { var transport = new SerialTransport(); transport.SetPort(_commands.Port); transport.SetSpeed(_commands.BaudRate); _debugger.Start(transport); _debugger.ResetTarget(); }
// LIMITS // WRITING TO UART REGISTERS WILL STOP THE COMMUNICATION static void Main(string[] args) { SetupCommandProcessor(); var transport = new SerialTransport(); transport.SetPort("COM4"); transport.SetSpeed(500000); _srv = new DebugServer(); _srv.SetTransport(transport); _srv.DebuggerAttached += _srv_DebuggerAttached; _srv.DebuggerDetached += _srv_DebuggerDetached; _srv.UnknownData += SrvOnUnknownData; _th = new Thread(CommandLoop); SysConsole.WriteLine("Available register names"); SysConsole.WriteLine("**************************************"); SysConsole.WriteLine(Registers.RegisterMappings.Aggregate("", (s, pair) => s + ", " + pair.Key).Trim(',')); SysConsole.WriteLine("**************************************"); SysConsole.WriteLine("Available commands"); SysConsole.WriteLine("c - Continue execution"); SysConsole.WriteLine("t - Toggle all of PORTB (usually a led is on PB5)"); SysConsole.WriteLine("w - write to memory, w (location, or IO reg) data"); SysConsole.WriteLine(" the data is in the following format (number)[,(number)]"); SysConsole.WriteLine(" Exp. "); SysConsole.WriteLine(" w pinb 0xFF"); SysConsole.WriteLine(" w 0x0123 0xFF,0xF0,0xF1,100,255"); SysConsole.WriteLine("r - read from memory, r (location, or IO reg) size"); SysConsole.WriteLine(" Exp. "); SysConsole.WriteLine(" r pinb 1"); SysConsole.WriteLine(" r 0x0123 0xFF"); SysConsole.WriteLine("**************************************"); SysConsole.WriteLine("Press any key to continue"); SysConsole.ReadLine(); _srv.Start(); _th.Start(); SysConsole.WriteLine("Powercycle the target"); // Block everything _th.Join(); }