Skip to content

Commit c2b855b

Browse files
authored
Merge pull request #47 from sparkfun/2.2.0-update
2.2.0 update
2 parents eeeeb7c + 703db09 commit c2b855b

File tree

138 files changed

+37873
-3034
lines changed

Some content is hidden

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

138 files changed

+37873
-3034
lines changed

cores/arduino/am_sdk_ap3/CMSIS/AmbiqMicro/Include/apollo3.h

Lines changed: 280 additions & 16 deletions
Large diffs are not rendered by default.

cores/arduino/am_sdk_ap3/CMSIS/AmbiqMicro/Include/apollo3c.h

Lines changed: 26576 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
//*****************************************************************************
2+
//
3+
//! @file system_apollo3c.h
4+
//!
5+
//! @brief Ambiq Micro Apollo3C MCU specific functions.
6+
//
7+
//*****************************************************************************
8+
9+
//*****************************************************************************
10+
//
11+
// Copyright (c) 2019, Ambiq Micro
12+
// All rights reserved.
13+
//
14+
// Redistribution and use in source and binary forms, with or without
15+
// modification, are permitted provided that the following conditions are met:
16+
//
17+
// 1. Redistributions of source code must retain the above copyright notice,
18+
// this list of conditions and the following disclaimer.
19+
//
20+
// 2. Redistributions in binary form must reproduce the above copyright
21+
// notice, this list of conditions and the following disclaimer in the
22+
// documentation and/or other materials provided with the distribution.
23+
//
24+
// 3. Neither the name of the copyright holder nor the names of its
25+
// contributors may be used to endorse or promote products derived from this
26+
// software without specific prior written permission.
27+
//
28+
// Third party software included in this distribution is subject to the
29+
// additional license terms as defined in the /docs/licenses directory.
30+
//
31+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34+
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
35+
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36+
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37+
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38+
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39+
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40+
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41+
// POSSIBILITY OF SUCH DAMAGE.
42+
//
43+
//*****************************************************************************
44+
45+
#ifndef SYSTEM_APOLLO3C_H
46+
#define SYSTEM_APOLLO3C_H
47+
48+
#ifdef __cplusplus
49+
extern "C" {
50+
#endif
51+
52+
#include <stdint.h>
53+
54+
extern uint32_t SystemCoreClock; // System Clock Frequency (Core Clock)
55+
56+
//*****************************************************************************
57+
//
58+
// External function definitions
59+
//
60+
//*****************************************************************************
61+
extern void SystemInit (void);
62+
extern void SystemCoreClockUpdate (void);
63+
64+
#ifdef __cplusplus
65+
}
66+
#endif
67+
68+
#endif // SYSTEM_APOLLO3C_H
69+

cores/arduino/am_sdk_ap3/CMSIS/AmbiqMicro/Source/startup_apollo3.s

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4141
; POSSIBILITY OF SUCH DAMAGE.
4242
;
43-
; This is part of revision 2.1.0 of the AmbiqSuite Development Package.
43+
; This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
4444
;
4545
;******************************************************************************
4646

4747
;******************************************************************************
4848
;
4949
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
5050
;************************************************************************
51-
Stack EQU 0x00000400
51+
Stack EQU 0x00001000
5252

5353
;******************************************************************************
5454
;
@@ -146,7 +146,7 @@ __Vectors
146146
DCD am_scard_isr ; 17: SCARD
147147
DCD am_adc_isr ; 18: ADC
148148
DCD am_pdm0_isr ; 19: PDM
149-
DCD am_mspi0_isr ; 20: MSPI
149+
DCD am_mspi0_isr ; 20: MSPI0
150150
DCD am_software0_isr ; 21: SOFTWARE0
151151
DCD am_stimer_isr ; 22: SYSTEM TIMER
152152
DCD am_stimer_cmpr0_isr ; 23: SYSTEM TIMER COMPARE0
@@ -172,25 +172,28 @@ __Vectors_Size EQU __Vectors_End - __Vectors
172172
;
173173
; The Patch table.
174174
;
175+
; The patch table should pad the vector table size to a total of 64 entries
176+
; (16 core + 48 periph) such that code begins at offset 0x100.
177+
;
175178
;******************************************************************************
176179
EXPORT __Patchable
177180
__Patchable
178-
DCD 0
179-
DCD 0
180-
DCD 0
181-
DCD 0
182-
DCD 0
183-
DCD 0
184-
DCD 0
185-
DCD 0
186-
DCD 0
187-
DCD 0
188-
DCD 0
189-
DCD 0
190-
DCD 0
191-
DCD 0
192-
DCD 0
193-
DCD 0
181+
DCD 0 ; 32
182+
DCD 0 ; 33
183+
DCD 0 ; 34
184+
DCD 0 ; 35
185+
DCD 0 ; 36
186+
DCD 0 ; 37
187+
DCD 0 ; 38
188+
DCD 0 ; 39
189+
DCD 0 ; 40
190+
DCD 0 ; 41
191+
DCD 0 ; 42
192+
DCD 0 ; 43
193+
DCD 0 ; 44
194+
DCD 0 ; 45
195+
DCD 0 ; 46
196+
DCD 0 ; 47
194197

