Page 1 of 1
ESP32 crash when sending large data through shared uart.
Posted: Mon Jun 03, 2024 9:01 am
by fanmen1
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?
Re: ESP32 crash when sending large data through shared uart.
Posted: Mon Jun 03, 2024 9:42 am
by MicroController
Any suggestions on this?
Check in your code where and why you may be passing an invalid pointer (likely NULL) around.
Re: ESP32 crash when sending large data through shared uart.
Posted: Mon Jun 03, 2024 3:57 pm
by fanmen1
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.
Re: ESP32 crash when sending large data through shared uart.
Posted: Mon Jun 03, 2024 4:07 pm
by MicroController
So what's happening in line 242 of itc_frame_link_layer_prot.c?
Re: ESP32 crash when sending large data through shared uart.
Posted: Mon Jun 03, 2024 4:43 pm
by boarchuz
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.