Getting an error while receive a data continously through uart interrupt

amalamal
Posts: 23
Joined: Mon Dec 12, 2016 7:07 am

Getting an error while receive a data continously through uart interrupt

Postby amalamal » Thu Mar 23, 2017 5:49 am

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
Attachments
error with gps.png.tar.gz
(190.5 KiB) Downloaded 845 times
error showing with gps.c.tar.gz
(1.05 KiB) Downloaded 814 times

cjsm74x
Posts: 12
Joined: Wed Nov 25, 2015 10:16 pm

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

Postby cjsm74x » Thu Mar 23, 2017 6:15 am

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]

Who is online

Users browsing this forum: Bing [Bot] and 130 guests