Skip to content

Conversation

@kyrias
Copy link
Contributor

@kyrias kyrias commented Nov 19, 2025

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_size method?

    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_reg and block0_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_reg with ones generated from the DR_REG_EFUSE_BASE definitions in esptool.py?

  • I decided to leave block and EfuseBlock private 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.

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.)
@kyrias kyrias mentioned this pull request Nov 19, 2025
@bjoernQ
Copy link
Contributor

bjoernQ commented Nov 20, 2025

I think for the v5 release we should carefully reconsider the efuse API - e.g. I agree the block_size method shouldn't be public (and there are a few more things which might need improvements)

After #969 it's probably good enough for espflash's internal use but not for consumption by users

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