esp32s2 uart interrupt example

ankayca
Posts: 18
Joined: Wed Aug 26, 2020 4:58 pm

esp32s2 uart interrupt example

Postby ankayca » Mon Aug 31, 2020 11:06 am

Hi this is my first post so sorry for mistakes.

I want to use uart interrupt with esp32s2 but there are no clear code in this site.

I achieved to step in ISR function.
Problem is that I can get rx_fifo_len but I can not get any data
ISR function :

Code: Select all

static void IRAM_ATTR uart_intr_handle(void *arg)
{
uint16_t len,t=0;
len = UART1.status.rxfifo_cnt;
//printf("%d\r\n",len);
while(len){
	buff[t++]=UART1.ahb_fifo.rw_byte;


	len--;
}
ESP_EARLY_LOGI("hallo bro","this is is : %s",buff[t]);
//sprintf(buff,"this is it!%d",t);
//uart_write_bytes(EX_UART_NUM, (const char*) buff, 40);

 uart_flush(EX_UART_NUM);
 uart_clear_intr_status(EX_UART_NUM, UART_RXFIFO_FULL_INT_CLR|UART_RXFIFO_TOUT_INT_CLR);
 flagdeneme=1;

}


esp32 work with

Code: Select all

 UART1.fifo.rw_byte
but esp32s2 has ahb_fifo instead of fifo so I used

Code: Select all

UART1.ahb_fifo.rw_byte
and still I can not read data. What is wrong with me/this ?
I stuck with this 1 week and I want to use interrupt instead of freeRTOS(like examles of esp-idf ) thanks for your help!!!!

Note: I want to step in İSR byte by byte so I think there are some config about it . How can I config for step in byte by byte ?

Who is online

Users browsing this forum: No registered users and 14 guests