Visitar URL original
alif/vfs_rom_ioctl: Disable interrupts while programming MRAM. by kwagyeman · Pull Request #19732 · micropython/micropython · GitHub
Skip to content

alif/vfs_rom_ioctl: Disable interrupts while programming MRAM. - #19732

Merged
dpgeorge merged 1 commit into
micropython:masterfrom
kwagyeman:alif_mram_write_irq
Oct 10, 2026
Merged

dpgeorge merged 1 commit into
micropython:masterfrom
kwagyeman:alif_mram_write_irq

Conversation

@kwagyeman

@kwagyeman kwagyeman commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

An interrupt taken while an MRAM line is being programmed can wedge the
MRAM controller. The core hangs, and nothing short of a power cycle
recovers the chip, since the secure enclave boots from MRAM too. The
Alif MRAM driver requires interrupts to be disabled around MRAM writes,
followed by a DSB and a D-cache clean.

Program MRAM in 256 byte blocks, each with interrupts disabled, then a
DSB and a D-cache clean of the block before interrupts are re-enabled.
Each interrupts-off window stays well under 1ms.

Issue found while trying to update coprocessor ROMFS MRAM from HP core.

An interrupt taken while an MRAM line is being programmed can wedge the
MRAM controller.  The core hangs, and nothing short of a power cycle
recovers the chip, since the secure enclave boots from MRAM too.  The
Alif MRAM driver requires interrupts to be disabled around MRAM writes,
followed by a DSB and a D-cache clean.

Program MRAM in 256 byte blocks, each with interrupts disabled, then a
DSB and a D-cache clean of the block before interrupts are re-enabled.
Each interrupts-off window stays well under 1ms.

Signed-off-by: Kwabena W. Agyeman <kwagyeman@live.com>
@kwagyeman kwagyeman moved this to Backlog in OpenMV Features Sep 27, 2026
@kwagyeman kwagyeman moved this from Backlog to In progress in OpenMV Features Sep 27, 2026

@dpgeorge dpgeorge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The reasoning matches the comments for Alif_CMSIS/Source/Driver_MRAM.c:MRAM_write().

@dpgeorge dpgeorge added this to the release-1.30 milestone Oct 6, 2026
@dpgeorge
dpgeorge merged commit a5438bd into micropython:master Oct 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants