Add flash read/write API

Open
#758 6 comments 2 reactions 1 assignee View on GitHub

@Wren6991 is already working on this.

Since Apr 29, 2022.

Assessment

This issue has not been assessed yet.

Description

hardware_flash missing API review

Currently the flash can be accessed using the two ROM functions flash_range_program and flash_range_erase. However, there is no proper way to read from the flash, and to write individual bytes. Having these two features would allow users to use parts of the flash as non volatile memory.

Considered alternatives
Reading can be implemented using flash_do_cmd, though it requires allocating a large tx array to satisfy the API. Writing to arbitrary byte ranges can be implemented using flash_range_program with 0xff padding for unaffected bytes. Both can be implemented by writing directly to the SSI. But it would be better to have this done in the SDK and not application code.

Dominant language
C
Stars
5k
Forks
1.3k
Avg merge
2d 17h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/pico-sdk

All issues in raspberrypi/pico-sdk

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.