From 7ca00914afa2bf29e0aa9fc8bbf0e69a322a8e14 Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Fri, 22 May 2026 20:17:49 -0400 Subject: Relax AHB start address alignment limitation Without this, unaligned AHB reads may return questionable data. This seems to make a difference on 1000 series MCUs; without it, the taget-gen test reliably fail on 1010 and 1040 MCUs. Not sure why the 1100 series can get away without it. --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index eb2963d..ffd2180 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -466,6 +466,10 @@ pub fn reset(flexspi: flexspi::Instance, flash_size_kib: usize, fifo_capacity_by RXCLKSRC: LOOPBACK_DQS, ); ral::write_reg!(flexspi, flexspi, MCR1, SEQWAIT: 0xFFFF, AHBBUSWAIT: 0xFFFF); + // Fetch more data to satisfy any alignment requirements, no matter + // the AHB read burst start address. Helpful for users who are still + // using the AHB interface for reads. + ral::modify_reg!(flexspi, flexspi, AHBCR, READADDROPT: 1); ral::write_reg!(flexspi, flexspi, INTEN, 0); ral::write_reg!(flexspi, flexspi, INTR, u32::MAX); ral::write_reg!( -- cgit v1.2.3