使用PowerShell读写串口

通过串口调试UEFI时,调试信息常常被UEFI的界面所覆盖。找了几个工具都不够如意,最后还是用PowerShell自由控制最好。

PS> $port= new-Object System.IO.Ports.SerialPort COM3,1500000,None,8,one
PS> $port.Open()
PS> $port.ReadLine()
想读几行读几行,自由极了。

也可以写串口:

PS> [System.IO.Ports.SerialPort]::getportnames()
COM3
PS> $port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
PS> $port.open()
PS> $port.WriteLine(“Hello world”)
PS> $port.Close()

下面是调试安卓启动时的log(过滤掉了readline):

[Bds] Expand MemoryMapped(0xB,0x3EC67000,0x3F61943F)/FvFile(3A738B36-B9C5-4763-ABBD-6CBD4B25F9FF) -> MemoryMapped(0xB,0x3EC67000,0x3F61943F)/FvFile(3A738B36-B9C5-4763-ABBD-6CBD4B25F9FF)

add-symbol-file /home/geduer/edk2-yourland2024/workspace/Build/YourLand/DEBUG_GCC/AARCH64/EmbeddedPkg/Application/AndroidBoot/AndroidBootApp/DEBUG/AndroidBootApp.dll 0xEAFD5000

Loading driver at 0x000EAFD4000 EntryPoint=0x000EAFDA5D0 AndroidBootApp.efi

Android media device path validated successfully

DevicePath: VenHw(100C2CFA-B586-4198-9B4C-1683D195B1DA)/HD(2,GPT,AEE0E694-BB6E-0A4A-92AD-FB573FB8840A,0x8000,0x100000)

Failed to get AndroidBootImg Size: Invalid Parameter

Error: Image at 000EAFD4000 start failed: Invalid Parameter

remove-symbol-file /home/geduer/edk2-yourland2024/workspace/Build/YourLand/DEBUG_GCC/AARCH64/EmbeddedPkg/Application/AndroidBoot/AndroidBootApp/DEBUG/AndroidBootApp.dll 0xEAFD5000

作者:Zhang Yinkui  创建时间:2024-03-21 10:41
最后编辑:Zhang Yinkui  更新时间:2024-11-15 17:44