Hardware AES lock forever
Posted: Wed May 26, 2021 10:24 am
I'm developing 3 product, two with an ESP32-S2 and one with ESP32.
With the single core MCU (ESP32-S2) I noticed strange behaviuors with an API. It sometimes locks forever at esp_aes_acquire_hardware() function. Same code for ESP32 seems not affected (but I have to check better because sometimes happens after a while)
In the image attached there is the debug stack.
In the last attempt to understand what is happening I removed esp_aes_acquire_hardware() in my code because i realized that API call it internally, but nothing changed, the code works for a while and then it locks random.
In one firmware locked in the aes crypt function it returned to life after a Wifi event, as you can read from my log below.
I think is a problem of hardware mutex or somethings like this, I'm investigating my code with no success.
With disabling AES Hardware Acceleration it seems do not happen.
Please check the image attached for debug stack.
I'm developing with Platformio and visual studio code with idf 3.2.0+sha.56f9c60
Thanks in advice, have a nice day.
With the single core MCU (ESP32-S2) I noticed strange behaviuors with an API. It sometimes locks forever at esp_aes_acquire_hardware() function. Same code for ESP32 seems not affected (but I have to check better because sometimes happens after a while)
In the image attached there is the debug stack.
In the last attempt to understand what is happening I removed esp_aes_acquire_hardware() in my code because i realized that API call it internally, but nothing changed, the code works for a while and then it locks random.
In one firmware locked in the aes crypt function it returned to life after a Wifi event, as you can read from my log below.
I think is a problem of hardware mutex or somethings like this, I'm investigating my code with no success.
With disabling AES Hardware Acceleration it seems do not happen.
Please check the image attached for debug stack.
I'm developing with Platformio and visual studio code with idf 3.2.0+sha.56f9c60
Thanks in advice, have a nice day.
Code: Select all
[000029.520] COM [Tx][R0] 0001 to ffff INTERFACE SET - 3 bytes
[000029.520] COM Interface Tx Crypto Hash: 4de40778
[000029.520] CRYPTO Padded encryption, old len:26, new len: 32 <----------- Dead here
W (312539) wifi:inactive timer: now=129c6757 last_rx_time=9e7b83 diff=49b1d, aid[1]8c:eb:c6:ec:07:09 leave<---- Returned to life after 10 minutes
I (312539) wifi:station: 8c:eb:c6:ec:07:09 leave, AID = 1, bss_flags is 134243, bss:0x3fffb99c
I (312546) wifi:new:<5,0>, old:<5,1>, ap:<5,1>, sta:<255,255>, prof:5
[000623.060] COM 0 Wifi Devices Connected <----- Here my code (an infinite loop in main) restart to work
[000624.500] COM TCP sent 41 bytes to 192.168.87.2
[000624.500] COM Raw Tx of 32 bytes (Serial Nibble, data dim 26)