Skip to content

Commit

Permalink
[SC64][SW] Fix timeout issues on slow backends in sc64deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
Polprzewodnikowy committed Aug 18, 2024
1 parent 04cecb1 commit d12bfaa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions sw/deployer/src/sc64/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<usize>;
Expand Down
4 changes: 2 additions & 2 deletions sw/deployer/src/sc64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down Expand Up @@ -717,7 +717,7 @@ impl SC64 {

pub fn test_usb_speed(&mut self, direction: SpeedTestDirection) -> Result<f64, Error> {
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];
Expand Down
4 changes: 2 additions & 2 deletions sw/deployer/src/sc64/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ struct StreamHandler {
writer: std::io::BufWriter<std::net::TcpStream>,
}

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 {
Expand Down

0 comments on commit d12bfaa

Please sign in to comment.