Skip to content

Need a way to reserve flash sectors #1378

@peterharperuk

Description

@peterharperuk
Contributor

The BT code uses two sectors at the end of flash for saving pairing info. As more people need to use flash it will get harder to coordinate flash allocations. We need some sort of API that allocates flash memory at runtime to avoid clashes?

Activity

added this to the none milestone on May 17, 2023
peterharperuk

peterharperuk commented on May 17, 2023

@peterharperuk
ContributorAuthor
geurtv

geurtv commented on May 31, 2023

@geurtv
Contributor

Alternatively or additionally maybe provide a more generalized storage callback interface, with some default implementations. This way the user can decide where and how stuff should be stored. For instance if a filesystem is already used (like littlefs or fatfs) the user might want to store configuration values in files. Something like:

struct storage_interface {
    void* user_data;
    size_t (*load_value)(void* udata, const char* key, void* buffer, size_t size);
    void (*store_value)(void* udata, const char* key, const void* buffer, size_t size);
    // ... more? get_value_size?
};
modified the milestones: none, 1.6.0 on May 31, 2023
modified the milestones: 1.6.1, 1.7.0 on Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @kilograham@geurtv@peterharperuk

      Issue actions

        Need a way to reserve flash sectors · Issue #1378 · raspberrypi/pico-sdk