Skip to content

Commit 6817fb7

Browse files
committed
boards: add support for Artemis Nano from Sparkfun
Implemented support for the new board Artemis Nano from Sparkfun. Added support for the west flash to enable users to flash the board. Users should follow the documentation in the docs section of Zephyr for Artemis Nano. Signed-off-by: Ali Sarlak <[email protected]>
1 parent 2ed8790 commit 6817fb7

File tree

16 files changed

+736
-42
lines changed

16 files changed

+736
-42
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
board_set_flasher_ifnset(sp_artemis)
2+
board_finalize_runner_args(sp_artemis)

boards/sparkfun/artemis_nano.dtsi

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
/*
2+
* Copyright (c) 2023 Ambiq Micro Inc. <www.ambiq.com>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <dt-bindings/pinctrl/ambiq-apollo3-pinctrl.h>
8+
#include "apollo3_evb_connector.dtsi"
9+
10+
&pinctrl {
11+
uart0_default: uart0_default {
12+
group1 {
13+
pinmux = <UART0TX_P22>;
14+
};
15+
group2 {
16+
pinmux = <UART0RX_P23>;
17+
input-enable;
18+
};
19+
};
20+
i2c0_default: i2c0_default {
21+
group1 {
22+
pinmux = <M0SCL_P5>, <M0SDAWIR3_P6>;
23+
drive-open-drain;
24+
drive-strength = "0.5";
25+
bias-pull-up;
26+
};
27+
};
28+
i2c1_default: i2c1_default {
29+
group1 {
30+
pinmux = <M1SCL_P8>, <M1SDAWIR3_P9>;
31+
drive-open-drain;
32+
drive-strength = "0.5";
33+
bias-pull-up;
34+
};
35+
};
36+
i2c2_default: i2c2_default {
37+
group1 {
38+
pinmux = <M2SCL_P27>, <M2SDAWIR3_P25>;
39+
drive-open-drain;
40+
drive-strength = "0.5";
41+
bias-pull-up;
42+
};
43+
};
44+
i2c3_default: i2c3_default {
45+
group1 {
46+
pinmux = <M3SCL_P42>, <M3SDAWIR3_P43>;
47+
drive-open-drain;
48+
drive-strength = "0.5";
49+
bias-pull-up;
50+
};
51+
};
52+
i2c4_default: i2c4_default {
53+
group1 {
54+
pinmux = <M4SCL_P39>, <M4SDAWIR3_P40>;
55+
drive-open-drain;
56+
drive-strength = "0.5";
57+
bias-pull-up;
58+
};
59+
};
60+
i2c5_default: i2c5_default {
61+
group1 {
62+
pinmux = <M5SCL_P48>, <M5SDAWIR3_P49>;
63+
drive-open-drain;
64+
drive-strength = "0.5";
65+
bias-pull-up;
66+
};
67+
};
68+
69+
spi0_default: spi0_default {
70+
group1 {
71+
pinmux = <M0SCK_P5>, <M0MISO_P6>, <M0MOSI_P7>;
72+
};
73+
};
74+
spi1_default: spi1_default {
75+
group1 {
76+
pinmux = <M1SCK_P8>, <M1MISO_P9>, <M1MOSI_P10>;
77+
};
78+
};
79+
spi2_default: spi2_default {
80+
group1 {
81+
pinmux = <M2SCK_P27>, <M2MISO_P25>, <M2MOSI_P28>;
82+
};
83+
};
84+
spi3_default: spi3_default {
85+
group1 {
86+
pinmux = <M3SCK_P42>, <M3MISO_P43>, <M3MOSI_P38>;
87+
};
88+
};
89+
spi4_default: spi4_default {
90+
group1 {
91+
pinmux = <M4SCK_P39>, <M4MISO_P40>, <M4MOSI_P44>;
92+
};
93+
};
94+
spi5_default: spi5_default {
95+
group1 {
96+
pinmux = <M5SCK_P48>, <M5MISO_P49>, <M5MOSI_P47>;
97+
};
98+
};
99+
100+
adc0_default: adc0_default{
101+
group1 {
102+
pinmux = <ADCSE4_P32>, <ADCSE7_P35>;
103+
drive-strength = "0.1";
104+
};
105+
};
106+
107+
mspi0_default: mspi0_default{
108+
group1 {
109+
pinmux = <MSPI0_0_P22>,
110+
<MSPI0_1_P26>,
111+
<MSPI0_2_P4>,
112+
<MSPI0_3_P23>,
113+
<MSPI0_8_P24>;
114+
};
115+
group2 {
116+
pinmux = <NCE19_P19>;
117+
drive-push-pull;
118+
drive-strength = "0.5";
119+
ambiq,iom-nce-module = <0>;
120+
ambiq,iom-num = <6>;
121+
};
122+
};
123+
124+
bleif_default: bleif_default{
125+
group1 {
126+
pinmux = <BLEIF_SCK_P30>,
127+
<BLEIF_MISO_P31>,
128+
<BLEIF_MOSI_P32>,
129+
<BLEIF_CSN_P33>,
130+
<BLEIF_STATUS_P35>,
131+
<BLEIF_IRQ_P41>;
132+
};
133+
};
134+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2024 Ali Sarlak
3+
4+
5+
if BOARD_ARTEMIS_NANO
6+
7+
config BOARD_ARTEMIS_NANO
8+
select SOC_APOLLO3_BLUE
9+
10+
config SYS_CLOCK_HW_CYCLES_PER_SEC
11+
default 32768 if AMBIQ_STIMER_TIMER
12+
13+
endif # BOARD_ARTEMIS_NANO
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Sparkfun artemis_nano board configuration
2+
3+
# Copyright (c) 2024 Ali Sarlak
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if BOARD_ARTEMIS_NANO
7+
8+
config FLASH_BASE_ADDRESS
9+
default 0x10000
10+
11+
endif
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/*
2+
* Copyright (c) 2024 Ali Sarlak
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <dt-bindings/pinctrl/ambiq-apollo3-pinctrl.h>
8+
#include "artemis_nano_connector.dtsi"
9+
10+
&pinctrl {
11+
uart1_default: uart1_default {
12+
group1 {
13+
pinmux = <UART1TX_P42>;
14+
};
15+
group2 {
16+
pinmux = <UART1RX_P43>;
17+
input-enable;
18+
};
19+
};
20+
itm_default: itm_default {
21+
group1 {
22+
pinmux = <SWO_P41>;
23+
};
24+
};
25+
i2c0_default: i2c0_default {
26+
group1 {
27+
pinmux = <M0SCL_P5>, <M0SDAWIR3_P6>;
28+
drive-open-drain;
29+
drive-strength = "0.5";
30+
bias-pull-up;
31+
};
32+
};
33+
i2c1_default: i2c1_default {
34+
group1 {
35+
pinmux = <M1SCL_P8>, <M1SDAWIR3_P9>;
36+
drive-open-drain;
37+
drive-strength = "0.5";
38+
bias-pull-up;
39+
};
40+
};
41+
i2c2_default: i2c2_default {
42+
group1 {
43+
pinmux = <M2SCL_P27>, <M2SDAWIR3_P25>;
44+
drive-open-drain;
45+
drive-strength = "0.5";
46+
bias-pull-up;
47+
};
48+
};
49+
i2c3_default: i2c3_default {
50+
group1 {
51+
pinmux = <M3SCL_P42>, <M3SDAWIR3_P43>;
52+
drive-open-drain;
53+
drive-strength = "0.5";
54+
bias-pull-up;
55+
};
56+
};
57+
i2c4_default: i2c4_default {
58+
group1 {
59+
pinmux = <M4SCL_P39>, <M4SDAWIR3_P40>;
60+
drive-open-drain;
61+
drive-strength = "0.5";
62+
bias-pull-up;
63+
};
64+
};
65+
i2c5_default: i2c5_default {
66+
group1 {
67+
pinmux = <M5SCL_P48>, <M5SDAWIR3_P49>;
68+
drive-open-drain;
69+
drive-strength = "0.5";
70+
bias-pull-up;
71+
};
72+
};
73+
spid0_default: spid0_default {
74+
group1 {
75+
pinmux = <SLSCK_P0>, <SLMISO_P2>, <SLMOSI_P1>, <SLNCE_P3>;
76+
};
77+
};
78+
spi0_default: spi0_default {
79+
group1 {
80+
pinmux = <M0SCK_P5>, <M0MISO_P6>, <M0MOSI_P7>;
81+
};
82+
};
83+
spi1_default: spi1_default {
84+
group1 {
85+
pinmux = <M1SCK_P8>, <M1MISO_P9>, <M1MOSI_P10>;
86+
};
87+
};
88+
89+
spi3_default: spi3_default {
90+
group1 {
91+
pinmux = <M3SCK_P42>, <M3MISO_P43>, <M3MOSI_P38>;
92+
};
93+
};
94+
95+
spi5_default: spi5_default {
96+
group1 {
97+
pinmux = <M5SCK_P48>, <M5MISO_P49>, <M5MOSI_P47>;
98+
};
99+
};
100+
101+
adc0_default: adc0_default{
102+
group1 {
103+
pinmux = <ADCSE4_P32>, <ADCSE7_P35>;
104+
drive-strength = "0.1";
105+
};
106+
};
107+
108+
mspi0_default: mspi0_default{
109+
group1 {
110+
pinmux = <MSPI0_0_P22>,
111+
<MSPI0_1_P26>,
112+
<MSPI0_2_P4>,
113+
<MSPI0_3_P23>,
114+
<MSPI0_8_P24>;
115+
};
116+
group2 {
117+
pinmux = <NCE19_P19>;
118+
drive-push-pull;
119+
drive-strength = "0.5";
120+
ambiq,iom-nce-module = <0>;
121+
ambiq,iom-num = <6>;
122+
};
123+
};
124+
125+
bleif_default: bleif_default{
126+
group1 {
127+
pinmux = <BLEIF_SCK_P30>,
128+
<BLEIF_MISO_P31>,
129+
<BLEIF_MOSI_P32>,
130+
<BLEIF_CSN_P33>,
131+
<BLEIF_STATUS_P35>,
132+
<BLEIF_IRQ_P41>;
133+
};
134+
};
135+
};
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* Copyright (c) 2024 Ali Sarlak
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <ambiq/ambiq_apollo3_blue.dtsi>
10+
11+
#include "artemis_nano-pinctrl.dtsi"
12+
13+
/ {
14+
model = "Sparkfun Artemis Nano";
15+
compatible = "ambiq,artemis_nano";
16+
17+
chosen {
18+
zephyr,itcm = &tcm;
19+
zephyr,sram = &sram0;
20+
zephyr,flash = &flash0;
21+
zephyr,console = &uart1;
22+
zephyr,shell-uart = &uart1;
23+
zephyr,uart-pipe = &uart1;
24+
zephyr,flash-controller = &flash;
25+
};
26+
27+
aliases {
28+
watchdog0 = &wdt0;
29+
led0 = &led0;
30+
};
31+
32+
leds{
33+
compatible = "gpio-leds";
34+
led0: led_0 {
35+
gpios = <&gpio0_31 19 GPIO_ACTIVE_HIGH>;
36+
label = "USER LED";
37+
};
38+
};
39+
};
40+
41+
&flash0 {
42+
erase-block-size = <8192>;
43+
write-block-size = <4>;
44+
45+
partitions {
46+
compatible = "fixed-partitions";
47+
#address-cells = <1>;
48+
#size-cells = <1>;
49+
50+
/* Set 16KB of storage at the end of the 976KB of flash */
51+
storage_partition: partition@f0000 {
52+
label = "storage";
53+
reg = <0x000f0000 0x4000>;
54+
};
55+
};
56+
};
57+
58+
&uart1 {
59+
current-speed = <115200>;
60+
pinctrl-0 = <&uart1_default>;
61+
pinctrl-names = "default";
62+
status = "okay";
63+
};
64+
65+
&stimer0 {
66+
clk-source = <3>;
67+
};
68+
69+
&gpio0_31 {
70+
status = "okay";
71+
};
72+
73+
&i2c2 {
74+
status = "disabled";
75+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Artemis Nano Board Definition
2+
identifier: artemis_nano
3+
name: Artemis Nano
4+
type: mcu
5+
arch: arm
6+
ram: 384
7+
flash: 976
8+
toolchain:
9+
- zephyr
10+
- gnuarmemb
11+
supported:
12+
- uart
13+
- gpio
14+
testing:
15+
ignore_tags:
16+
- net
17+
vendor: sparkfun

0 commit comments

Comments
 (0)