Page 1 of 1

ESP32 can't into IRQHandler

Posted: Tue Jan 16, 2018 6:55 am
by zcg127
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);
}

Re: ESP32 can't into IRQHandler

Posted: Tue Jan 16, 2018 7:07 am
by ESP_Sprite
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.

Re: ESP32 can't into IRQHandler

Posted: Tue Jan 16, 2018 7:28 am
by WiFive
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

Re: ESP32 can't into IRQHandler

Posted: Thu Jan 18, 2018 6:47 pm
by Rx-365
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?