Skip to content

2.2.0 update #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
296 changes: 280 additions & 16 deletions cores/arduino/am_sdk_ap3/CMSIS/AmbiqMicro/Include/apollo3.h

Large diffs are not rendered by default.

26,576 changes: 26,576 additions & 0 deletions cores/arduino/am_sdk_ap3/CMSIS/AmbiqMicro/Include/apollo3c.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//*****************************************************************************
//
//! @file system_apollo3c.h
//!
//! @brief Ambiq Micro Apollo3C MCU specific functions.
//
//*****************************************************************************

//*****************************************************************************
//
// Copyright (c) 2019, Ambiq Micro
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// Third party software included in this distribution is subject to the
// additional license terms as defined in the /docs/licenses directory.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************

#ifndef SYSTEM_APOLLO3C_H
#define SYSTEM_APOLLO3C_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

extern uint32_t SystemCoreClock; // System Clock Frequency (Core Clock)

//*****************************************************************************
//
// External function definitions
//
//*****************************************************************************
extern void SystemInit (void);
extern void SystemCoreClockUpdate (void);

#ifdef __cplusplus
}
#endif

#endif // SYSTEM_APOLLO3C_H

42 changes: 23 additions & 19 deletions cores/arduino/am_sdk_ap3/CMSIS/AmbiqMicro/Source/startup_apollo3.s
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
; This is part of revision 2.1.0 of the AmbiqSuite Development Package.
; This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
;
;******************************************************************************

;******************************************************************************
;
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
;************************************************************************
Stack EQU 0x00000400
Stack EQU 0x00001000

;******************************************************************************
;
Expand Down Expand Up @@ -146,7 +146,7 @@ __Vectors
DCD am_scard_isr ; 17: SCARD
DCD am_adc_isr ; 18: ADC
DCD am_pdm0_isr ; 19: PDM
DCD am_mspi0_isr ; 20: MSPI
DCD am_mspi0_isr ; 20: MSPI0
DCD am_software0_isr ; 21: SOFTWARE0
DCD am_stimer_isr ; 22: SYSTEM TIMER
DCD am_stimer_cmpr0_isr ; 23: SYSTEM TIMER COMPARE0
Expand All @@ -172,25 +172,28 @@ __Vectors_Size EQU __Vectors_End - __Vectors
;
; The Patch table.
;
; The patch table should pad the vector table size to a total of 64 entries
; (16 core + 48 periph) such that code begins at offset 0x100.
;
;******************************************************************************
EXPORT __Patchable
__Patchable
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0 ; 32
DCD 0 ; 33
DCD 0 ; 34
DCD 0 ; 35
DCD 0 ; 36
DCD 0 ; 37
DCD 0 ; 38
DCD 0 ; 39
DCD 0 ; 40
DCD 0 ; 41
DCD 0 ; 42
DCD 0 ; 43
DCD 0 ; 44
DCD 0 ; 45
DCD 0 ; 46
DCD 0 ; 47

;******************************************************************************
;
Expand Down Expand Up @@ -402,3 +405,4 @@ __user_initial_stackheap PROC
;******************************************************************************
END


29 changes: 4 additions & 25 deletions cores/arduino/am_sdk_ap3/mcu/apollo3/am_mcu_apollo.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 2.1.0 of the AmbiqSuite Development Package.
// This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
//
//*****************************************************************************
#ifndef AM_MCU_APOLLO_H
Expand Down Expand Up @@ -106,31 +106,9 @@

#include "regs/am_reg_macros.h"

#include "regs/am_reg_adc.h"
#include "regs/am_reg_apbdma.h"
#include "regs/am_reg_bleif.h"
#include "regs/am_reg_cachectrl.h"
#include "regs/am_reg_clkgen.h"
#include "regs/am_reg_ctimer.h"
#include "regs/am_reg_gpio.h"
#include "regs/am_reg_iom.h"
#include "regs/am_reg_ioslave.h"
#include "regs/am_reg_itm.h"
#include "regs/am_reg.h"
#include "regs/am_reg_m4.h"
#include "regs/am_reg_jedec.h"
#include "regs/am_reg_mcuctrl.h"
#include "regs/am_reg_mspi.h"
#include "regs/am_reg_nvic.h"
#include "regs/am_reg_pdm.h"
#include "regs/am_reg_pwrctrl.h"
#include "regs/am_reg_rstgen.h"
#include "regs/am_reg_rtc.h"
#include "regs/am_reg_security.h"
#include "regs/am_reg_sysctrl.h"
#include "regs/am_reg_systick.h"
#include "regs/am_reg_tpiu.h"
#include "regs/am_reg_uart.h"
#include "regs/am_reg_vcomp.h"
#include "regs/am_reg_wdt.h"

