Skip to content

Conversation

kamnxt
Copy link
Contributor

@kamnxt kamnxt commented Oct 21, 2025

Return an error if trying to send data using a suspended UART, instead of blocking, possibly forever, for a transmission that will never succeed.

Fixes #97063

@kamnxt
Copy link
Contributor Author

kamnxt commented Oct 21, 2025

Changed to -ECANCELED like in uart_nrfx_uarte2.c

#if CONFIG_PM_DEVICE
enum pm_device_state state;
(void)pm_device_state_get(dev, &state);
if (state != PM_DEVICE_STATE_ACTIVE) {
return -ECANCELED;
}
#endif

@etienne-lms
Copy link
Contributor

etienne-lms commented Oct 21, 2025

The change looks consistent to me. I think you need to rebase your change to successfully pass CI tests.

Return an error if trying to send data using a suspended UART,
instead of blocking, possibly forever, for a transmission that will never
succeed.

Signed-off-by: Kamil Krzyżanowski <[email protected]>
@kamnxt kamnxt force-pushed the stm32-uart-pm-check branch from d3c5746 to 65cdcc8 Compare October 22, 2025 09:52
@sonarqubecloud
Copy link

@kamnxt
Copy link
Contributor Author

kamnxt commented Oct 22, 2025

... i guess i should probably change the commit name to have serial instead of uart? or is it fine?

I noticed some of the earlier commits that changed this driver used uart too, so I suppose that is ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: UART Universal Asynchronous Receiver-Transmitter platform: STM32 ST Micro STM32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

STM32 UART driver hangs if trying to TX on a suspended instance when using device PM

4 participants