Skip to content

STM32F7 flash driver disables interrupts unnecessarily #14058

Closed
@kjbracey

Description

@kjbracey

Description of defect

The STM32F7 flash driver disables interrupts during erase operations (and maybe programming). As erase operations can take hundreds of milliseconds this can cause major system disruption.

The STM32F7 has dual-bank flash, so it is possible to configure the system so that one bank is used for the program and one bank used for other storage such as KVStore. Configured like this there should be no impact on the system when erasing or writing to KVStore.

However, even if configured for dual-bank, the interrupt disable happens for the entire flash write, which could be 800ms.

If configured for dual-bank, the STM32F7 driver should only disable interrupts if performing a flash operation on a bank that the program is in. (This is possibly easier to express in English than as a C check though). It is possible that no interrupt disables are needed at all - if operating on the current bank, I believe the system will automatically stall the CPU, except for certain fast-programming operations that would need to be executed from RAM anyway that we're not using.

Issue originally noted in #13772 - that was marked resolved in that the system timer was made more robust to cope better after the long interrupt blockage - so it didn't cause ongoing problems - but it didn't resolve the underlying platform problem that makes the unnecessary blockage occur.

Target(s) affected by this defect ?

STM32F7 family

Toolchain(s) (name and version) displaying this defect ?

All supported

What version of Mbed-os are you using (tag or sha) ?

mbed-os-6.6.0-rc1

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

n/a

How is this defect reproduced ?

Set up a Timer to blink an LED at, say, 4Hz, while running any KVStore test, such as the test program in #13772 on a system configured for dual bank operation. The timer should remain regular during flash operations, but given the current long interrupt disables would not.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions