boards: Add support for the Ambiq Apollo510 EVB board

This commit adds support for the Ambiq Apollo510 Evaluation Board.

Signed-off-by: Hao Luo <hluo@ambiq.com>
This commit is contained in:
Hao Luo 2025-02-17 15:37:41 +08:00 committed by Benjamin Cabé
commit 6575b55bc0
13 changed files with 359 additions and 0 deletions

View file

@ -0,0 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_library()
zephyr_library_sources(board.c)

View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2025 Ambiq Micro Inc. <www.ambiq.com>
config BOARD_APOLLO510_EVB
select BOARD_EARLY_INIT_HOOK

View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2025 Ambiq Micro Inc. <www.ambiq.com>
config BOARD_APOLLO510_EVB
select SOC_APOLLO510

View file

@ -0,0 +1,15 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2025 Ambiq Micro Inc.
if BOARD_APOLLO510_EVB
config SYS_CLOCK_HW_CYCLES_PER_SEC
default 32768 if AMBIQ_STIMER_TIMER
default 96000000 if CORTEX_M_SYSTICK
config LOG_BACKEND_SWO_FREQ_HZ
default 1000000
depends on LOG_BACKEND_SWO
endif # BOARD_APOLLO510_EVB

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2025 Ambiq Micro Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <apollo510/ambiq-apollo510-pinmux.h>
&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0TX_P30>;
};
group2 {
pinmux = <UART0RX_P55>;
input-enable;
};
};
swo_default: swo_default {
group0 {
pinmux = <SWO_P28>;
};
};
};

View file

@ -0,0 +1,128 @@
/dts-v1/;
#include <ambiq/ambiq_apollo510.dtsi>
#include "apollo510_evb-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "Ambiq Apollo510 evaluation board";
compatible = "ambiq,apollo510_evb";
chosen {
zephyr,itcm = &itcm;
zephyr,dtcm = &dtcm;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-pipe = &uart0;
ambiq,xo32m = &xo32m_xtal;
ambiq,xo32k = &xo32k_xtal;
ambiq,extrefclk = &extrefclk;
};
aliases {
watchdog0 = &wdt0;
led0 = &led0;
led1 = &led1;
led2 = &led2;
sw0 = &button0;
sw1 = &button1;
};
sram0: memory@SSRAM_BASE_NAME {
compatible = "mmio-sram";
reg = <SSRAM_BASE_ADDR 0x200000>;
};
sram_no_cache: memory@20280000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x20280000 0x100000>;
zephyr,memory-region = "SRAM_NO_CACHE";
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) )>;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio160_191 5 GPIO_ACTIVE_LOW>;
label = "LED 0";
};
led1: led_1 {
gpios = <&gpio64_95 25 GPIO_ACTIVE_LOW>;
label = "LED 1";
};
led2: led_2 {
gpios = <&gpio64_95 28 GPIO_ACTIVE_LOW>;
label = "LED 2";
};
};
buttons {
compatible = "gpio-keys";
polling-mode;
button0: button_0 {
gpios = <&gpio64_95 29 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "BTN0";
zephyr,code = <INPUT_KEY_0>;
status = "okay";
};
button1: button_1 {
gpios = <&gpio64_95 30 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "BTN1";
zephyr,code = <INPUT_KEY_1>;
status = "okay";
};
};
};
&xo32m_xtal {
clock-frequency = <DT_FREQ_M(48)>;
};
&itm {
pinctrl-0 = <&swo_default>;
pinctrl-names = "default";
};
&uart0 {
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-names = "default";
status = "okay";
};
&stimer0 {
clk-source = <3>;
};
&wdt0 {
status = "okay";
};
&gpio0_31 {
status = "okay";
};
&gpio32_63 {
status = "okay";
};
&gpio64_95 {
status = "okay";
};
&gpio96_127 {
status = "okay";
};
&gpio128_159 {
status = "okay";
};
&gpio160_191 {
status = "okay";
};
&gpio192_223 {
status = "okay";
};

View file

@ -0,0 +1,19 @@
identifier: apollo510_evb
name: Apollo510 EVB
type: mcu
arch: arm
ram: 3072
flash: 4096
toolchain:
- zephyr
- gnuarmemb
supported:
- uart
- watchdog
- gpio
- clock_control
testing:
ignore_tags:
- net
- bluetooth
vendor: ambiq

View file

@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2025 Ambiq Micro Inc.
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_ARM_MPU=y
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y

View file

