Page 1 of 1

Getting an error while receive a data continously through uart interrupt

Posted: Thu Mar 23, 2017 5:49 am
by amalamal
Hi

I attached one gps module output with uart 1 rx_pin and received data in one buffer and printing it through uart 0, But it is giving an error "Guru Meditation Error of type Illegal Instruction occurred on core 0. Exception was unhandled",
I am attaching the error i am getting and code here , please anyone give some suggestion to solve this issue.

Thanks

Re: Getting an error while receive a data continously through uart interrupt

Posted: Thu Mar 23, 2017 6:15 am
by cjsm74x
Edit: after taking a better look at the code and the actual error, I think the problem is with this line inside test_my_uart

Code: Select all

uint8_t* data = (uint8_t*) malloc(BUF_SIZE);
You are using malloc() without a free() when done. Try to test if allocating memory actually succeeds. (if data == null -> out off memory!)
/edit

It looks like you are creating the task for get_gps_data over and over without ever removing it when it is done. This will have you running out of memory very fast.

Code: Select all

void print_the_data()
{
	while(1)
	{
	//uart_write_bytes(UART_NUM_0, my_buf, 1000);
	//memset(my_buf,0,sizeof(my_buf));
->		xTaskCreate(get_gps_data, "get_gps_data", 4096, NULL, 7, NULL);
	vTaskDelay(1000 / portTICK_RATE_MS);
	}
}
[/color]