Replace old BLOCK_SIZES with definitions of the blocks themselves
#971
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.
The actual block definitions only exist within Python classes so this commit uses PyO3 to import the esptool.py eFuse block definitions and generates arrays of the length and read address of each eFuse block.
We need the actual read address here rather than using the old offset method because not all eFuse blocks are sequential. (On ESP32 the block 0 read registers are followed by the block 0 write registers.)
TODO:
Should we deprecate the
block_sizemethod?It's unfortunately a public method, but it doesn't seem to me like there's any safe way for API consumers to use it for anything.
On the other hand, that kind of also applies to
efuse_regandblock0_offset. To use them safely you have to have pretty good knowledge of the register layout per-chip, and we don't expose that right now.Should we also replace
efuse_regwith ones generated from theDR_REG_EFUSE_BASEdefinitions inesptool.py?I decided to leave
blockandEfuseBlockprivate for now. It might make sense to eventually make them public, but it's much harder to make any necessary changes later if we make them public.I'll wait for #969 to be merged and rebase on top of that before undrafting this.