Skip to content

drivers: flash_stm32h7: partition check issue #90252

Closed
@pillo79

Description

@pillo79

Describe the bug

On STM32H747xI, partitions defined close to the end of the first Flash bank are causing runtime errors like the following:

*** Booting Zephyr OS build v3.7.0-16360-gd851814b6c4d ***
[00:00:00.207,000] <err> flash_stm32h7: Range ovelaps flash bank discontinuity

as reported in arduino/ArduinoCore-zephyr#125 (comment) .

To Reproduce

The partition that is causing the error is defined by this DTS snippet:

&flash0 {
        partitions {
                user_sketch: partition@e0000 {
                        reg = <0x0e0000 0x20000>;
                };
        };
};

(it's in the last 128k of Flash bank 0).

Trying to read from this on an arduino_giga_r1//m7 or another H7 target should error at runtime.

Expected behavior

The partition should be accessed with no errors, as it was happening before commit 0e41b07.
The problem with that change is that it replaces the total size on chip with the bank size, which is half of the total on dual bank devices; this invalid value causes later safety checks to trip unnecessarily.

PR incoming.

Impact
Depends on user partitioning; in Arduino it blocks the loader from working on H7 targets (Giga, Portenta H7, Opta).

Additional context

Tested with recent main (649eb62).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: FlashbugThe issue is a bug, or the PR is fixing a bugplatform: STM32ST Micro STM32

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions