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

ESP Efuse : Get selected efuse value as JSON object #436

Merged

Conversation

sbertrand-witekio
Copy link
Contributor

Description of change

Addition to get efuse value as JSON object for further processing

I have tested this change with the following hardware & software combinations:

Linux, ESP32, WROOM, WROVER

Comment

This allow to get efuse value so script can flash devices appropriately depending on secure boot or flash encryption state of the device.

@mahavirj
Copy link
Member

CC @ghemal

@mahavirj mahavirj requested a review from projectgus June 19, 2019 12:26
@projectgus
Copy link
Contributor

@sbertrand-witekio Thanks for sending this PR. We've been discussing the need for something similar internally, specifically a machine-parseable output for the efuse values.

Rather than having a command that reads a single efuse as JSON, what about adding an option to the existing summary command like --format=json that dumps the summary of all efuses as a JSON dictionary rather than the current human-readable table?

The main advantage would be that a single JSON file can contain machine-parseable data about all efuses. This will be much more convenient for any use case that involves reading more than one efuse at a time, because espefuse.py doesn't have to re-connect to the bootloader on each invocation.

I look forward to hearing what you think about this idea.

@sbertrand-witekio
Copy link
Contributor Author

sbertrand-witekio commented Jun 20, 2019

That would be fine. I was just concerned about processing time, efuses are read from the device one at a time or in blocks then parsed by Python ?
Can there be an option to export to a file as well ?

I have added other processing for the MAC address, to get the raw data was hex, as to avoid further processing.

@projectgus
Copy link
Contributor

@sbertrand-witekio

In terms of runtime, nearly all of the time is spent connecting to the ESP32. Fetching the efuse information from the chip is quite fast.

Are you interested in updating this PR along the lines of what was discussed?

Angus

@sbertrand-witekio
Copy link
Contributor Author

Hi,
I can update the PR with those changes
efuse summary :

  • [--format=json] to get a json output
  • [--file=filename] to get export in a file

I'll work on this this week.

@sbertrand-witekio
Copy link
Contributor Author

I have updated the PR.

Copy link
Contributor

@projectgus projectgus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that! Left a few minor comments but it looks pretty good.

Please also check the Travis CI output for flake8 warnings, etc.

espefuse.py Outdated Show resolved Hide resolved
espefuse.py Outdated Show resolved Hide resolved
espefuse.py Outdated Show resolved Hide resolved
espefuse.py Outdated Show resolved Hide resolved
@sbertrand-witekio
Copy link
Contributor Author

I have fix the coding style based on the feedback.

Copy link
Contributor Author

@sbertrand-witekio sbertrand-witekio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made changes based on the feedback.

@projectgus projectgus merged commit 996e8c3 into espressif:master Jul 11, 2019
@projectgus
Copy link
Contributor

Thanks @sbertrand-witekio !

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.

3 participants