Setting the uart buffer threshold but not working the way I think it works

noweare
Posts: 74
Joined: Tue Jul 02, 2019 11:35 am

Setting the uart buffer threshold but not working the way I think it works

Postby noweare » Fri Nov 05, 2021 4:53 pm

Hello,

I am setting the uart rx threshold value to 8 ( .rx_flow_ctrl_thresh = 8) I thought it would cause a UART_BUFFER_FULL event after sending 8 characters to the rx port but it seems not to. I do have .flow_ctrl = UART_HW_FLOWCTRL_DISABLE. Does that cause the threshold value to be ignored ?

Thank you

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

Re: Setting the uart buffer threshold but not working the way I think it works

Postby WiFive » Sat Nov 06, 2021 4:15 am

Try rxfifo_full_thresh

noweare
Posts: 74
Joined: Tue Jul 02, 2019 11:35 am

Re: Setting the uart buffer threshold but not working the way I think it works

Postby noweare » Mon Nov 08, 2021 9:29 pm

Having problems getting the uart interrupt working without panicking when I input a character.
I don't know if I am understanding the uart correctly but if I just install the driver and don't register an uart interrupt routine then
a state machine handles the details of getting input into the rxfifo then I can respond to uart events.

I could not find an example of using a uart interrupt on the expansive www and I've read the docs at least a few times but obviously doing something incorrectly.

~Joe

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

Re: Setting the uart buffer threshold but not working the way I think it works

Postby WiFive » Tue Nov 09, 2021 5:35 pm

The uart has a hardware state machine that receives bytes into the fifo. The uart driver has an isr that copies bytes into the rxbuffer on full or idle. Ideally you just use a high priority task which waits for data. If necessary you can decrease latency by using menuconfig option to place uart isr in iram. Unless you have very specific requirements it should not be necessary to use a custom isr.

Who is online

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