Skip to content

Commit fc80b08

Browse files
authored
Bsp Integration (#90)
Bsp Integration
2 parents b253f71 + cd795e9 commit fc80b08

File tree

95 files changed

+530
-6418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+530
-6418
lines changed

boards.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ menu.sbl_baud=Ambiq Secure Bootloader Baud Rate
2828
###############################################################
2929

3030
artemis.name=SparkFun Artemis Module
31-
artemis.build.variant=SparkFun_Artemis
31+
artemis.build.variant=artemis
3232
artemis.build.board=SFE_ARTEMIS
3333
artemis.upload.maximum_size=960000
3434
artemis.upload.sbl_baud=115200
@@ -65,7 +65,7 @@ artemis.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_scri
6565
###############################################################
6666

6767
amap3redboard.name=SparkFun RedBoard Artemis
68-
amap3redboard.build.variant=SparkFun_RedBoard_Artemis
68+
amap3redboard.build.variant=redboard_artemis
6969
amap3redboard.build.board=AM_AP3_SFE_BB_ARTEMIS
7070
amap3redboard.upload.maximum_size=960000
7171
amap3redboard.upload.sbl_baud=115200
@@ -102,7 +102,7 @@ amap3redboard.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linke
102102
###############################################################
103103

104104
amap3nano.name=SparkFun RedBoard Artemis Nano
105-
amap3nano.build.variant=SparkFun_RedBoard_Artemis_Nano
105+
amap3nano.build.variant=redboard_artemis_nano
106106
amap3nano.build.board=AM_AP3_SFE_BB_ARTEMIS_NANO
107107
amap3nano.upload.maximum_size=960000
108108
amap3nano.upload.sbl_baud=115200
@@ -139,7 +139,7 @@ amap3nano.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_sc
139139
###############################################################
140140

141141
amap3atp.name=SparkFun RedBoard Artemis ATP
142-
amap3atp.build.variant=SparkFun_RedBoard_Artemis_ATP
142+
amap3atp.build.variant=redboard_artemis_atp
143143
amap3atp.build.board=AM_AP3_SFE_BB_ARTEMIS_ATP
144144
amap3atp.upload.maximum_size=960000
145145
amap3atp.upload.sbl_baud=115200
@@ -176,7 +176,7 @@ amap3atp.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_scr
176176
###############################################################
177177

178178
amap3thing.name=SparkFun Artemis Thing Plus
179-
amap3thing.build.variant=SparkFun_Artemis_Thing_Plus
179+
amap3thing.build.variant=artemis_thing_plus
180180
amap3thing.build.board=AM_AP3_SFE_THING_PLUS
181181
amap3thing.upload.maximum_size=960000
182182
amap3thing.upload.sbl_baud=115200
@@ -213,7 +213,7 @@ amap3thing.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_s
213213
###############################################################
214214

215215
edge.name=SparkFun Edge
216-
edge.build.variant=SparkFun_Edge
216+
edge.build.variant=edge
217217
edge.build.board=SFE_EDGE
218218
edge.upload.tool=ambiq_bin2board
219219
edge.upload.maximum_size=960000
@@ -260,7 +260,7 @@ edge.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_scripts
260260
###############################################################
261261

262262
edge2.name=SparkFun Edge2
263-
edge2.build.variant=SparkFun_Edge2
263+
edge2.build.variant=edge2
264264
edge2.build.board=SFE_EDGE2
265265
edge2.upload.maximum_size=960000
266266
edge2.upload.sbl_baud=115200

tools/variants/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Variant Tools
2+
=============
3+
4+
The 'single source of truth' for variants is the [SparkFun_AmbiqSuite_Apollo3_BSPs](https://github.com/sparkfun/SparkFun_Apollo3_AmbiqSuite_BSPs) repo. This script is used to sync Arduino's sources with the BSP repo by copying the relevant ```.c``` and ```.h``` files.
5+
6+
* BSP libraries (```libam_bsp.a```) are not copied because Arduino compiles the bsp files with the core
7+
* BSP source (```bsp_pins.src```) are not copied because you are not meant to edit variants in the Arduino environment

tools/variants/arduino_boards.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export BOARDS="edge edge2 artemis artemis_thing_plus redboard_artemis redboard_artemis_atp redboard_artemis_nano"

tools/variants/regen_variants.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env bash
2+
3+
# use this script to update variants based on bsp files
4+
5+
6+
7+
# setup
8+
set -e
9+
set -o errexit
10+
echo "" 1>&2
11+
12+
# get enclosing directory
13+
DIR=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")")
14+
15+
# defaults
16+
BSP_ROOT=.
17+
BOARDS_FILE=$DIR/arduino_boards.sh
18+
VARIANTS_ROOT=../../variants
19+
20+
# handle arguments
21+
while getopts ":r:b:" opt; do
22+
case $opt in
23+
r) BSP_ROOT="$OPTARG"
24+
;;
25+
b) BOARDS_FILE="$OPTARG"
26+
;;
27+
\?) echo "Invalid option -$OPTARG" 1>&2
28+
;;
29+
esac
30+
done
31+
32+
# verify bsp root
33+
echo "Using \$BSP_ROOT=$BSP_ROOT" 1>&2
34+
VFILE=$BSP_ROOT/README.md
35+
if [ -f "$VFILE" ];
36+
then
37+
echo "\$BSP_ROOT verification passed" 1>&2
38+
else
39+
echo "\$BSP_ROOT verification failed" 1>&2
40+
exit 1
41+
fi
42+
43+
# load in boards to handle
44+
echo "Using \$BOARDS_FILE=$BOARDS_FILE" 1>&2
45+
source $BOARDS_FILE
46+
47+
# copy bsp files from BSP repo to Arduino variants
48+
echo "" 1>&2
49+
for value in $BOARDS
50+
do
51+
echo "Copying bsp files for: $value" 1>&2
52+
cp $BSP_ROOT/$value/bsp/am_bsp_pins.c $VARIANTS_ROOT/$value/bsp/am_bsp_pins.c
53+
cp $BSP_ROOT/$value/bsp/am_bsp_pins.h $VARIANTS_ROOT/$value/bsp/am_bsp_pins.h
54+
cp $BSP_ROOT/$value/bsp/am_bsp.c $VARIANTS_ROOT/$value/bsp/am_bsp.c
55+
cp $BSP_ROOT/$value/bsp/am_bsp.h $VARIANTS_ROOT/$value/bsp/am_bsp.h
56+
done

0 commit comments

Comments
 (0)