ESP32 can't into IRQHandler

zcg127
Posts: 5
Joined: Tue Jan 16, 2018 6:51 am

ESP32 can't into IRQHandler

Postby zcg127 » Tue Jan 16, 2018 6:55 am

rt, I can't make my esp32 into the irq handler , here the codes , is someone who can help me

Code: Select all

void UART_Init(void)
{
    /* Configure parameters of an UART driver,
     * communication pins and install the driver */
	uart_config_t uart_config =
	{
		.baud_rate = 115200,
		.data_bits = UART_DATA_8_BITS,
		.parity = UART_PARITY_DISABLE,
		.stop_bits = UART_STOP_BITS_1,
		.flow_ctrl = UART_HW_FLOWCTRL_DISABLE
	};
	uart_param_config(UART_NUM_0, &uart_config);
	// Set UART pins using UART0 default pins i.e. no changes
	uart_set_pin(UART_NUM_0,U0_TX_PIN,U0_RX_PIN,U0_DTS_PIN,U0_RTS_PIN);
	uart_driver_install(UART_NUM_0,U0_RX_BUF, U0_TX_BUF,U0_QUEUE_BUF, &uart0_queue, 0);
	uart_enable_intr_mask(UART_NUM_0,UART_RXFIFO_TOUT_INT_ENA);
	uart_isr_register(UART_NUM_0,(void*)UARTO_IRQHandle,NULL,ESP_INTR_FLAG_LEVEL6,NULL);
	uart_isr_free(UART_NUM_0);
}

void UARTO_IRQHandle(void)
{
	uart_clear_intr_status(UART_NUM_0,UART_RXFIFO_TOUT_INT_ENA);
	while(1);
}

Code: Select all

void Send_TASK()
{
	while(1)
	{
		printf("test\r\n");
		vTaskDelay(1000 / portTICK_PERIOD_MS);
	}
}

void app_main(void)
{
	UART_Init();

	xTaskCreate(Send_TASK,"send_task",1024,NULL,1,NULL);
}

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

Re: ESP32 can't into IRQHandler

Postby ESP_Sprite » Tue Jan 16, 2018 7:07 am

Suggest you check the return values of all the uart_* calls you make; I bet one of them is trying to tell you you've made an error somewhere but you just throw away that information.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP32 can't into IRQHandler

Postby WiFive » Tue Jan 16, 2018 7:28 am

1. Don't use a high level interrupt
2. There are no level 6 interrupts
3. You immediately disable the interrupt after enabling it by calling uart_isr_free

Rx-365
Posts: 10
Joined: Wed Jan 17, 2018 12:08 am

Re: ESP32 can't into IRQHandler

Postby Rx-365 » Thu Jan 18, 2018 6:47 pm

This is extremely difficult. I have tried numerous avenues, but am still unable to generate an Interrupt. It seems that I cannot register an ISR with uart_isr_register() after I call uart_driver_install(). Based on the code I am under the impression that they each create and ISR.

So, if you call uart_isr_register() then you cannot use UART_ISR_Register()? I am trying to get a simple interrupt for UART_GLITCH_DET_INT_ENA. I can't find any examples or anyone talking about writing a successful UART ISR. Does anyone have information or example code on what to do? The process confuses me quite a bit because I also cannot understand what level interrupt UART_GLITCH_DET_INT_ENA is?

Who is online

Users browsing this forum: Gaston1980 and 113 guests