Skip to content

Commit 60b6cf0

Browse files
committed
add 'artemis_thing_plus' variant
1 parent d16064f commit 60b6cf0

File tree

7 files changed

+743
-0
lines changed

7 files changed

+743
-0
lines changed

boards.txt

+37
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,43 @@ amap3atp.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_scr
175175

176176
###############################################################
177177

178+
amap3thing.name=SparkFun Artemis Thing Plus
179+
amap3thing.build.variant=SparkFun_Artemis_Thing_Plus
180+
amap3thing.build.board=AM_AP3_SFE_THING_PLUS
181+
amap3thing.upload.maximum_size=960000
182+
amap3thing.upload.sbl_baud=115200
183+
amap3thing.build.arch=APOLLO3
184+
amap3thing.build.mcu=cortex-m4
185+
amap3thing.build.f_cpu=48000000L
186+
amap3thing.build.core=arduino
187+
amap3thing.build.includes=-I{build.variant.path}/config
188+
amap3thing.build.ldscript={build.variant.path}/linker_scripts/gcc/flash_with_bootloader.ld
189+
amap3thing.build.extra_flags=-DPART_apollo3 -DAM_PACKAGE_BGA -DAM_PART_APOLLO3
190+
amap3thing.build.preferred_export_format=axf
191+
amap3thing.build.defs=
192+
amap3thing.build.libs=
193+
amap3thing.menu.svl_baud.921600=921600
194+
amap3thing.menu.svl_baud.460800=460800
195+
amap3thing.menu.svl_baud.230400=230400
196+
amap3thing.menu.svl_baud.115200=115200
197+
amap3thing.menu.svl_baud.57600=57600
198+
amap3thing.menu.loader.sparkfun_svl=SparkFun Variable Loader (Recommended)
199+
amap3thing.menu.loader.ambiq_sbl=Ambiq Secure Bootloader (Advanced)
200+
201+
amap3thing.menu.svl_baud.57600.upload.svl_baud=57600
202+
amap3thing.menu.svl_baud.115200.upload.svl_baud=115200
203+
amap3thing.menu.svl_baud.230400.upload.svl_baud=230400
204+
amap3thing.menu.svl_baud.460800.upload.svl_baud=460800
205+
amap3thing.menu.svl_baud.921600.upload.svl_baud=921600
206+
207+
amap3thing.menu.loader.ambiq_sbl.upload.tool=ambiq_bin2board
208+
amap3thing.menu.loader.ambiq_sbl.build.ldscript={build.variant.path}/linker_scripts/gcc/ambiq_sbl_app.ld
209+
210+
amap3thing.menu.loader.sparkfun_svl.upload.tool=artemis_svl
211+
amap3thing.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_scripts/gcc/artemis_sbl_svl_app.ld
212+
213+
###############################################################
214+
178215
edge.name=SparkFun Edge
179216
edge.build.variant=SparkFun_Edge
180217
edge.build.board=SFE_EDGE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Variant BSP
2+
The Board Support Package (BSP) is a feature of the AmbiqSuite SDK that allows you to:
3+
- define names and default configurations for pins
4+
- write globally-accessible routines for common functions
5+
6+
These features are potentially useful when:
7+
- designing an Apollo3-based board for a custom purpose where pin functions will be mainly static
8+
- using AmbiqSuite examples within Arduino
9+
10+
For an example of a BSP see the AmbiqSuite release 2.1.0 SDK under 'SDK/boards/Apollo3_EVB/bsp'
11+
12+
To include BSP files (i.e. am_bsp.h, am_bsp.c, am_bsp_pins.h, am_bsp_pins.c, as well as
13+
bsp_pins.src and pinconfig.py) add " -I{build.variant.path}/bsp" to the board definition in
14+
boards.txt as part of the board.build.includes parameter.
15+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
Copyright (c) 2019 SparkFun Electronics
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
21+
*/
22+
23+
#include "variant.h"
24+
25+
const ap3_gpio_pad_t ap3_variant_pinmap[AP3_VARIANT_NUM_PINS] = {
26+
//~ = PWM, A = ADC
27+
//Apollo Pad, //Silkscreen indicator - Pin functions
28+
25, //0 - ~RX1/SDA2/MISO2
29+
24, //1 - ~TX1/32kHz/SWO
30+
44, //2 - ~MOSI4
31+
35, //3/A6 - ~A/TX1/I2SDAT/PDMCLK
32+
4, //4 - ~RX1/SLINT
33+
22, //5 - ~PDMCLK/SWO
34+
23, //6 - ~I2SWCLK/CMPOUT
35+
27, //7 - ~SCL2/SCK2
36+
28, //8 - ~MOSI2/I2SWCLK
37+
32, //9/A7 - ~A/SCCIO
38+
14, //10 - SWCH/ADCD1N/TX1/PDMCLK
39+
7, //11 - ~MOSI0/CLKOUT
40+
6, //12 - ~MISO0/SDA0/I2SDAT
41+
5, //13 - ~SCK0/SCL0
42+
40, //14 - SDA4/MISO4/RX1
43+
39, //15 - ~SCL4/SCK4/TX1
44+
43, //16 - ~SDA3/MISO3/RX1
45+
42, //17 - ~SCL3/SCK3/TX1
46+
26, //18 - ~LED/SCCRST
47+
33, //19/A0 - ~A/SWO/32KHZ
48+
13, //20/A1 - ~A/I2SBCLK/RX1
49+
11, //21/A2 - ~A/PDMDATA
50+
29, //22/A3 - ~A/PDMDATA
51+
12, //23/A4 - ~A/PDMCLK/TX1
52+
31, //24/A5 - ~A/SCCCLK
53+
48, //25 - Not exposed, TX0
54+
49, //26 - Not exposed, RX0
55+
36, //27 - Not exposed, PDMDATA of Mic
56+
37, //28 - Not exposed, PDMCLK of Mic
57+
};
58+
59+
// Uart Definitions
60+
//Serial(instance, RX, TX)
61+
Uart Serial(0, 26, 25); // Declares a Uart object called Serial using instance 0 of Apollo3 UART peripherals with RX on variant pin 26 and TX on pin 25 (note, you specify *pins* not Apollo3 pads. This uses the variant's pin map to determine the Apollo3 pad)
62+
Uart Serial1(1, 0, 1); // Declares a Uart object called Serial1 using instance 1 of Apollo3 UART peripherals with RX on pin 0 and TX on pin 1 (note, you specify *pins* not Apollo3 pads. This uses the variant's pin map to determine the Apollo3 pad)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
Copyright (c) 2019 SparkFun Electronics
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
21+
*/
22+
#ifndef _AP3_VARIANT_H_
23+
#define _AP3_VARIANT_H_
24+
25+
#include "Arduino.h"
26+
27+
#define AP3_VARIANT_NUM_PINS (29)
28+
29+
// Pin map declaration
30+
extern const ap3_gpio_pad_t ap3_variant_pinmap[AP3_VARIANT_NUM_PINS];
31+
32+
// Uart declarations
33+
class Uart; // Forward declaration of Uart
34+
extern Uart Serial;
35+
extern Uart Serial1;
36+
37+
// Wire defines
38+
#define WIRE_INTERFACES_COUNT 2
39+
40+
#define WireQwiic Wire // Giving Wire an alias of "WireQwiic" in case people want to use it
41+
#define AP3_Wire_IOM 4 // Secify that Wire uses IOMaster instance 4
42+
#define AP3_Wire1_IOM 3 // Secify that Wire1 uses IOMaster instance 3
43+
44+
// SPI Defines
45+
#define SPI_INTERFACES_COUNT 1
46+
47+
#define AP3_SPI_IOM 0 // Specify that SPI uses IOMaster 0
48+
#define AP3_SPI_DUP ap3_spi_full_duplex // Specify that SPI is full-duplex (as opposed to ap3_spi_tx_only or ap3_spi_rx_only)
49+
50+
// Mapping of analog pins to digital pins of variant
51+
#define A0 19
52+
#define A1 20
53+
#define A2 21
54+
#define A3 22
55+
#define A4 23
56+
#define A5 24
57+
#define A6 3
58+
#define A7 9
59+
60+
#define LED_BUILTIN 18
61+
62+
// SPI Pins
63+
#define MOSI 11
64+
#define MISO 12
65+
#define SCK 13
66+
// Wire Pins
67+
#define SCL 15
68+
#define SDA 14
69+
// Wire1 Pins
70+
#define SCL1 17
71+
#define SDA1 16
72+
// Serial1 Pins
73+
#define TX1 1
74+
#define RX1 0
75+
// PDM Microphone Pins
76+
#define MIC_DATA 27
77+
#define MIC_CLOCK 28
78+
79+
#endif // _AP3_VARIANT_H_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/******************************************************************************
2+
*
3+
* blank_slate.ld - Linker script for applications using startup_gnu.c
4+
*
5+
*****************************************************************************/
6+
ENTRY(Reset_Handler)
7+
8+
MEMORY
9+
{
10+
FLASH (rx) : ORIGIN = 0x0000C000, LENGTH = 960K
11+
SRAM (rwx) : ORIGIN = 0x10000000, LENGTH = 384K
12+
}
13+
14+
SECTIONS
15+
{
16+
.text :
17+
{
18+
. = ALIGN(4);
19+
KEEP(*(.isr_vector))
20+
KEEP(*(.patch))
21+
*(.text)
22+
*(.text*)
23+
24+
. = ALIGN(4);
25+
__init_array_start = .;
26+
KEEP(*(.init_array)) /* C++ constructors */
27+
KEEP(*(.ctors)) /* and vtable init */
28+
__init_array_end = .;
29+
30+
*(.rodata)
31+
*(.rodata*)
32+
. = ALIGN(4);
33+
_etext = .;
34+
} > FLASH
35+
36+
/* User stack section initialized by startup code. */
37+
.stack (NOLOAD):
38+
{
39+
. = ALIGN(8);
40+
*(.stack)
41+
*(.stack*)
42+
. = ALIGN(8);
43+
} > SRAM
44+
45+
.data :
46+
{
47+
. = ALIGN(4);
48+
_sdata = .;
49+
*(.data)
50+
*(.data*)
51+
. = ALIGN(4);
52+
_edata = .;
53+
} > SRAM AT>FLASH
54+
55+
/* used by startup to initialize data */
56+
_init_data = LOADADDR(.data);
57+
58+
.bss :
59+
{
60+
. = ALIGN(4);
61+
_sbss = .;
62+
*(.bss)
63+
*(.bss*)
64+
*(COMMON)
65+
. = ALIGN(4);
66+
_ebss = .;
67+
} > SRAM
68+
69+
.heap (COPY):
70+
{
71+
__end__ = .;
72+
PROVIDE(end = .);
73+
*(.heap*)
74+
__HeapLimit = .;
75+
} > SRAM
76+
77+
.ARM.attributes 0 : { *(.ARM.attributes) }
78+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/******************************************************************************
2+
*
3+
* blank_slate.ld - Linker script for applications using startup_gnu.c
4+
*
5+
*****************************************************************************/
6+
ENTRY(Reset_Handler)
7+
8+
MEMORY
9+
{
10+
FLASH (rx) : ORIGIN = 0x00010000, LENGTH = 960K /*Modified from 0xC000 to work with SparkFun ABL*/
11+
SRAM (rwx) : ORIGIN = 0x10000000, LENGTH = 384K
12+
}
13+
14+
SECTIONS
15+
{
16+
.text :
17+
{
18+
. = ALIGN(4);
19+
KEEP(*(.isr_vector))
20+
KEEP(*(.patch))
21+
*(.text)
22+
*(.text*)
23+
24+
. = ALIGN(4);
25+
__init_array_start = .;
26+
KEEP(*(.init_array)) /* C++ constructors */
27+
KEEP(*(.ctors)) /* and vtable init */
28+
__init_array_end = .;
29+
30+
*(.rodata)
31+
*(.rodata*)
32+
. = ALIGN(4);
33+
_etext = .;
34+
} > FLASH
35+
36+
/* User stack section initialized by startup code. */
37+
.stack (NOLOAD):
38+
{
39+
. = ALIGN(8);
40+
*(.stack)
41+
*(.stack*)
42+
. = ALIGN(8);
43+
} > SRAM
44+
45+
.data :
46+
{
47+
. = ALIGN(4);
48+
_sdata = .;
49+
*(.data)
50+
*(.data*)
51+
. = ALIGN(4);
52+
_edata = .;
53+
} > SRAM AT>FLASH
54+
55+
/* used by startup to initialize data */
56+
_init_data = LOADADDR(.data);
57+
58+
.bss :
59+
{
60+
. = ALIGN(4);
61+
_sbss = .;
62+
*(.bss)
63+
*(.bss*)
64+
*(COMMON)
65+
. = ALIGN(4);
66+
_ebss = .;
67+
} > SRAM
68+
69+
.heap (COPY):
70+
{
71+
__end__ = .;
72+
PROVIDE(end = .);
73+
*(.heap*)
74+
__HeapLimit = .;
75+
} > SRAM
76+
77+
/* TODO: Collision Checking (at link time) */
78+
79+
.ARM.attributes 0 : { *(.ARM.attributes) }
80+
}

0 commit comments

Comments
 (0)