ESP32 UART Encrypted Firmware Update
Posted: Wed Apr 26, 2023 8:27 am
Hallo everyone,
I am trying to figure out how to securely update the application via UART of my ESP32S3 module.
I've been reading almost all documents around but one way or the other I am always missing a part of it.
1. I am not not using an OTA update. I have no space left in the external flash as my app itself is around 4MB then I need to add NVS and Filesystem (SPIFFS in my case). All have to be updated at the same time. Any succestion about OTA is not fitting my case.
2. I need to disable the JTag to prevent attaker to hook up on it and sniff my code. So I will do a soft-disable, the reason of a soft-disable is because I'd like to debug the module just in case and I can use a UART Command to revert the JTag lock. Does it make any sense?
3. I need to flash the encrypted binary of my application. In this case I was thinking about encrypting the whole flash (I use always the same key for all modules to make a global update) and then flash it using the UART.
Now... I was rading this doc https://docs.espressif.com/projects/esp ... via-serial but it all looks a bit confusing an it is not really providing me with a clear procedure about how to do it.
I am particular the who documentation about flash update along with eFuses is really misleading. There are tons of possible combinations between secure-boot, flash encryption, Jtag disabling, UART disabling and on and on which is making me miss the focus of goal.
I've been tring to ask to people at Espressif but none came back with a clear procudere throwing me back to well-known docs.
I am open to any advice, please HELP.
I am trying to figure out how to securely update the application via UART of my ESP32S3 module.
I've been reading almost all documents around but one way or the other I am always missing a part of it.
1. I am not not using an OTA update. I have no space left in the external flash as my app itself is around 4MB then I need to add NVS and Filesystem (SPIFFS in my case). All have to be updated at the same time. Any succestion about OTA is not fitting my case.
2. I need to disable the JTag to prevent attaker to hook up on it and sniff my code. So I will do a soft-disable, the reason of a soft-disable is because I'd like to debug the module just in case and I can use a UART Command to revert the JTag lock. Does it make any sense?
3. I need to flash the encrypted binary of my application. In this case I was thinking about encrypting the whole flash (I use always the same key for all modules to make a global update) and then flash it using the UART.
Now... I was rading this doc https://docs.espressif.com/projects/esp ... via-serial but it all looks a bit confusing an it is not really providing me with a clear procedure about how to do it.
I am particular the who documentation about flash update along with eFuses is really misleading. There are tons of possible combinations between secure-boot, flash encryption, Jtag disabling, UART disabling and on and on which is making me miss the focus of goal.
I've been tring to ask to people at Espressif but none came back with a clear procudere throwing me back to well-known docs.
I am open to any advice, please HELP.