I am assigned to write a C# WPF application to connect to a Google Coral Development Board through the Debug Port and Stream all the data that the Board outputs to a Windows Screen (e.g. TextBlock).
I follow this Microsoft referemce for the reading events. For now, after I establish the connection to the board, I see the outputs in my Textblock but it is not in the readable text format.
What I expected:
U-Boot SPL 2019.04.1 (Jan 11 2021 - 20:43:00 +0000)
power_bd71837_init
Board id: 0
DDRINFO: start DRAM init
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from MMC1
hdr read sector 300, count=1
U-Boot 2019.04.1 (Jan 11 2021 - 20:43:00 +0000), Build: jenkins-enterprise.uboot -imx-1
CPU: Freescale i.MX8MQ rev2.1 1500 MHz (running at 1000 MHz)
CPU: Commercial temperature grade (0C to 95C) at 37C
Reset cause: POR
Model: Freescale i.MX8MQ Phanbell
DRAM: 4 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
BuildInfo:
- ATF
- U-Boot 2019.04.1
flash target is MMC:0
Net:
Warning: ethernet@30be0000 using MAC address from ROM
eth0: ethernet@30be0000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
2065 bytes read in 6 ms (335.9 KiB/s)
What I actually see from the TextBlock:
I check the BaudRate and other settings, nothing seems to be incorrect. I know that UART protocol sends data as byte
, can someone spot if my output if wrong data type? If so, do I have to read receiving byte
and convert to readable text?
Adding My Code
//Port setting
_serialPort.PortName = comPort.Name;
_serialPort.BaudRate = 115200;
_serialPort.Parity = Parity.None;
_serialPort.DataBits = 8;
_serialPort.StopBits = StopBits.One;
_serialPort.ReadTimeout = 500;
_serialPort.WriteTimeout = 500;
_serialPort.DtrEnable = true;
_serialPort.RtsEnable = true;
// Port Data Receiving method
_serialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
_serialPort.Open();
private void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
{
SerialPort sp = (SerialPort)sender;
string indata = sp.ReadExisting();
this.Dispatcher.Invoke(() =>
{
TextBlock_Output.Text += indata;
});
};
Hardware Connection I connect the Debug Port of the Google Coral Board to my Windows Computer through a micro-USB(Coral Board) to USB(Windows Computer). I normally use this connection for debugging through COM Port via Putty as well.
Thank you!