Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor spi flash code #2810

Merged
merged 5 commits into from
Jun 18, 2024
Merged

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Jun 17, 2024

This PR tidies up the flash memory code and adds the flash_addr_t and flash_sector_t types. In paricular, flash_addr_t defines flash addresses as uintptr_t rather than uint32_t. The primary reason for this is that host builds emulate flash addresses using memory pointers.

The main flash interface definitions are in Sming/Components/arch_driver/src/include/flashmem.h. The arch header files esp_spi_flash.h include this after any arch-specific definitions.

Other changes:

  • Deprecate flashmem_get_first_free_block_address - serves no purpose since partitions were introduced.
  • Return enumerated value from flashmem_get_size_type()
  • The SPIFlashInfo structure returned from flashmem_get_info() is now common to all architectures, although the fields within may have different values. This means it no longer reflects the actual in-flash structure for Esp8266. Applications should never rely on this anyway, so not considered a breaking change.

@slaff slaff added this to the 5.2.0 milestone Jun 18, 2024
@slaff slaff merged commit 2709614 into SmingHub:develop Jun 18, 2024
36 of 38 checks passed
@mikee47 mikee47 deleted the feature/refactor-spi-flash branch June 18, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants