Hash Check a partition

lildenty
Posts: 13
Joined: Wed Sep 18, 2019 3:31 pm

Hash Check a partition

Postby lildenty » Tue May 19, 2020 2:24 pm

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

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Hash Check a partition

Postby chegewara » Tue May 19, 2020 11:13 pm

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

lildenty
Posts: 13
Joined: Wed Sep 18, 2019 3:31 pm

Re: Hash Check a partition

Postby lildenty » Wed May 20, 2020 7:53 am

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.

Who is online

Users browsing this forum: No registered users and 144 guests