diff --git a/Apps/PcmLibrary/Vehicle.TestKernel.cs b/Apps/PcmLibrary/Vehicle.TestKernel.cs index 903dfeb8..eaf13e71 100644 --- a/Apps/PcmLibrary/Vehicle.TestKernel.cs +++ b/Apps/PcmLibrary/Vehicle.TestKernel.cs @@ -47,7 +47,7 @@ public MemoryRange(UInt32 address, UInt32 size, BlockType type) /// that are under development. /// public partial class Vehicle - { + { /// /// For testing prototype kernels. /// @@ -55,7 +55,7 @@ public async Task ExitKernel(bool kernelRunning, bool recoveryMode, Cancel { try { - this.device.ClearMessageQueue(); + this.device.ClearMessageQueue(); Response response = await LoadKernelFromFile("test-kernel.bin"); if (response.Status != ResponseStatus.Success) @@ -112,7 +112,8 @@ public async Task ExitKernel(bool kernelRunning, bool recoveryMode, Cancel //await this.InvestigateDataCorruption(cancellationToken); //await this.InvestigateKernelVersionQueryTiming(); //await this.InvestigateCrc(cancellationToken); - await this.InvestigateDataRelayCorruption(cancellationToken); + //await this.InvestigateDataRelayCorruption(cancellationToken); + await this.InvestigateFlashChipId(); return true; } catch (Exception exception) @@ -265,6 +266,38 @@ private async Task InvestigateKernelVersionQueryTiming() this.logger.AddDebugMessage("Success rate: " + successRate.ToString()); } + + /// + /// This was used to test the delays in the kernel prior to sending a response. + /// + /// + private async Task InvestigateFlashChipId() + { + await this.device.SetTimeout(TimeoutScenario.ReadProperty); + + int successRate = 0; + for (int attempts = 0; attempts < 1; attempts++) + { + Message vq = this.protocol.CreateFlashMemoryTypeQuery(); + await this.device.SendMessage(vq); + Message responseMessage = await this.device.ReceiveMessage(); + if (responseMessage != null) + { + Response resp = this.protocol.ParseFlashMemoryType(responseMessage); + if (resp.Status == ResponseStatus.Success) + { + this.logger.AddUserMessage("Flash chip ID: " + resp.Value.ToString("X8")); + this.logger.AddDebugMessage("Got Kernel Version"); + successRate++; + } + } + + await Task.Delay(0); + continue; + } + } + + /// /// AllPro was getting data corruption when payloads got close to 2kb. /// Still not sure what's up with that. @@ -314,4 +347,4 @@ private async Task InvestigateDataCorruption(CancellationToken cancellationToken } } } -} +} \ No newline at end of file