boards/xtensa/esp32: Fix the SPI Flash MTD block device number #16229
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the SPI flash MTD block device number if OTA's partitions are present. In this case, the OTA partitions are registered first and the corresponding MTD block device drivers are assigned with the numbers corresponding to those partitions. Then, the additional SPI flash partition should consider that when registering its own corresponding MTD block device driver.
Impact
Impact on user: YES. Register the SPI flash partition successfully.
Impact on build: NO.
Impact on hardware: YES. Impacts ESP32 SPI flash device driver registration.
Impact on documentation: NO.
Impact on security: NO.
Impact on compatibility: NO.
Testing
Before applying this patch,
esp32-devkitc:mcuboot_slot_confirm
defconfig failed to mount the SPI flash partition. By applying this patch, the error is gone and the MTD block device driver is properly mounted.Building
Running
Results
Compare before/after boot log: an error message appeared when trying to mount the SPI flash MTD block device driver. After applying this patch, the error message is gone and the device driver is mounted at
/dev/mtdblock3
.Before
After