-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
uart_configure does not return -ENOTSUP for stm32 uart with 9 bit data length. #31799
Comments
Actually the driver itself supports configuring UART to 9 bit mode. Looks like it is the API that is missing. |
@zisisadamos I'm a bit confused with this issue. And the fix provided didn't seem correct. |
Definately. So I am trying to do 9bit data transfers(excluding parity and stop bits) with zephyr. Which at least for stm32 driver doesn't seem to be supported(all transfer functions i found on the driver are for 8 bits). So I assumed that when i try to configure serial for 9bit data width it should return -ENOTSUP. Which it doesnt. |
ok, got it. Then I think |
I think we can do 9bit as well I was thinking of implementing it. Just wanted to do that fix for now so I get familiar with contribution flow. 9bit is only impossible for poll api of zephyr because the specify the input type and dont use pointer(poll_out specifically). |
I think it would be better to extend the API to support 9 bit transfers, for example, using |
I was thinking about casting the pointer according to configuration. That would only require poll_write to change. |
The send/receive functions all takes 8-bit character or 8-bit byte array so 9-bit data cannot be sent through them. That's why I think we will need a new set of API which takes |
All of them except uart_poll_out accept pointers. So if driver does cast uint8_t* to uint16_t* based on configuration why do we need to change APIs? We can only change uart_poll_out to accept a pointer instead of an actual value. Then driver can handle it internally. |
Conceptually, the array represents a series of datum to send or receive. In 8-bit mode, it's just an array of 8-bit characters. When the driver arbitrarily type casts the input, it becomes less clear on what is expected from the app. Does one datum occupy 2 bytes? Or do you pack multiple 9-bit data continuous into the array? I simply wish the API to be straight-forward, so app developers do not have to have in-depth knowledge of the drivers. |
@zisisadamos @dcpleung I propose we create a dedicated UART API issue for the 9 bit support. |
…TSUP. Fixes driver incorrectly indicating that drive r supports 7 and 9 bit modes. Fixes zephyrproject-rtos#31799 Signed-off-by: Zisis Adamos <[email protected]>
I think configuring PARITY bits in UART has similar issue. |
@easternblack Don't hesitate to raise a dedicated issue so we don't lose the point. |
STM32 uart driver doesn't support 9bits transactions in any case, so remove case were it was declared as supported. Fixes zephyrproject-rtos#31799 Signed-off-by: Erwan Gouriou <[email protected]>
STM32 uart driver doesn't support 9bits transactions in any case, so remove case were it was declared as supported. Fixes #31799 Signed-off-by: Erwan Gouriou <[email protected]>
STM32 uart driver doesn't support 9bits transactions in any case, so remove case were it was declared as supported. Fixes #31799 Signed-off-by: Erwan Gouriou <[email protected]>
STM32 uart driver doesn't support 9bits transactions in any case, so remove case were it was declared as supported. Fixes #31799 Signed-off-by: Erwan Gouriou <[email protected]>
Describe the bug
When we use uart_configure on STM32 for a device with data length of 9 bits we dont get -ENOTSUP
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Return -ENOTSUP
Impact
Not that critical. Lack of 9bit support is more critical.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: