ESP32 Failed to allocate RSA interrupt 261

fanmen1
Posts: 24
Joined: Thu Mar 21, 2024 1:30 pm

ESP32 Failed to allocate RSA interrupt 261

Postby fanmen1 » Mon Apr 15, 2024 9:48 am

I'm trying to implement a MQTT broker connection with my ESP32-S3, the connection was working fine when I was just trying to establish the initial connection. But now, after I've created a data packets to be sent over, the connection fails with the following error "Failed to allocate RSA interrupt 261", there is quite a lot a memory available and I'm also making use of SPIRAM. I'm also using the default esp_crt_bundle, which is sufficient for the connection.
Image
Please suggest a work around for this certification issue.
Attachments
now.png
now.png (20.65 KiB) Viewed 1147 times

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

Re: ESP32 Failed to allocate RSA interrupt 261

Postby ESP_Sprite » Tue Apr 16, 2024 1:51 am

You're probably running out of interrupts, and the encryption mqtt wants to do indirectly initializes the hardware RSA peripheral, which needs an interrupt to work. You can free up interrupts by marking them as shared (use the correct flag when initializing peripherals for that) or you can disable hardware encryption in menuconfig.

fanmen1
Posts: 24
Joined: Thu Mar 21, 2024 1:30 pm

Re: ESP32 Failed to allocate RSA interrupt 261

Postby fanmen1 » Wed Apr 24, 2024 1:07 pm

can you please provide more info on disabling hardware encryption?

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

Re: ESP32 Failed to allocate RSA interrupt 261

Postby ESP_Sprite » Thu Apr 25, 2024 2:33 am

Not sure exactly where, but I'm pretty sure it's a menuconfig option.

fanmen1
Posts: 24
Joined: Thu Mar 21, 2024 1:30 pm

Re: ESP32 Failed to allocate RSA interrupt 261

Postby fanmen1 » Thu Apr 25, 2024 7:35 am

I disabled the following option in menuconfig: Enable hardware MPI (bignum) acceleration which seems to have stopped the system crashes and the interrupt error. But now the server handshake is failing with the following error even after certificate verification success.
Attachments
Screenshot 2024-04-24 144834.png
Screenshot 2024-04-24 144834.png (25.03 KiB) Viewed 874 times

fanmen1
Posts: 24
Joined: Thu Mar 21, 2024 1:30 pm

Re: ESP32 Failed to allocate RSA interrupt 261

Postby fanmen1 » Fri Apr 26, 2024 9:09 am

If anyone is facing the same issue, here are some insights to overcome this.
1. Go to SSL Labs Server Test online and check all the cipher-suites that is supported by the server.
2. you can either disable the hardware MPI (bignum) acceleration in the menuconfig or move some ISR to a different core, either option works as expected.
3. depending on the cipher-suites of the server, enable the same in the menuconfig under TLS key exchange methods.
Hope this helps.

Who is online

Users browsing this forum: No registered users and 114 guests