So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By ElQuestion
#88378
schufti wrote:with your sketch you only read the emulated EEPROM (located in flash).
If you used "erase flash: all flash contents" or a new module then the default is 0xFF==255.

do you really need to calculate the checksum? This is allready done when flashing and checked every tike the esp boots up.


Maybe it helps when i explain the requirments i have. Concrete i have the following requirements:
(1) i must calculate a checksum or hash of the program binaries
(2) the program must be stored in a ROM (read only memory) section
(3) Secure writeable memory, where only my program is able to perform write operations
(4) a memory section that can only be read by my program


- After an additional internet search i think i can solve (1) using ESP.getSketchMD5() , which means that, i must not calculate the hash myself
- For the requirments (2) - (4) i am not sure if this is possible with an ESP8266. If it is possible, i am not completely sure how i can implement it that way, or if it is already implement that way.
- The (2) requirment should make sure, that if the program is executed, it binaries have not been modified. When i understand it right, the ESP8266 checks exactly that by comparing the stored hash of the script that should be executed with the sketch that is actually executed (?)
- When only my sketch can run on the ESP8266 (because otherwise the hash check fails and the ESP8266 crashes (?)), that should also mean, that only my sketch can write on the memory. So (3) should be fulfilled (?)
- For the same reason as (3) also (4) should be fulfilled (?)