One Time programmable area - OTP area in ESP partition

Vaibhav1996
Posts: 3
Joined: Tue Mar 29, 2022 10:43 am

One Time programmable area - OTP area in ESP partition

Postby Vaibhav1996 » Tue Mar 29, 2022 10:54 am

Hello Everyone,

I am looking for a way so that I can protect the partition in partition table as write protected so that, no other application will be able to access that area in partition and corrupt the data in it.

But I am not able to get the way to do that.

I tried some APIs for esp spi flash -- get_protected_regions or set_protected_regions.
but they are throwing the error.

Can someone help in me this.

Application will be like I need to store the certificates in that partition during factory process, after that no other piece of code will get access to partition for write or erase operations.

Thanks
Vaibhav

ESP_Sprite
Posts: 9053
Joined: Thu Nov 26, 2015 4:08 am

Re: One Time programmable area - OTP area in ESP partition

Postby ESP_Sprite » Wed Mar 30, 2022 1:01 am

Protected flash regions are highly dependent on the flash chip in use - the flash chip must support them, you need to align your request with what the flash chips actual protected region boundary size are, and the ESP-IDF driver for the flash chip must have support for setting these protected regions.

Vaibhav1996
Posts: 3
Joined: Tue Mar 29, 2022 10:43 am

Re: One Time programmable area - OTP area in ESP partition

Postby Vaibhav1996 » Wed Mar 30, 2022 8:46 am

For the same purpose I remove the metal cap from the esp32-wroom-32D and check the SPI flash data sheet.

As per the datasheet it supports protected area but still ESP API return 6005 - Flash does not support this feature, when I query for the protected regions in flash.

Thanks
Vaibhav

ESP_Sprite
Posts: 9053
Joined: Thu Nov 26, 2015 4:08 am

Re: One Time programmable area - OTP area in ESP partition

Postby ESP_Sprite » Thu Mar 31, 2022 1:45 am

Then it's likely that the ESP-IDF driver does not have support for this, sorry. If you want us to change that, please file a feature request so we know there's interest in this.

Vaibhav1996
Posts: 3
Joined: Tue Mar 29, 2022 10:43 am

Re: One Time programmable area - OTP area in ESP partition

Postby Vaibhav1996 » Thu Mar 31, 2022 3:46 am

I had raised a similar query for our espressif sales person

I wait for her revert.
If no positive response is there I will raise a feature request than.

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 209 guests