//*****************************************************************************
//
Expand Down Expand Up @@ -164,6 +142,7 @@
#include "hal/am_hal_queue.h"
#include "hal/am_hal_reset.h"
#include "hal/am_hal_rtc.h"
#include "hal/am_hal_scard.h"
#include "hal/am_hal_secure_ota.h"
#include "hal/am_hal_stimer.h"
#include "hal/am_hal_security.h"
Expand Down
48 changes: 48 additions & 0 deletions cores/arduino/am_sdk_ap3/mcu/apollo3/hal/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#******************************************************************************
#
# Makefile - Rules for compiling
#
# Copyright (c) 2019, Ambiq Micro
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# Third party software included in this distribution is subject to the
# additional license terms as defined in the /docs/licenses directory.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
#
#******************************************************************************

# All makefiles use this to find the top level directory.
SWROOT?=../../..

# Include rules for building the HAL.
include $(SWROOT)/makedefs/am_hal.mk

# Generate pin definitions for apollo3.
CHIP_GENERATION = 3
2 changes: 1 addition & 1 deletion cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 2.1.0 of the AmbiqSuite Development Package.
// This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
//
//*****************************************************************************

Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 2.1.0 of the AmbiqSuite Development Package.
// This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
//
//*****************************************************************************
#ifndef AM_HAL_ADC_H
Expand Down
63 changes: 21 additions & 42 deletions cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 2.1.0 of the AmbiqSuite Development Package.
// This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
//
//*****************************************************************************

Expand All @@ -70,7 +70,7 @@ am_hal_ble_state_t g_sBLEState[AM_REG_BLEIF_NUM_MODULES];
#define BLEIF_INTSTAT_BLECSSTATN_Msk BLEIF_INTSTAT_B2MSHUTDN_Msk
#define BLEIF_INTSTAT_BLECIRQN_Msk BLEIF_INTSTAT_B2MACTIVE_Msk

#define SKIP_FALLING_EDGES 1
#define SKIP_FALLING_EDGES 0

//*****************************************************************************
//
Expand Down Expand Up @@ -697,55 +697,34 @@ am_hal_ble_boot(void *pHandle)
{
// The B0 silicon patching method is slightly different from A1. B0 silicon
// does not require the Copy Patch method introduced for A1 silicon.
if (APOLLO3_B0)
{
//apply the BLE trim value
ui32Status = am_hal_ble_default_trim_set_ramcode(pHandle);
if (ui32Status != AM_HAL_STATUS_SUCCESS)
{
return ui32Status;
}

// Apply the NVDS patch.
ui32Status = am_hal_ble_default_patch_apply(pHandle);
if (ui32Status != AM_HAL_STATUS_SUCCESS)
{
return ui32Status;
}

// Complete the patching step
ui32Status = am_hal_ble_patch_complete(pHandle);
if (ui32Status != AM_HAL_STATUS_SUCCESS)
{
return ui32Status;
}

}
else if (APOLLO3_A0 || APOLLO3_A1)
if (APOLLO3_A0 || APOLLO3_A1)
{
ui32Status = am_hal_ble_default_copy_patch_apply(pHandle);
if (ui32Status != AM_HAL_STATUS_SUCCESS)
{
return ui32Status;
}
}

ui32Status = am_hal_ble_default_trim_set_ramcode(pHandle);
if (ui32Status != AM_HAL_STATUS_SUCCESS)
{
return ui32Status;
}
//apply the BLE trim value
ui32Status = am_hal_ble_default_trim_set_ramcode(pHandle);
if (ui32Status != AM_HAL_STATUS_SUCCESS)
{
return ui32Status;
}

ui32Status = am_hal_ble_default_patch_apply(pHandle);
if (ui32Status != AM_HAL_STATUS_SUCCESS)
{
return ui32Status;
}
// Apply the NVDS patch.
ui32Status = am_hal_ble_default_patch_apply(pHandle);
if (ui32Status != AM_HAL_STATUS_SUCCESS)
{
return ui32Status;
}

ui32Status = am_hal_ble_patch_complete(pHandle);
if (ui32Status != AM_HAL_STATUS_SUCCESS)
{
return ui32Status;
}
// Complete the patching step
ui32Status = am_hal_ble_patch_complete(pHandle);
if (ui32Status != AM_HAL_STATUS_SUCCESS)
{
return ui32Status;
}
}

Expand Down
11 changes: 1 addition & 10 deletions cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_ble.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 2.1.0 of the AmbiqSuite Development Package.
// This is part of revision v2.2.0-7-g63f7c2ba1 of the AmbiqSuite Development Package.
//
//*****************************************************************************

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

uint32_t am_hal_ble_default_trim_set_ramcode(void *pHandle);

//*****************************************************************************
//
// Set the 32M crystal frequency
// based on the tested values at customer side.
// set trim value smaller in case of negative frequency offset
//
//*****************************************************************************
extern uint32_t am_hal_ble_crystal_trim_set(void *pHandle, uint32_t ui32TrimValue);

//*****************************************************************************
//
//! @brief Change the TX power setting.
Expand Down
Loading