Skip to content

[Feature] Improve block_device_flash_stm32 driver #708

Description

@laurensvalk

Is your feature request related to a problem? Please describe.
We recently implemented persistent data storage on Powered Up hubs in pybricks/pybricks-micropython#112.

The following non-critical tasks were deferred to this issue to improve at a later date.

Describe the solution you'd like

  • Consider yielding the (otherwise blocking) block device store protothread between erases/writes. Although writing the maximum size takes only about 50--100 ms, so we could just leave it. It may be needed when we use more pages, see below.
  • Not use HAL to save some space.

Activity

  1. added
    platform: Powered Up
    on Aug 26, 2022
  2. laurensvalk commented on Aug 30, 2022

    @laurensvalk
    MemberAuthor

    In pybricks/pybricks-micropython@5e3fada, I have opted to delete the whole user space instead of only the pages needed. This simplifies the checksum computation because we can assume that everything after the new data is going to be 0xFFFFFFFF.

    But a page delete takes about 20--30ms, so we could speed things up for smaller programs by asking the flash driver how many pages/bytes it did (not) erase, so we can take that into account with the checksum.

  3. added theissue type on Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: Powered Up

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions