Skip to content

Commit fccb869

Browse files
authored
Merge pull request #392 from sparkfun/release-candidate
v2.1.0
2 parents fb0f04c + c90e8e6 commit fccb869

File tree

83 files changed

+1226
-250
lines changed

Some content is hidden

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

83 files changed

+1226
-250
lines changed

README.MD

+28-8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ An mbed-os enabled Arduino core for Ambiq Apollo3 based boards
99
- [Installation](#installation)
1010
- [**Arduino Boards Manager** (recommended)](#arduino-boards-manager-recommended)
1111
- [**Git** (development)](#git-development)
12+
- [Getting Started](#getting-started)
1213
- [Development Status](#development-status)
1314
- [Priorities](#priorities)
1415
- [More](#more)
@@ -26,14 +27,33 @@ An mbed-os enabled Arduino core for Ambiq Apollo3 based boards
2627

2728
### **Git** (development)
2829
- Ensure the proper directory structure exists by following the [Arduino Boards Manager](#arduino-boards-manager) instructions (install latest)
29-
- Locate and enter the ```Arduino15``` directory
30-
- ```cd ~/.../Arduino15```
31-
- Run the ```dev-install.sh``` script
32-
- ```./packages/SparkFun/hardware/apollo3/*/tools/scripts/dev-install.sh```
30+
- navigate to your directory with the latest version
31+
- rename the directory from 2.x.x to .bckup2.x.x (or simply delete it and download it later if wanted)
32+
- clone this repo
33+
`git clone https://github.com/sparkfun/Arduino_Apollo3.git`
34+
- checkout desired branch
35+
`cd Arduino_Apollo3`
36+
`git checkout release-candidate`
37+
- update all submodules
38+
`git submodule update --init --recursive`
39+
- rename directory from Arduino_Apollo3 to 2.x.x from above
40+
- restart Arduino and enjoy.
41+
42+
## Getting Started
43+
For in depth tutorials, checkout out the [Artemis page](https://www.sparkfun.com/artemis) for the latest. Tutorials that may be of interest include:
44+
- [Installing Board Definitions in the Arduino IDE](https://learn.sparkfun.com/tutorials/installing-board-definitions-in-the-arduino-ide)
45+
- [Artemis Development with the Arduino IDE](https://learn.sparkfun.com/tutorials/artemis-development-with-the-arduino-ide)
46+
47+
If you are comfortable with the arduino IDE and already have the boards installed, we recommend trying some examples from within the arduino IDE. Start with the "Built-in Examples" from arduino, but don't forget to checkout out some of the board specific examples that we have included with the package. These demonstrate how to use some of the libraries that make our Artemis board unique, and can take your next project to a new level!
3348

3449
## Development Status
3550

36-
* v2.0.0 based on an [mbed-os](https://github.com/ARMmbed/mbed-os) framework
51+
* v2.0.0 Based on an [mbed-os](https://github.com/ARMmbed/mbed-os) framework
52+
* v2.1.0 Contains latest fixes for the v2 core and feature that have been added since v2 release
53+
54+
For more information on how to contribute or how to navigate this repo, check out the [Contributing](./docs/CONTRIBUTING.md) page.
55+
56+
As mentioned MbedOS is the framework to our latest Arduino Core. To contribute to, or use these targets on, MbedOS check out the [main repo by ARM](https://github.com/ARMmbed/mbed-os). This library uses mbed libraries built from a fork of mbed that is maintained by us. The latest version of that repo can be found [here](https://github.com/sparkfun/mbed-os-ambiq-apollo3/tree/ambiq-apollo3-arduino).
3757

3858
**Main Arduino Features**
3959
* Serial: ✅
@@ -56,11 +76,11 @@ An mbed-os enabled Arduino core for Ambiq Apollo3 based boards
5676
* PDM Microphones / I2S: ✅
5777
* BLE: ✅
5878
* RTC: ✅
59-
* Watchdog Timer: 🤔
60-
* Multi-bit SPI: 🤔
79+
* Watchdog Timer:
80+
* Burst Mode: ✅
6181

6282
## More
63-
### [License](./docs/ISSUES.md)
83+
### [License](./docs/LICENSE.md)
6484
### [Contributing](./docs/CONTRIBUTING.md)
6585
### [Issue Template](./docs/ISSUES.md)
6686
### [Acknowledgements](./docs/ACKNOWLEDGEMENTS.md)

boards.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ sfe_artemis.build.defines=
3636
sfe_artemis.build.includes=
3737
sfe_artemis.build.libs=
3838

39-
sfe_artemis.menu.svl_baud.921600=921600
4039
sfe_artemis.menu.svl_baud.460800=460800
4140
sfe_artemis.menu.svl_baud.230400=230400
4241
sfe_artemis.menu.svl_baud.115200=115200
4342
sfe_artemis.menu.svl_baud.57600=57600
43+
sfe_artemis.menu.svl_baud.921600=921600
4444
sfe_artemis.menu.loader.option_svl=SparkFun Variable Loader (Recommended)
4545
sfe_artemis.menu.loader.option_asb=Ambiq Secure Bootloader (Advanced)
4646

@@ -72,11 +72,11 @@ sfe_artemis_atp.build.defines=
7272
sfe_artemis_atp.build.includes=
7373
sfe_artemis_atp.build.libs=
7474

75-
sfe_artemis_atp.menu.svl_baud.921600=921600
7675
sfe_artemis_atp.menu.svl_baud.460800=460800
7776
sfe_artemis_atp.menu.svl_baud.230400=230400
7877
sfe_artemis_atp.menu.svl_baud.115200=115200
7978
sfe_artemis_atp.menu.svl_baud.57600=57600
79+
sfe_artemis_atp.menu.svl_baud.921600=921600
8080
sfe_artemis_atp.menu.loader.option_svl=SparkFun Variable Loader (Recommended)
8181
sfe_artemis_atp.menu.loader.option_asb=Ambiq Secure Bootloader (Advanced)
8282

@@ -108,11 +108,11 @@ sfe_artemis_nano.build.defines=
108108
sfe_artemis_nano.build.includes=
109109
sfe_artemis_nano.build.libs=
110110

111-
sfe_artemis_nano.menu.svl_baud.921600=921600
112111
sfe_artemis_nano.menu.svl_baud.460800=460800
113112
sfe_artemis_nano.menu.svl_baud.230400=230400
114113
sfe_artemis_nano.menu.svl_baud.115200=115200
115114
sfe_artemis_nano.menu.svl_baud.57600=57600
115+
sfe_artemis_nano.menu.svl_baud.921600=921600
116116
sfe_artemis_nano.menu.loader.option_svl=SparkFun Variable Loader (Recommended)
117117
sfe_artemis_nano.menu.loader.option_asb=Ambiq Secure Bootloader (Advanced)
118118

@@ -144,11 +144,11 @@ sfe_artemis_thing_plus.build.defines=
144144
sfe_artemis_thing_plus.build.includes=
145145
sfe_artemis_thing_plus.build.libs=
146146

147-
sfe_artemis_thing_plus.menu.svl_baud.921600=921600
148147
sfe_artemis_thing_plus.menu.svl_baud.460800=460800
149148
sfe_artemis_thing_plus.menu.svl_baud.230400=230400
150149
sfe_artemis_thing_plus.menu.svl_baud.115200=115200
151150
sfe_artemis_thing_plus.menu.svl_baud.57600=57600
151+
sfe_artemis_thing_plus.menu.svl_baud.921600=921600
152152
sfe_artemis_thing_plus.menu.loader.option_svl=SparkFun Variable Loader (Recommended)
153153
sfe_artemis_thing_plus.menu.loader.option_asb=Ambiq Secure Bootloader (Advanced)
154154

@@ -180,12 +180,12 @@ sfe_edge.build.defines=
180180
sfe_edge.build.includes=
181181
sfe_edge.build.libs=
182182

183-
sfe_edge.menu.svl_baud.921600=921600
183+
184184
sfe_edge.menu.svl_baud.460800=460800
185185
sfe_edge.menu.svl_baud.230400=230400
186186
sfe_edge.menu.svl_baud.115200=115200
187187
sfe_edge.menu.svl_baud.57600=57600
188-
188+
sfe_edge.menu.svl_baud.921600=921600
189189
sfe_edge.menu.asb_baud.921600=921600 (SparkFun.com)
190190
sfe_edge.menu.asb_baud.115200=115200 (TensorFlow Conference)
191191

@@ -221,11 +221,11 @@ sfe_edge2.build.defines=
221221
sfe_edge2.build.includes=
222222
sfe_edge2.build.libs=
223223

224-
sfe_edge2.menu.svl_baud.921600=921600
225224
sfe_edge2.menu.svl_baud.460800=460800
226225
sfe_edge2.menu.svl_baud.230400=230400
227226
sfe_edge2.menu.svl_baud.115200=115200
228227
sfe_edge2.menu.svl_baud.57600=57600
228+
sfe_edge2.menu.svl_baud.921600=921600
229229
sfe_edge2.menu.loader.option_svl=SparkFun Variable Loader (Recommended)
230230
sfe_edge2.menu.loader.option_asb=Ambiq Secure Bootloader (Advanced)
231231

@@ -257,11 +257,11 @@ sfe_artemis_mm_pb.build.defines=
257257
sfe_artemis_mm_pb.build.includes=
258258
sfe_artemis_mm_pb.build.libs=
259259

260-
sfe_artemis_mm_pb.menu.svl_baud.921600=921600
261260
sfe_artemis_mm_pb.menu.svl_baud.460800=460800
262261
sfe_artemis_mm_pb.menu.svl_baud.230400=230400
263262
sfe_artemis_mm_pb.menu.svl_baud.115200=115200
264263
sfe_artemis_mm_pb.menu.svl_baud.57600=57600
264+
sfe_artemis_mm_pb.menu.svl_baud.921600=921600
265265
sfe_artemis_mm_pb.menu.loader.option_svl=SparkFun Variable Loader (Recommended)
266266
sfe_artemis_mm_pb.menu.loader.option_asb=Ambiq Secure Bootloader (Advanced)
267267

@@ -293,11 +293,11 @@ sfe_artemis_module.build.defines=
293293
sfe_artemis_module.build.includes=
294294
sfe_artemis_module.build.libs=
295295

296-
sfe_artemis_module.menu.svl_baud.921600=921600
297296
sfe_artemis_module.menu.svl_baud.460800=460800
298297
sfe_artemis_module.menu.svl_baud.230400=230400
299298
sfe_artemis_module.menu.svl_baud.115200=115200
300299
sfe_artemis_module.menu.svl_baud.57600=57600
300+
sfe_artemis_module.menu.svl_baud.921600=921600
301301
sfe_artemis_module.menu.loader.option_svl=SparkFun Variable Loader (Recommended)
302302
sfe_artemis_module.menu.loader.option_asb=Ambiq Secure Bootloader (Advanced)
303303

@@ -337,11 +337,11 @@ lora_thing_plus.build.defs=
337337
lora_thing_plus.build.libs=
338338

339339

340-
lora_thing_plus.menu.svl_baud.921600=921600
341340
lora_thing_plus.menu.svl_baud.460800=460800
342341
lora_thing_plus.menu.svl_baud.230400=230400
343342
lora_thing_plus.menu.svl_baud.115200=115200
344343
lora_thing_plus.menu.svl_baud.57600=57600
344+
lora_thing_plus.menu.svl_baud.921600=921600
345345
lora_thing_plus.menu.loader.option_svl=SparkFun Variable Loader (Recommended)
346346
lora_thing_plus.menu.loader.option_asb=Ambiq Secure Bootloader (Advanced)
347347

cores/arduino/sdk/core-implement/CommonAnalog.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,11 @@ ap3_err_t analogWriteFrameWidth(uint32_t width){
213213

214214
ap3_err_t analogWriteFrequency(float freq){
215215
uint32_t new_width = (uint32_t)(AP3_ANALOG_CLK_FREQ / freq);
216+
216217
if (new_width > AP3_MAX_ANALOG_WRITE_WIDTH){
217218
return AP3_ERR;
218219
}
219-
if (new_width < AP3_MAX_ANALOG_WRITE_WIDTH){
220+
if (new_width < AP3_MIN_ANALOG_WRITE_WIDTH){
220221
return AP3_ERR;
221222
}
222223
_analogWriteWidth = new_width;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//Burst Mode example
2+
//TEST_PIN is toggled as fast as possible, with burst mode enable and disabled.
3+
//Use a logic analyzer to view the difference in output
4+
#include "BurstMode.h"
5+
6+
#define TEST_PIN D2 //Change to whatever pin you would like
7+
8+
#define NUM_TOGGLES 20 //Number of times to toggle the gpio as an example task
9+
10+
void setup() {
11+
Serial.begin(115200);
12+
Serial.println("BurstMode Example1 - Enable and Disable");
13+
}
14+
15+
void loop() {
16+
long startTime, endTime;
17+
enableBurstMode(); //Go to 96MHz
18+
//Toggle the with digital write as fast as possible, 20 times
19+
startTime = micros();
20+
for(int i = 0; i < NUM_TOGGLES; i++)
21+
{
22+
digitalWrite(TEST_PIN, HIGH);
23+
digitalWrite(TEST_PIN, LOW);
24+
}
25+
endTime = micros();
26+
Serial.printf("Time (in microseconds) to toggle GPIO %d times = %d, at clock speed %d \r\n",
27+
NUM_TOGGLES, (endTime - startTime), getCpuFreqMHz());
28+
29+
disableBurstMode(); //Go back to 48MHz
30+
//Toggle the with digital write as fast as possible, 20 times
31+
startTime = micros();
32+
for(int i = 0; i < NUM_TOGGLES; i++)
33+
{
34+
digitalWrite(TEST_PIN, HIGH);
35+
digitalWrite(TEST_PIN, LOW);
36+
}
37+
endTime = micros();
38+
Serial.printf("Time (in microseconds) to toggle GPIO %d times = %d, at clock speed %d \r\n",
39+
NUM_TOGGLES, (endTime - startTime), getCpuFreqMHz());
40+
41+
delay(1000);
42+
}

libraries/BurstMode/keywords.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Syntax Coloring Map For 'libraries/BurstMode'
2+
3+
# Datatypes (KEYWORD1)
4+
5+
6+
# Functions (KEYWORD2)
7+
enableBurstMode KEYWORD2
8+
disableBurstMode KEYWORD2
9+
getCpuFreqMHz KEYWORD2
10+
11+
# Structures (KEYWORD3)
12+
13+
# Constants (LITERAL1)
14+
15+
# Properties (LITERAL2)
16+
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=BurstMode
2+
version=2.0.0
3+
author=SparkFun Electronics
4+
maintainer=SparkFun Electronics <sparkfun.com>
5+
sentence=Burst Mode library for the SparkFun Artemis
6+
paragraph=Allows for enabling, disabling, and checking status of burst mode which changes the clock from 48Mhz to 96Mhz
7+
category=
8+
url=
9+
architectures=apollo3

libraries/BurstMode/src/BurstMode.cpp

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#include "BurstMode.h"
2+
3+
uint32_t cpuFreq = 48000000; //At POR core is 48MHz
4+
5+
//Turns main processor from 48MHz to 96MHz
6+
//Returns false if burst mode failed to enable
7+
bool enableBurstMode(void)
8+
{
9+
// Check that the Burst Feature is available.
10+
am_hal_burst_avail_e eBurstModeAvailable;
11+
if (AM_HAL_STATUS_SUCCESS != am_hal_burst_mode_initialize(&eBurstModeAvailable))
12+
{
13+
return (false);
14+
}
15+
16+
// Put the MCU into "Burst" mode.
17+
am_hal_burst_mode_e eBurstMode;
18+
if (AM_HAL_STATUS_SUCCESS != am_hal_burst_mode_enable(&eBurstMode))
19+
{
20+
return (false);
21+
}
22+
cpuFreq = 96000000;
23+
return (true);
24+
}
25+
26+
//Turns main processor from 96MHz to 48MHz
27+
//Returns false if disable fails
28+
bool disableBurstMode(void)
29+
{
30+
am_hal_burst_mode_e eBurstMode;
31+
if (AM_HAL_STATUS_SUCCESS == am_hal_burst_mode_disable(&eBurstMode))
32+
{
33+
if (AM_HAL_NORMAL_MODE != eBurstMode)
34+
{
35+
return (false);
36+
}
37+
}
38+
else
39+
{
40+
return (false);
41+
}
42+
cpuFreq = 48000000;
43+
return (true);
44+
}
45+
46+
//Returns the current core speed
47+
uint32_t getCpuFreqMHz(void)
48+
{
49+
return (cpuFreq);
50+
}

libraries/BurstMode/src/BurstMode.h

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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_CLOCK_SOURCES_H_
23+
#define _AP3_CLOCK_SOURCES_H_
24+
25+
#include "Arduino.h"
26+
27+
bool enableBurstMode();
28+
bool disableBurstMode();
29+
uint32_t getCpuFreqMHz();
30+
31+
#endif //_AP3_GPIO_H_

libraries/EEPROM/examples/Example1_PutGet/Example1_PutGet.ino

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
void setup() {
1414
SERIAL.begin(115200);
1515
SERIAL.println("EEPROM Example1_PutGet");
16+
EEPROM.init();
1617

1718
// use EEPROM.get(int index, T type) to retrieve
1819
// an arbitrary type from flash memory

libraries/PDM/examples/Example2_ConfigureMic/Example2_ConfigureMic.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ void setup()
3636

3737
// The variant files for Artemis carrier boards have Mic data and clock pins defined
3838
// but these pins can be passed to the the .begin function
39-
//if (myPDM.begin() == false) //Use Data, clock defines from variant file
40-
if (myPDM.begin(22, 23) == false) //Data, clock on Artemis Nano - These are the pin names from variant file, not pad names
39+
if (myPDM.begin() == false) //Use Data, clock defines from variant file
40+
//if (myPDM.begin(22, 23) == false) //Data, clock on Artemis Nano - These are the pin names from variant file, not pad names
4141
{
4242
Serial.println("PDM Init failed. Are you sure these pins are PDM capable?");
4343
while (1)

0 commit comments

Comments
 (0)