-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: UART API Enhancements #8243
Comments
I am also voting for changing properties like the baud rate at runtime. We have peripherals that have a quite low baud rate like 9600 per default and store changes to that only in volatile memory. Therefore we set 9600 in dts as the |
Parallel with the TX/RX ring buffer implementation it’s necessary to take in consideration the RTS/CTS hardware handshake handling too. To integrate a cellular modem over U(S)ART, for example, the above-mentioned features are compulsory together with the mentioned dynamic parameter/properties settings. |
Please review [RFC] WCN14A2A LTE/LTE-M Modem Driver Changes #6344 |
This has now been implemented as part of #10765 . Details of the API is still being worked on (it's marked EXPERIMENTAL), implementation needs optimization, but otherwise the intended functionality is there and ready for interested parties to play with (and provide feedback, to drive further elaboration). |
@qianfan-Zhao , I guess we can close this one since it is now available in mainline. Please reopen it if needed. |
Support change bandrate, parity and others
I had a discuss with @erwango about change uart's baudrate and others at runtime or configuration:
I think the best way is we can changed baudrate and others both at runtime and configuration. Now zephyr support change bandrate in dts in this way:
How about add somethings like that, eg: current-parity , current-stop-bits , current-data-bits ?
@JoeHut @ibisz
There has a way change baudrate at runtime and some uart drivers implement that, such as uart_ns16550 and uart_qmsi . How about expand line_ctrl_set to make it support change others properties ?
Hardware control like RTS and CTS also can be changed by using line_ctrl_set
RS485 mode
Many soc such as stm32f070 support 'RS-485 transceiver' mode, there should has some options in dts to make uart support RS485 mode. linux can do that in dts by using this options:
If the soc doesn't support hardware RS485 mode, using a GPIO simulate rts pin is a good way. Also we can add this property:
Using ring_buffer cache uart data
If CONFIG_UART_INTERRUPT_DRIVEN was configured, there should has one tx_ringbuffer and one rx_ringbuffer to cached the data received or to be sended. This feature and ringbuffer's size can be select in Kconfig. Upper layer can recieved a signal when data arrived and decided wether or not read thats data. the tx_ringbuffer cached upper layer's data and sending them when the bus is not busy.
But some soc has hardware FIFO, I don't know if this fearure is really need.
Zephyr only supports one uart-pipe configured in dts. If you need two or more uart-pipe you need do lot of work. We should rework uart_pipe_register API to register more than one uart-pipe.
There are many shortcomings like @mike-scott said:
And he rewrite a better driver in PR #6344 , I think that's a good solution.
The text was updated successfully, but these errors were encountered: