aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorIan McIntyre <me@mciantyre.dev>2026-05-22 20:17:49 -0400
committerIan McIntyre <me@mciantyre.dev>2026-05-23 12:06:46 -0400
commit7ca00914afa2bf29e0aa9fc8bbf0e69a322a8e14 (patch)
treec73c828d54a02179c17a499662f6899d8290a39c /src/lib.rs
parent022639f277d08c5b61fc805d57d34cec4efaba5a (diff)
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.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 4 insertions, 0 deletions
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!(