zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
9.92k stars 6.1k forks source link

tests: lpuart: uart_async_api: build failure for mimxrt10xx series #72308

Closed hakehuang closed 3 weeks ago

hakehuang commented 1 month ago

Describe the bug Build failure

Please also mention any information which could help others to understand the problem you're facing:

9320907fdf1f6dc436c426d4d31f0a0f6d2d2e8f is the first bad commit
commit 9320907fdf1f6dc436c426d4d31f0a0f6d2d2e8f
Author: Declan Snyder <declan.snyder@nxp.com>
Date:   Wed Apr 24 19:37:48 2024 -0500

    drivers: uart_mcux_lpuart: Fix APIs used together

    Handle controller instances wanting to use different
    API instances, need to change init flow so that they dont
    interfere with each other, trick for now is returning
    either the interrupt driven or async apis as not enabled
    if the other has already been used on that controller.

    Previously, there was an issue where enabling CONFIG_UART_ASYNC_API
    would overwrite the init even if controller was meant to use
    interrupt driven (as kconfig is global to affect all the controllers)

    Signed-off-by: Declan Snyder <declan.snyder@nxp.com>

 drivers/serial/uart_mcux_lpuart.c | 193 ++++++++++++++++++++++++++++----------
 1 file changed, 143 insertions(+), 50 deletions(-)

To Reproduce Steps to reproduce the behavior:

scripts/twister -p mimxrt10160_evk -T mimxrt1170_evk@B/mimxrt1176/cm7 --build-only

Expected behavior Build pass

Impact build CI

Logs and console output

/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/drivers/serial/uart_mcux_lpuart.c:1030:12: error: 'mcux_lpuart_configure_async' defined but not used [-Werror=unused-function]
 1030 | static int mcux_lpuart_configure_async(const struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.

Environment (please complete the following information):

decsny commented 1 month ago

@hakehuang i don't understand the reproduce step you gave, what sample did you run, and was it rt1060 or rt1170?

hakehuang commented 4 weeks ago

@hakehuang i don't understand the reproduce step you gave, what sample did you run, and was it rt1060 or rt1170?

@decsny it is not a run problem, it is a build issue, zephyr CI does not allow build warning, and in this driver there is an unused fucntion which will cause CI to warn, and the CI build flag is set to wran to error

'mcux_lpuart_configure_async' is called only when 'CONFIG_UART_EXCLUSIVE_API_CALLBACKS' defines, so it is better to refactor this dependency in this driver

nordic-krch commented 4 weeks ago

any news here? I'm also getting CI failures: https://github.com/zephyrproject-rtos/zephyr/actions/runs/9108541914/job/25039692154?pr=71260