@ -0,0 +1,57 @@
/*
* Copyright 2025 Ambiq Micro Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/init.h>
#include <zephyr/kernel.h>
#include <am_mcu_apollo.h>
#if DT_HAS_CHOSEN(ambiq_xo32m)
#define XTAL_HS_FREQ DT_PROP(DT_CHOSEN(ambiq_xo32m), clock_frequency)
#if DT_SAME_NODE(DT_CHOSEN(ambiq_xo32m), DT_NODELABEL(xo32m_xtal))
#define XTAL_HS_MODE AM_HAL_CLKMGR_XTAL_HS_MODE_XTAL
#elif DT_SAME_NODE(DT_CHOSEN(ambiq_xo32m), DT_NODELABEL(xo32m_ext))
#define XTAL_HS_MODE AM_HAL_CLKMGR_XTAL_HS_MODE_EXT
#endif
#else
#define XTAL_HS_FREQ 0
#define XTAL_HS_MODE AM_HAL_CLKMGR_XTAL_HS_MODE_XTAL
#endif
#if DT_HAS_CHOSEN(ambiq_xo32k)
#define XTAL_LS_FREQ DT_PROP(DT_CHOSEN(ambiq_xo32k), clock_frequency)
#if DT_SAME_NODE(DT_CHOSEN(ambiq_xo32k), DT_NODELABEL(xo32k_xtal))
#define XTAL_LS_MODE AM_HAL_CLKMGR_XTAL_LS_MODE_XTAL
#elif DT_SAME_NODE(DT_CHOSEN(ambiq_xo32k), DT_NODELABEL(xo32k_ext))
#define XTAL_LS_MODE AM_HAL_CLKMGR_XTAL_LS_MODE_EXT
#endif
#else
#define XTAL_LS_FREQ 0
#define XTAL_LS_MODE AM_HAL_CLKMGR_XTAL_LS_MODE_XTAL
#endif
#if DT_HAS_CHOSEN(ambiq_extrefclk)
#define EXTREFCLK_FREQ DT_PROP(DT_CHOSEN(ambiq_extrefclk), clock_frequency)
#else
#define EXTREFCLK_FREQ 0
#endif
void board_early_init_hook(void)
{
/* Set board related info into clock manager */
am_hal_clkmgr_board_info_t sClkmgrBoardInfo = {.sXtalHs.eXtalHsMode = XTAL_HS_MODE,
.sXtalHs.ui32XtalHsFreq = XTAL_HS_FREQ,
.sXtalLs.eXtalLsMode = XTAL_LS_MODE,
.sXtalLs.ui32XtalLsFreq = XTAL_LS_FREQ,
.ui32ExtRefClkFreq = EXTREFCLK_FREQ};
am_hal_clkmgr_board_info_set(&sClkmgrBoardInfo);
/* Default HFRC and HFRC2 to Free Running clocks */
am_hal_clkmgr_clock_config(AM_HAL_CLKMGR_CLK_ID_HFRC,
AM_HAL_CLKMGR_HFRC_FREQ_FREE_RUN_APPROX_48MHZ, NULL);
am_hal_clkmgr_clock_config(AM_HAL_CLKMGR_CLK_ID_HFRC2,
AM_HAL_CLKMGR_HFRC2_FREQ_FREE_RUN_APPROX_250MHZ, NULL);
}

View file

@ -0,0 +1,6 @@
# Copyright (c) 2025 Ambiq Micro Inc.
# SPDX-License-Identifier: Apache-2.0
board_runner_args(jlink "--device=AP510NFA-CBR" "--iface=swd" "--speed=1000")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -0,0 +1,6 @@
board:
name: apollo510_evb
full_name: Apollo510 SOC Evaluation Board
vendor: ambiq
socs:
- name: apollo510

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View file

@ -0,0 +1,75 @@
.. zephyr:board:: apollo510_evb
Apollo510 EVB is a board by Ambiq featuring their ultra-low power Apollo510 SoC.
Hardware
********
- Apollo510 SoC with up to 250 MHz operating frequency
- ARM® Cortex® M55 core
- 64 kB Instruction Cache and 64 kB Data Cache
- Up to 4 MB of non-volatile memory (NVM) for code/data
- Up to 3 MB of low leakage / low power RAM for code/data
- 256 kB Instruction Tightly Coupled RAM (ITCM)
- 512 kB Data Tightly Coupled RAM (DTCM)
For more information about the Apollo510 SoC and Apollo510 EVB board:
- `Apollo510 Website`_
- `Apollo510 Datasheet`_
- `Apollo510 EVB Website`_
Supported Features
==================
.. zephyr:board-supported-hw::
Programming and Debugging
=========================
.. zephyr:board-supported-runners::
Flashing an application
-----------------------
Connect your device to your host computer using the JLINK USB port.
The sample application :zephyr:code-sample:`hello_world` is used for this example.
Build the Zephyr kernel and application, then flash it to the device:
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: apollo510_evb
:goals: flash
.. note::
``west flash`` requires `SEGGER J-Link software`_ and `pylink`_ Python module
to be installed on you host computer.
Open a serial terminal (minicom, putty, etc.) with the following settings:
- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1
Reset the board and you should be able to see on the corresponding Serial Port
the following message:
.. code-block:: console
Hello World! apollo510_evb
.. _Apollo510 Website:
https://ambiq.com/apollo510/
.. _Apollo510 Datasheet:
https://contentportal.ambiq.com/documents/20123/2877485/Apollo510-SoC-Datasheet.pdf
.. _Apollo510 EVB Website:
For more information, please reach out to Sales and FAE.
.. _SEGGER J-Link software:
https://www.segger.com/downloads/jlink
.. _pylink:
https://github.com/Square/pylink