You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing an issue trying to use the UART hal on Ambiq Apollo 3. Follow the report:
Describe the bug
I'm trying to compile an application for Ambiq Apollo 3 using Zephyr 4.0.0, but I'm getting undefined reference for am_hal_uart_* API and I could not find a way to include it into compilation by configuration. In the end, I explicitly added a zephyr_library_sources command into my app's CMakeLists.txt to explicitly include the modules/hal/ambiq/mcu/apollo3/hal/am_hal_uart.c source file.
To Reproduce
Try to compile a simple application using UART API for Ambiq Apollo3 on Zephyr 4.0.0:
Environment (please complete the following information):
OS: Linux
Toolchain: Zephyr SDK
Version: 4.0.0
Additional context
Follow the Apollo 3 MCU module CMakeLists (modules/hal/ambiq/mcu/apollo3/CMakeLists.txt). As one can see, the hal/am_hal_uart.c is missing and there is configuration to add it into compilation:
# Ambiq HAL
#
# Copyright (c) 2024 Ambiq Micro Inc. <www.ambiq.com>
#
# SPDX-License-Identifier: Apache-2.0
# Sources and headers necessary for every build.
# These contain definitions and implementation used mostly for
# initializing the SoC, and therefore are always required.
zephyr_library()
zephyr_library_sources(hal/am_hal_global.c)
zephyr_library_sources(hal/am_hal_pwrctrl.c)
zephyr_library_sources(hal/am_hal_queue.c)
zephyr_library_sources(hal/am_hal_cachectrl.c)
zephyr_library_sources(hal/am_hal_interrupt.c)
zephyr_library_sources(hal/am_hal_flash.c)
zephyr_library_sources(hal/am_hal_rtc.c)
zephyr_library_sources(hal/am_hal_mcuctrl.c)
zephyr_library_sources(hal/am_hal_burst.c)
zephyr_library_sources(hal/am_hal_reset.c)
zephyr_library_sources(hal/am_hal_clkgen.c)
zephyr_library_sources(hal/am_hal_sysctrl.c)
zephyr_library_sources(hal/am_hal_debug.c)
if(CONFIG_AMBIQ_HAL_USE_GPIO)
zephyr_library_sources(hal/am_hal_gpio.c)
endif()
if(CONFIG_AMBIQ_HAL_USE_STIMER)
zephyr_library_sources(hal/am_hal_stimer.c)
endif()
if(CONFIG_AMBIQ_HAL_USE_TIMER)
zephyr_library_sources(hal/am_hal_ctimer.c)
endif()
if(CONFIG_AMBIQ_HAL_USE_WDT)
zephyr_library_sources(hal/am_hal_wdt.c)
endif()
if(CONFIG_AMBIQ_HAL_USE_I2C OR CONFIG_AMBIQ_HAL_USE_SPIC OR CONFIG_AMBIQ_HAL_USE_SPI)
zephyr_library_sources(hal/am_hal_iom.c)
zephyr_library_sources(hal/am_hal_cmdq.c)
endif()
if(CONFIG_AMBIQ_HAL_USE_SPID)
zephyr_library_sources(hal/am_hal_ios.c)
endif()
if(CONFIG_AMBIQ_HAL_USE_MSPI)
zephyr_library_sources(hal/am_hal_mspi.c)
zephyr_library_sources(hal/am_hal_cmdq.c)
endif()
if(CONFIG_AMBIQ_HAL_USE_BLEIF)
zephyr_library_sources(hal/am_hal_ble.c)
zephyr_library_sources(hal/am_hal_ble_patch.c)
zephyr_library_sources(hal/am_hal_ble_patch_b0.c)
endif()
if(CONFIG_AMBIQ_HAL_USE_ADC)
zephyr_library_sources(hal/am_hal_adc.c)
endif()
The text was updated successfully, but these errors were encountered:
Hi,
I'm facing an issue trying to use the UART hal on Ambiq Apollo 3. Follow the report:
Describe the bug
I'm trying to compile an application for Ambiq Apollo 3 using Zephyr 4.0.0, but I'm getting undefined reference for
am_hal_uart_*
API and I could not find a way to include it into compilation by configuration. In the end, I explicitly added azephyr_library_sources
command into my app's CMakeLists.txt to explicitly include themodules/hal/ambiq/mcu/apollo3/hal/am_hal_uart.c
source file.To Reproduce
Try to compile a simple application using UART API for Ambiq Apollo3 on Zephyr 4.0.0:
Expected behavior
The application is compiled successfully.
Impact
I could workaround it, but it seems the UART module is missing on Apollo3's MCU lib.
Logs and console output
Environment (please complete the following information):
Additional context
Follow the Apollo 3 MCU module CMakeLists (modules/hal/ambiq/mcu/apollo3/CMakeLists.txt). As one can see, the
hal/am_hal_uart.c
is missing and there is configuration to add it into compilation:The text was updated successfully, but these errors were encountered: