Skip to content

Commit da399de

Browse files
committed
Merge branch 'master' into core-ble
2 parents 161e2af + 8e999fa commit da399de

File tree

11 files changed

+797
-61
lines changed

11 files changed

+797
-61
lines changed

boards.txt

+75-38
Original file line numberDiff line numberDiff line change
@@ -64,45 +64,45 @@ artemis.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_scri
6464

6565
###############################################################
6666

67-
amap3blackboard.name=SparkFun BlackBoard Artemis
68-
amap3blackboard.build.variant=SparkFun_BlackBoard_Artemis
69-
amap3blackboard.build.board=AM_AP3_SFE_BB_ARTEMIS
70-
amap3blackboard.upload.maximum_size=960000
71-
amap3blackboard.upload.sbl_baud=115200
72-
amap3blackboard.build.arch=APOLLO3
73-
amap3blackboard.build.mcu=cortex-m4
74-
amap3blackboard.build.f_cpu=48000000L
75-
amap3blackboard.build.core=arduino
76-
amap3blackboard.build.includes=-I{build.variant.path}/config
77-
amap3blackboard.build.ldscript={build.variant.path}/linker_scripts/gcc/flash_with_bootloader.ld
78-
amap3blackboard.build.extra_flags=-DPART_apollo3 -DAM_PACKAGE_BGA -DAM_PART_APOLLO3
79-
amap3blackboard.build.preferred_export_format=axf
80-
amap3blackboard.build.defs=
81-
amap3blackboard.build.libs=
82-
amap3blackboard.menu.svl_baud.921600=921600
83-
amap3blackboard.menu.svl_baud.460800=460800
84-
amap3blackboard.menu.svl_baud.230400=230400
85-
amap3blackboard.menu.svl_baud.115200=115200
86-
amap3blackboard.menu.svl_baud.57600=57600
87-
amap3blackboard.menu.loader.sparkfun_svl=SparkFun Variable Loader (Recommended)
88-
amap3blackboard.menu.loader.ambiq_sbl=Ambiq Secure Bootloader (Advanced)
89-
90-
amap3blackboard.menu.svl_baud.57600.upload.svl_baud=57600
91-
amap3blackboard.menu.svl_baud.115200.upload.svl_baud=115200
92-
amap3blackboard.menu.svl_baud.230400.upload.svl_baud=230400
93-
amap3blackboard.menu.svl_baud.460800.upload.svl_baud=460800
94-
amap3blackboard.menu.svl_baud.921600.upload.svl_baud=921600
95-
96-
amap3blackboard.menu.loader.ambiq_sbl.upload.tool=ambiq_bin2board
97-
amap3blackboard.menu.loader.ambiq_sbl.build.ldscript={build.variant.path}/linker_scripts/gcc/ambiq_sbl_app.ld
98-
99-
amap3blackboard.menu.loader.sparkfun_svl.upload.tool=artemis_svl
100-
amap3blackboard.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_scripts/gcc/artemis_sbl_svl_app.ld
67+
amap3redboard.name=SparkFun RedBoard Artemis
68+
amap3redboard.build.variant=SparkFun_RedBoard_Artemis
69+
amap3redboard.build.board=AM_AP3_SFE_BB_ARTEMIS
70+
amap3redboard.upload.maximum_size=960000
71+
amap3redboard.upload.sbl_baud=115200
72+
amap3redboard.build.arch=APOLLO3
73+
amap3redboard.build.mcu=cortex-m4
74+
amap3redboard.build.f_cpu=48000000L
75+
amap3redboard.build.core=arduino
76+
amap3redboard.build.includes=-I{build.variant.path}/config
77+
amap3redboard.build.ldscript={build.variant.path}/linker_scripts/gcc/flash_with_bootloader.ld
78+
amap3redboard.build.extra_flags=-DPART_apollo3 -DAM_PACKAGE_BGA -DAM_PART_APOLLO3
79+
amap3redboard.build.preferred_export_format=axf
80+
amap3redboard.build.defs=
81+
amap3redboard.build.libs=
82+
amap3redboard.menu.svl_baud.921600=921600
83+
amap3redboard.menu.svl_baud.460800=460800
84+
amap3redboard.menu.svl_baud.230400=230400
85+
amap3redboard.menu.svl_baud.115200=115200
86+
amap3redboard.menu.svl_baud.57600=57600
87+
amap3redboard.menu.loader.sparkfun_svl=SparkFun Variable Loader (Recommended)
88+
amap3redboard.menu.loader.ambiq_sbl=Ambiq Secure Bootloader (Advanced)
89+
90+
amap3redboard.menu.svl_baud.57600.upload.svl_baud=57600
91+
amap3redboard.menu.svl_baud.115200.upload.svl_baud=115200
92+
amap3redboard.menu.svl_baud.230400.upload.svl_baud=230400
93+
amap3redboard.menu.svl_baud.460800.upload.svl_baud=460800
94+
amap3redboard.menu.svl_baud.921600.upload.svl_baud=921600
95+
96+
amap3redboard.menu.loader.ambiq_sbl.upload.tool=ambiq_bin2board
97+
amap3redboard.menu.loader.ambiq_sbl.build.ldscript={build.variant.path}/linker_scripts/gcc/ambiq_sbl_app.ld
98+
99+
amap3redboard.menu.loader.sparkfun_svl.upload.tool=artemis_svl
100+
amap3redboard.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_scripts/gcc/artemis_sbl_svl_app.ld
101101

102102
###############################################################
103103

104-
amap3nano.name=SparkFun BlackBoard Artemis Nano
105-
amap3nano.build.variant=SparkFun_BlackBoard_Artemis_Nano
104+
amap3nano.name=SparkFun RedBoard Artemis Nano
105+
amap3nano.build.variant=SparkFun_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
@@ -138,8 +138,8 @@ amap3nano.menu.loader.sparkfun_svl.build.ldscript={build.variant.path}/linker_sc
138138

139139
###############################################################
140140

141-
amap3atp.name=SparkFun BlackBoard Artemis ATP
142-
amap3atp.build.variant=SparkFun_BlackBoard_Artemis_ATP
141+
amap3atp.name=SparkFun RedBoard Artemis ATP
142+
amap3atp.build.variant=SparkFun_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
@@ -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

docs/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ This is a record of the major changes between versions of the SparkFun Arduino A
55

66
Each log entry will use the version number of the release that contains the changes listed. Newest version at the top of the file (just below this line)
77

8+
1.0.8
9+
===================
10+
- Wire library requestFrom address bug fix (previously required address to be set with 'beginTransmission')
11+
- Correct variant definition for Artemis module (Serial mis-definition)
12+
- Correct variant definition for Edge (Wire1 redefinition)
13+
814
1.0.7 -
915
===================
1016
- Rectified error in Artemis variant pin map (pad 46 was listed as available when it is in fact not)

libraries/Wire/src/Wire.cpp

+3-13
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ uint8_t TwoWire::requestFrom(uint8_t address, size_t quantity, bool stopBit)
108108
_rxBuffer.clear();
109109

110110
am_hal_iom_transfer_t iomTransfer = {0};
111-
iomTransfer.uPeerInfo.ui32I2CDevAddr = _txAddress;
111+
iomTransfer.uPeerInfo.ui32I2CDevAddr = address;
112112
iomTransfer.ui32InstrLen = 0; // 8-bit transfers
113113
iomTransfer.ui32Instr = 0; // Offset;
114114
iomTransfer.ui32NumBytes = quantity; // How many bytes to receive
@@ -137,14 +137,9 @@ uint8_t TwoWire::requestFrom(uint8_t address, size_t quantity, bool stopBit)
137137
return byteRead;
138138
}
139139

