From e0653d664720e47e8567519b97ed8e7291d7ef93 Mon Sep 17 00:00:00 2001 From: Glenn Anderson Date: Sat, 19 Mar 2022 12:04:57 -0700 Subject: [PATCH 1/2] Switch to latest toolchain. Tune the timing for the readDataLoop with the latest toolchain. --- platformio.ini | 2 +- src/BlueSCSI.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 522db27..b0874a4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -17,7 +17,7 @@ upload_protocol = stlink ; 1.80201.181220 ; 921kb/sec ; 1.90201.191206 ; 912kb/sec ; 1.90301.200702 ; default - 955kb/sec -platform_packages = toolchain-gccarmnoneeabi@1.60301.0 +platform_packages = toolchain-gccarmnoneeabi build_unflags = -Os diff --git a/src/BlueSCSI.cpp b/src/BlueSCSI.cpp index 3b5a5a7..0b88675 100644 --- a/src/BlueSCSI.cpp +++ b/src/BlueSCSI.cpp @@ -878,7 +878,7 @@ void readDataLoop(uint32_t blockSize) REQ_OFF(); *dstptr++ = ~(ret >> 8); // Move wait loop in to a single 8 byte prefetch buffer - asm("nop.w"); + asm("nop.w;nop"); WAIT_ACK_INACTIVE(); REQ_ON(); // Extra 1 cycle delay From c9dbfec6be3ded1d6386d1a8cfb231c5e1ea666f Mon Sep 17 00:00:00 2001 From: Glenn Anderson Date: Sat, 19 Mar 2022 13:02:34 -0700 Subject: [PATCH 2/2] Change readDataLoop alignment to 16 --- src/BlueSCSI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BlueSCSI.cpp b/src/BlueSCSI.cpp index 0b88675..bfce7b0 100644 --- a/src/BlueSCSI.cpp +++ b/src/BlueSCSI.cpp @@ -857,7 +857,7 @@ void readDataPhase(int len, byte* p) /* * See writeDataLoop for optimization info. */ -void readDataLoop(uint32_t blockSize) __attribute__ ((aligned(8))); +void readDataLoop(uint32_t blockSize) __attribute__ ((aligned(16))); void readDataLoop(uint32_t blockSize) { register byte *dstptr= m_buf;