195198
;******************************************************************************
196199
;
@@ -402,3 +405,4 @@ __user_initial_stackheap PROC
402405
;******************************************************************************
403406
END
404407

408+

cores/arduino/am_sdk_ap3/mcu/apollo3/am_mcu_apollo.h

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4949
// POSSIBILITY OF SUCH DAMAGE.
5050
//
51-
// This is part of revision 2.1.0 of the AmbiqSuite Development Package.
51+
// This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
5252
//
5353
//*****************************************************************************
5454
#ifndef AM_MCU_APOLLO_H
@@ -106,31 +106,9 @@
106106

107107
#include "regs/am_reg_macros.h"
108108

109-
#include "regs/am_reg_adc.h"
110-
#include "regs/am_reg_apbdma.h"
111-
#include "regs/am_reg_bleif.h"
112-
#include "regs/am_reg_cachectrl.h"
113-
#include "regs/am_reg_clkgen.h"
114-
#include "regs/am_reg_ctimer.h"
115-
#include "regs/am_reg_gpio.h"
116-
#include "regs/am_reg_iom.h"
117-
#include "regs/am_reg_ioslave.h"
118-
#include "regs/am_reg_itm.h"
109+
#include "regs/am_reg.h"
110+
#include "regs/am_reg_m4.h"
119111
#include "regs/am_reg_jedec.h"
120-
#include "regs/am_reg_mcuctrl.h"
121-
#include "regs/am_reg_mspi.h"
122-
#include "regs/am_reg_nvic.h"
123-
#include "regs/am_reg_pdm.h"
124-
#include "regs/am_reg_pwrctrl.h"
125-
#include "regs/am_reg_rstgen.h"
126-
#include "regs/am_reg_rtc.h"
127-
#include "regs/am_reg_security.h"
128-
#include "regs/am_reg_sysctrl.h"
129-
#include "regs/am_reg_systick.h"
130-
#include "regs/am_reg_tpiu.h"
131-
#include "regs/am_reg_uart.h"
132-
#include "regs/am_reg_vcomp.h"
133-
#include "regs/am_reg_wdt.h"
134112

135113
//*****************************************************************************
136114
//
@@ -164,6 +142,7 @@
164142
#include "hal/am_hal_queue.h"
165143
#include "hal/am_hal_reset.h"
166144
#include "hal/am_hal_rtc.h"
145+
#include "hal/am_hal_scard.h"
167146
#include "hal/am_hal_secure_ota.h"
168147
#include "hal/am_hal_stimer.h"
169148
#include "hal/am_hal_security.h"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#******************************************************************************
2+
#
3+
# Makefile - Rules for compiling
4+
#
5+
# Copyright (c) 2019, Ambiq Micro
6+
# All rights reserved.
7+
#
8+
# Redistribution and use in source and binary forms, with or without
9+
# modification, are permitted provided that the following conditions are met:
10+
#
11+
# 1. Redistributions of source code must retain the above copyright notice,
12+
# this list of conditions and the following disclaimer.
13+
#
14+
# 2. Redistributions in binary form must reproduce the above copyright
15+
# notice, this list of conditions and the following disclaimer in the
16+
# documentation and/or other materials provided with the distribution.
17+
#
18+
# 3. Neither the name of the copyright holder nor the names of its
19+
# contributors may be used to endorse or promote products derived from this
20+
# software without specific prior written permission.
21+
#
22+
# Third party software included in this distribution is subject to the
23+
# additional license terms as defined in the /docs/licenses directory.
24+
#
25+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35+
# POSSIBILITY OF SUCH DAMAGE.
36+
#
37+
# This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
38+
#
39+
#******************************************************************************
40+
41+
# All makefiles use this to find the top level directory.
42+
SWROOT?=../../..
43+
44+
# Include rules for building the HAL.
45+
include $(SWROOT)/makedefs/am_hal.mk
46+
47+
# Generate pin definitions for apollo3.
48+
CHIP_GENERATION = 3

cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4646
// POSSIBILITY OF SUCH DAMAGE.
4747
//
48-
// This is part of revision 2.1.0 of the AmbiqSuite Development Package.
48+
// This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
4949
//
5050
//*****************************************************************************
5151

cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_adc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4646
// POSSIBILITY OF SUCH DAMAGE.
4747
//
48-
// This is part of revision 2.1.0 of the AmbiqSuite Development Package.
48+
// This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
4949
//
5050
//*****************************************************************************
5151
#ifndef AM_HAL_ADC_H

cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_ble.c

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4545
// POSSIBILITY OF SUCH DAMAGE.
4646
//
47-
// This is part of revision 2.1.0 of the AmbiqSuite Development Package.
47+
// This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
4848
//
4949
//*****************************************************************************
5050

@@ -70,7 +70,7 @@ am_hal_ble_state_t g_sBLEState[AM_REG_BLEIF_NUM_MODULES];
7070
#define BLEIF_INTSTAT_BLECSSTATN_Msk BLEIF_INTSTAT_B2MSHUTDN_Msk
7171
#define BLEIF_INTSTAT_BLECIRQN_Msk BLEIF_INTSTAT_B2MACTIVE_Msk
7272

73-
#define SKIP_FALLING_EDGES 1
73+
#define SKIP_FALLING_EDGES 0
7474

7575
//*****************************************************************************
7676
//
@@ -697,55 +697,34 @@ am_hal_ble_boot(void *pHandle)
697697
{
698698
// The B0 silicon patching method is slightly different from A1. B0 silicon
699699
// does not require the Copy Patch method introduced for A1 silicon.
700-
if (APOLLO3_B0)
701-
{
702-
//apply the BLE trim value
703-
ui32Status = am_hal_ble_default_trim_set_ramcode(pHandle);
704-
if (ui32Status != AM_HAL_STATUS_SUCCESS)
705-
{
706-
return ui32Status;
707-
}
708-
709-
// Apply the NVDS patch.
710-
ui32Status = am_hal_ble_default_patch_apply(pHandle);
711-
if (ui32Status != AM_HAL_STATUS_SUCCESS)
712-
{
713-
return ui32Status;
714-
}
715-
716-
// Complete the patching step
717-
ui32Status = am_hal_ble_patch_complete(pHandle);
718-
if (ui32Status != AM_HAL_STATUS_SUCCESS)
719-
{
720-
return ui32Status;
721-
}
722-
723-
}
724-
else if (APOLLO3_A0 || APOLLO3_A1)
700+
if (APOLLO3_A0 || APOLLO3_A1)
725701
{
726702
ui32Status = am_hal_ble_default_copy_patch_apply(pHandle);
727703
if (ui32Status != AM_HAL_STATUS_SUCCESS)
728704
{
729705
return ui32Status;
730706
}
707+
}
731708

732-
ui32Status = am_hal_ble_default_trim_set_ramcode(pHandle);
733-
if (ui32Status != AM_HAL_STATUS_SUCCESS)
734-
{
735-
return ui32Status;
736-
}
709+
//apply the BLE trim value
710+
ui32Status = am_hal_ble_default_trim_set_ramcode(pHandle);
711+
if (ui32Status != AM_HAL_STATUS_SUCCESS)
712+
{
713+
return ui32Status;
714+
}
737715

738-
ui32Status = am_hal_ble_default_patch_apply(pHandle);
739-
if (ui32Status != AM_HAL_STATUS_SUCCESS)
740-
{
741-
return ui32Status;
742-
}
716+
// Apply the NVDS patch.
717+
ui32Status = am_hal_ble_default_patch_apply(pHandle);
718+
if (ui32Status != AM_HAL_STATUS_SUCCESS)
719+
{
720+
return ui32Status;
721+
}
743722

744-
ui32Status = am_hal_ble_patch_complete(pHandle);
745-
if (ui32Status != AM_HAL_STATUS_SUCCESS)
746-
{
747-
return ui32Status;
748-
}
723+
// Complete the patching step
724+
ui32Status = am_hal_ble_patch_complete(pHandle);
725+
if (ui32Status != AM_HAL_STATUS_SUCCESS)
726+
{
727+
return ui32Status;
749728
}
750729
}
751730

cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_ble.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4545
// POSSIBILITY OF SUCH DAMAGE.
4646
//
47-
// This is part of revision 2.1.0 of the AmbiqSuite Development Package.
47+
// This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
4848
//
4949
//*****************************************************************************
5050

@@ -723,15 +723,6 @@ extern uint32_t am_hal_ble_default_trim_set(void *pHandle);
723723

724724
uint32_t am_hal_ble_default_trim_set_ramcode(void *pHandle);
725725

726-
//*****************************************************************************
727-
//
728-
// Set the 32M crystal frequency
729-
// based on the tested values at customer side.
730-
// set trim value smaller in case of negative frequency offset
731-
//
732-
//*****************************************************************************
733-
extern uint32_t am_hal_ble_crystal_trim_set(void *pHandle, uint32_t ui32TrimValue);
734-
735726
//*****************************************************************************
736727
//
737728
//! @brief Change the TX power setting.

0 commit comments

Comments
 (0)