Skip to content

AP_Filesystem: use wear levelling sector size for ESP32 FlashFS - #34071

Open
muramura wants to merge 1 commit into
ArduPilot:masterfrom
muramura:esp32-flashfs-ff-ss-wl
Open

AP_Filesystem: use wear levelling sector size for ESP32 FlashFS#34071
muramura wants to merge 1 commit into
ArduPilot:masterfrom
muramura:esp32-flashfs-ff-ss-wl

Conversation

@muramura

Copy link
Copy Markdown
Contributor

Summary

Use the wear levelling sector size when the ESP32 filesystem uses FlashFS.

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Description

AP_Filesystem_ESP32::disk_free() and disk_space() currently always
convert the FatFs sector count using FF_SS_SDCARD.

When HAL_ESP32_FLASHFS is defined, the filesystem uses ESP-IDF wear
levelling, so the correct sector size is FF_SS_WL.

This change selects:

  • FF_SS_WL for FlashFS
  • FF_SS_SDCARD otherwise

The existing SD card behavior is unchanged.

Testing

Built Copter for esp32buzz with the normal filesystem configuration:

  • AP_FILESYSTEM_ESP32_ENABLED=1
  • HAL_ESP32_FLASHFS not defined
  • build passed

Built Copter for esp32buzz with:

define HAL_ESP32_FLASHFS 1

supplied through --extra-hwdef, verifying the FF_SS_WL build path.

Both builds completed successfully.

git diff --check upstream/master also passed.

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.

1 participant