Skip to content

Fix ARMv4T#177

Merged
adamgreig merged 1 commit into
rust-embedded:mainfrom
thejpster:fix-armv4t
Jun 9, 2026
Merged

Fix ARMv4T#177
adamgreig merged 1 commit into
rust-embedded:mainfrom
thejpster:fix-armv4t

Conversation

@thejpster

Copy link
Copy Markdown
Contributor

Some ARMv4T processors (like the ARM7TDMI) don't have a CP15. Therefore we must not set the SCTLR.TE bit on startup, because an MCR to that CP15 register will fail.

This patch mixes the SCTLR.TE config with the FPU setup, and does the right thing according to pre-ARMv7 vs ARMv7, and whether there is an FPU or not.

This was only caught by testing on a real ARM7TDMI - our ARMv4 testing thus far was done on QEMU emulating an ARM926. With this fix I can boot Rust code on an NXP LPC2138 microcontroller.

Some ARMv4T processors (like the ARM7TDMI) don't have a CP15. Therefore
we must not set the SCTLR.TE bit on startup, because an MCR to that
CP15 register will fail.

This patch mixes the SCTLR.TE config with the FPU setup, and does the
right thing according to pre-ARMv7 vs ARMv7, and whether there is an
FPU or not.

This was only caught by testing on a real ARM7TDMI - our ARMv4 testing
thus far was done on QEMU emulating an ARM926. With this fix I can boot
Rust code on an NXP LPC2138 microcontroller.
@adamgreig adamgreig enabled auto-merge June 9, 2026 20:20
@adamgreig adamgreig added this pull request to the merge queue Jun 9, 2026
Merged via the queue into rust-embedded:main with commit 63894a8 Jun 9, 2026
52 checks passed
@thejpster thejpster deleted the fix-armv4t branch June 9, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants