ESP32 crash when sending large data through shared uart.

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

ESP32 crash when sending large data through shared uart.

Postby fanmen1 » Mon Jun 03, 2024 9:01 am

Hi, I'm trying develop a project with my ESP32-S3 as the main controller and an LTE daughterboard to connect the internet. I'm facing an issue with system crash, when I try to send a large amount of data (>2KB). On the daughterboard side, the data transfer is based on ITC frame link layer protocol, which sends any amount of data in frames. I'm using the UART 0 as the shared uart for communication and shows the following error. Any suggestions on this?
Attachments
Screenshot 2024-06-03 100012.png
Screenshot 2024-06-03 100012.png (40.62 KiB) Viewed 1271 times

MicroController
Posts: 1759
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32 crash when sending large data through shared uart.

Postby MicroController » Mon Jun 03, 2024 9:42 am

Any suggestions on this?
Check in your code where and why you may be passing an invalid pointer (likely NULL) around.

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

Re: ESP32 crash when sending large data through shared uart.

Postby fanmen1 » Mon Jun 03, 2024 3:57 pm

esp_err_t itc_frame_send_and_receive(itc_link_layer_handler_t *ctx, uint8_t *txbuffer, uint16_t *tx_length, uint8_t *rxbuffer, uint16_t *rx_length)
{

uint16_t frame_size = 0;
int i = 0;
uint16_t data_field_from_frame = 0;
if (ctx == NULL || txbuffer == NULL || tx_length == NULL || rxbuffer == NULL || rx_length == NULL) {
printf("Error: Null pointer argument\n");
return ESP_FAIL;
}
I'm making sure that the pointer are not NULL at the start of the function, also as I mentioned, the function works as expected for data less than 2KB. Problem is I cannot give anymore resources to this task, moreover, the ITC frame link layer protocol is setup to send the data in defined size (512 bytes) frames, regardless of the total size.

MicroController
Posts: 1759
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32 crash when sending large data through shared uart.

Postby MicroController » Mon Jun 03, 2024 4:07 pm

So what's happening in line 242 of itc_frame_link_layer_prot.c?

boarchuz
Posts: 612
Joined: Tue Aug 21, 2018 5:28 am

Re: ESP32 crash when sending large data through shared uart.

Postby boarchuz » Mon Jun 03, 2024 4:43 pm

EXCVADDR (which I understand to be the address resulting in LoadProhibited) is 0x8, which is an invalid address but your NULL checks will have no effect.

Who is online

Users browsing this forum: Baidu [Spider] and 104 guests