140-
uint8_t TwoWire::requestFrom(uint8_t address, size_t quantity)
141-
{
142-
return requestFrom(address, quantity, true);
143-
}
144-
145140
void TwoWire::beginTransmission(uint8_t address) {
146141
// save address of target and clear buffer
147-
_txAddress = address;
142+
_transmissionAddress = address;
148143
_txBuffer.clear();
149144

150145
_transmissionBegun = true;
@@ -161,7 +156,7 @@ uint8_t TwoWire::endTransmission(bool stopBit)
161156
_transmissionBegun = false ;
162157

163158
am_hal_iom_transfer_t iomTransfer = {0};
164-
iomTransfer.uPeerInfo.ui32I2CDevAddr = _txAddress;
159+
iomTransfer.uPeerInfo.ui32I2CDevAddr = _transmissionAddress;
165160
iomTransfer.ui32InstrLen = 0; // Use only data phase
166161
iomTransfer.ui32Instr = 0; //
167162
// iomTransfer.ui32NumBytes = ; //
@@ -205,11 +200,6 @@ uint8_t TwoWire::endTransmission(bool stopBit)
205200
}
206201
}
207202

208-
uint8_t TwoWire::endTransmission()
209-
{
210-
return endTransmission(true);
211-
}
212-
213203
size_t TwoWire::write(uint8_t ucData)
214204
{
215205
// No writing, without begun transmission or a full buffer

libraries/Wire/src/Wire.h

+5-7
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ class TwoWire : public Stream, public IOMaster {
4343
void end();
4444
void setClock(uint32_t);
4545

46-
void beginTransmission(uint8_t);
47-
uint8_t endTransmission(bool stopBit);
48-
uint8_t endTransmission(void);
46+
void beginTransmission(uint8_t address);
47+
uint8_t endTransmission(bool stopBit = true);
4948

50-
uint8_t requestFrom(uint8_t address, size_t quantity, bool stopBit);
51-
uint8_t requestFrom(uint8_t address, size_t quantity);
49+
uint8_t requestFrom(uint8_t address, size_t quantity, bool stopBit = true);
5250

5351
size_t write(uint8_t data);
5452
size_t write(const uint8_t * data, size_t quantity);
@@ -73,11 +71,11 @@ class TwoWire : public Stream, public IOMaster {
7371
ap3_gpio_pin_t _padSCL;
7472

7573
bool _transmissionBegun;
76-
uint8_t _txAddress;
74+
uint8_t _transmissionAddress;
7775

7876

7977
RingBufferN<AP3_WIRE_RX_BUFFER_LEN> _rxBuffer;// RX Buffer
80-
RingBufferN<AP3_WIRE_TX_BUFFER_LEN> _txBuffer;//TX buffer
78+
RingBufferN<AP3_WIRE_TX_BUFFER_LEN> _txBuffer;// TX buffer
8179
uint8_t _linearBugger[AP3_WIRE_LINEAR_BUFFER_LEN]; // ToDo: choose a more efficient way to handle this
8280
uint8_t txAddress;
8381

variants/SparkFun_Artemis/config/variant.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ const ap3_gpio_pad_t ap3_variant_pinmap[AP3_VARIANT_NUM_PINS] = {
8787
// Uart Definitions
8888
//Serial(instance, RX, TX)
8989
//We default Serial to 22/23 but can be moved to any TX0/RX0 pin
90-
Uart Serial(0, 23, 22); // Declares a Uart object called Serial using instance 0 of Apollo3 UART peripherals with RX on variant pin 23 and TX on pin 24 (note, you specify *pins* not Apollo3 pads. This uses the variant's pin map to determine the Apollo3 pad)
91-
// 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)
90+
Uart Serial(0, 49, 48); // Declares a Uart object called Serial using instance 0 of Apollo3 UART peripherals with RX on variant pin 49 and TX on pin 48 (note, in this variant the pins map directly to pad, so pin === pad when talking about the pure Artemis module)
9291

9392
// Pin aliasing using the const uint8_t approach
9493
//
@@ -143,4 +142,4 @@ Uart Serial(0, 23, 22); // Declares a Uart object called Serial using instance 0
143142
// AP3_ADC_TEMP_PAD, //34 - Not a real pad, ADC_TEMP
144143
// AP3_ADC_DIV3_PAD, //35 - Not a real pad, ADC_DIV3
145144
// AP3_ADC_VSS_PAD, //36 - Not a real pad, ADC_VSS
146-
// };
145+
// };
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)

0 commit comments

Comments
 (0)