From d12bfaabf6b5d64174882712e5c6c1f5e54a9ff5 Mon Sep 17 00:00:00 2001 From: Mateusz Faderewski Date: Sun, 18 Aug 2024 13:30:24 +0200 Subject: [PATCH] [SC64][SW] Fix timeout issues on slow backends in sc64deployer --- sw/deployer/src/sc64/link.rs | 4 ++-- sw/deployer/src/sc64/mod.rs | 4 ++-- sw/deployer/src/sc64/server.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sw/deployer/src/sc64/link.rs b/sw/deployer/src/sc64/link.rs index 91937ca..45f0f33 100644 --- a/sw/deployer/src/sc64/link.rs +++ b/sw/deployer/src/sc64/link.rs @@ -59,8 +59,8 @@ const FTDI_PREFIX: &str = "ftdi://"; const RESET_TIMEOUT: Duration = Duration::from_secs(1); const POLL_TIMEOUT: Duration = Duration::from_millis(5); -const READ_TIMEOUT: Duration = Duration::from_secs(5); -const WRITE_TIMEOUT: Duration = Duration::from_secs(5); +const READ_TIMEOUT: Duration = Duration::from_secs(10); +const WRITE_TIMEOUT: Duration = Duration::from_secs(10); pub trait Backend { fn read(&mut self, buffer: &mut [u8]) -> std::io::Result; diff --git a/sw/deployer/src/sc64/mod.rs b/sw/deployer/src/sc64/mod.rs index ae76f97..0c74005 100644 --- a/sw/deployer/src/sc64/mod.rs +++ b/sw/deployer/src/sc64/mod.rs @@ -102,7 +102,7 @@ const ISV_BUFFER_LENGTH: usize = 64 * 1024; pub const MEMORY_LENGTH: usize = 0x0500_2980; -const MEMORY_CHUNK_LENGTH: usize = 8 * 1024 * 1024; +const MEMORY_CHUNK_LENGTH: usize = 1 * 1024 * 1024; impl SC64 { fn command_identifier_get(&mut self) -> Result<[u8; 4], Error> { @@ -717,7 +717,7 @@ impl SC64 { pub fn test_usb_speed(&mut self, direction: SpeedTestDirection) -> Result { const TEST_ADDRESS: u32 = SDRAM_ADDRESS; - const TEST_LENGTH: usize = 16 * 1024 * 1024; + const TEST_LENGTH: usize = 8 * 1024 * 1024; const MIB_DIVIDER: f64 = 1024.0 * 1024.0; let data = vec![0x00; TEST_LENGTH]; diff --git a/sw/deployer/src/sc64/server.rs b/sw/deployer/src/sc64/server.rs index 70966cf..dff6722 100644 --- a/sw/deployer/src/sc64/server.rs +++ b/sw/deployer/src/sc64/server.rs @@ -17,8 +17,8 @@ struct StreamHandler { writer: std::io::BufWriter, } -const READ_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(5); -const WRITE_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(5); +const READ_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(10); +const WRITE_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(10); const KEEPALIVE_PERIOD: std::time::Duration = std::time::Duration::from_secs(5); impl StreamHandler {