From ce97696bcd4515b5b2556163aa50c1b4723e7c0f Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Tue, 9 Sep 2025 08:29:25 -0400 Subject: Reserve address 0 by shifting ITCM start address The runtime previously allowed function placement at address 0 in ITCM. However, if you ever formed a pointer to the function placed there, it would look like a null pointer. And you would never be able to call that function if you relied on null pointer optimization. Also, most MCU reference manuals (RM) recommend against this placement. This commit reduces the total capacity of ITCM by 32 bytes, the smallest possible size of a MPU region. Note that this is greater than the RM's recommendation of a four byte reservation. It affects all supported MCUs, except the 1180. If you're so inclined, your MPU could disallow loads, stores, and execution from this reservation. Revised unit tests should cover this change. Additionally, you can manually verify that the ITCM region lengths are reduced by 32 bytes by opening the linker scripts generated by the ELF test suite. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index a43b8e5..7e59f3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +Establish a 32 byte reservation at the start of ITCM where instructions are +never placed. This reduces the total capacity of ITCM by 32 bytes on nearly +all MCUs, except the 1180. + ## [0.1.7] 2025-06-14 Introduce `RuntimeBuilder::in_flash` for creating images that can be launched -- cgit v1.2.3