Page 1 of 1

Hash Check a partition

Posted: Tue May 19, 2020 2:24 pm
by lildenty
I was wondering if there was a check I could perform on a partition of an esp32. probably the main App program. to check that it's still the same as before.

like a hash check?.

I currently use nvs for memory but as this is stored on a separate Partition the Hash check should still work ?

Just if a product is returned. I was wanting to confirm that the chip is not corrupt in some way.

Any thoughts would be great.

Thanks

Re: Hash Check a partition

Posted: Tue May 19, 2020 11:13 pm
by chegewara
Maybe this can help:
lildenty wrote: I was wondering if there was a check I could perform on a partition of an esp32. probably the main App program. to check that it's still the same as before.
https://github.com/espressif/esp-idf/bl ... ple.c#L289
lildenty wrote: Just if a product is returned. I was wanting to confirm that the chip is not corrupt in some way.
https://docs.espressif.com/projects/esp ... -interface

Re: Hash Check a partition

Posted: Wed May 20, 2020 7:53 am
by lildenty
esp_partition_get_sha256(esp_ota_get_running_partition(), sha_256);
print_sha256(sha_256, "SHA-256 for current firmware: ");
Thanks. The Hash is just what I was after.

I currently don't use OTA so I'm presuming I can't use the second link.