Commit 0b995d6d authored by schneider's avatar schneider
Browse files

change(max32666): Update SDK to 0.2.1-12

parent 5d9cb5ec
......@@ -188,6 +188,26 @@ $(error SDMA currently requires BTLE_APP_USE_LEGACY_API)
endif
endif
ifdef ENABLE_SDMA_UNIFIED_CONFIG
ifneq "$(ENABLE_SDMA_UNIFIED_CONFIG)" ""
ifeq "$(ENABLE_SDMA_UNIFIED_CONFIG)" "0"
ENABLE_SDMA_UNIFIED_CONFIG=
else
ifeq "$(ENABLE_SDMA_UNIFIED_CONFIG)" "FALSE"
ENABLE_SDMA_UNIFIED_CONFIG=
else
ENABLE_SDMA_UNIFIED_CONFIG=1
endif
endif
endif
endif
ifdef ENABLE_SDMA_UNIFIED_CONFIG
ifneq "$(ENABLE_SDMA_UNIFIED_CONFIG)" "0"
PROJ_CFLAGS+=-DENABLE_SDMA_UNIFIED_CONFIG=1
endif
endif
#-------------------------------------------------------------------------------
# Configuration specified here.
......@@ -239,10 +259,6 @@ include ${PERIPH_DRIVER_DIR}/periphdriver.mk
CORDIO_DIR=$(LIBS_DIR)/BTLE
include ${CORDIO_DIR}/btle.mk
# Include MAXUSB library
MAXUSB_DIR=$(LIBS_DIR)/MAXUSB
include $(MAXUSB_DIR)/maxusb.mk
################################################################################
# Include the rules for building for this target. All other makefiles should be
# included before this one.
......
## Application description
The BLE\_beacon application demonstrates a BLE beacon device that can not accept connections.
......@@ -11,9 +11,14 @@ BTLE_APP_ENABLE_PERIODIC?=0
# Unspecified -> Use default (connectable).
# DM_ADV_SCAN_UNDIRECT -> Non-connectable scannable
# DM_ADV_NONCONN_UNDIRECT -> Non-connectable non-scannable
BTLE_APP_ADV_TYPE?=
#BTLE_APP_ADV_TYPE?=
#BTLE_APP_ADV_TYPE?=DM_ADV_NONCONN_UNDIRECT
#BTLE_APP_ADV_TYPE?=DM_ADV_SCAN_UNDIRECT
BTLE_APP_ADV_TYPE?=DM_ADV_SCAN_UNDIRECT
# Run link layer using SDMA.
ENABLE_SDMA?=0
# Copy sdma config from application.
ENABLE_SDMA_UNIFIED_CONFIG?=1
......@@ -29,13 +29,14 @@
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*
* $Date: 2019-08-22 20:18:08 -0500 (Thu, 22 Aug 2019) $
* $Revision: 45615 $
* $Date: 2020-09-01 12:32:30 -0500 (Tue, 01 Sep 2020) $
* $Revision: 55172 $
*
******************************************************************************/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mxc_config.h"
#include "mxc_sys.h"
#include "wsf_types.h"
......@@ -48,6 +49,8 @@
#include "app_ui.h"
#include "hci_vs.h"
#include "hci_core.h"
#include "hci_drv_sdma.h"
#include "ipc_defs.h"
#include "dm_api.h"
/**************************************************************************************************
......@@ -199,6 +202,9 @@ void SetAddress(uint8_t event)
/*************************************************************************************************/
int main(void)
{
#ifdef ENABLE_SDMA
uint8_t sdmaFlag;
#endif /* ENABLE_SDMA */
#ifndef __IAR_SYSTEMS_ICC__
setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE);
......@@ -216,9 +222,22 @@ int main(void)
printf("Setup Complete\n");
#ifdef ENABLE_SDMA
sdmaFlag = SDMA_FLAG_INIT;
#endif /* ENABLE_SDMA */
while (1)
{
wsfOsDispatcher();
#ifdef ENABLE_SDMA
if (sdmaFlag == SDMA_FLAG_INIT) {
sdmaFlag = SDMAGetSDMAFlag();
}
if (sdmaFlag == SDMA_FLAG_ENOMEM) {
printf ("SDMA core ran out of allocatable memory.");
while(1);
}
#endif /* ENABLE_SDMA */
}
}
......
......@@ -37,6 +37,7 @@
#include "svc_core.h"
#include "sec_api.h"
#include "ll_init_api.h"
#include "hci_drv_sdma.h"
#define LL_IMPL_REV 0x2303
......@@ -51,9 +52,13 @@ const LlRtCfg_t _ll_cfg = {
/*btVer*/ LL_VER_BT_CORE_SPEC_5_0,
/*_align32 */ 0, // padding for alignment
/* Advertiser */
#ifdef ENABLE_SDMA
/*maxAdvSets*/ 2, // 1 Extended Advertising Set
/*maxAdvReports*/ 2,
#else /* ENABLE_SDMA */
/*maxAdvSets*/ 4, // 4 Extended Advertising Sets
/*maxAdvReports*/ 8,
#endif /* ENABLE_SDMA */
/*maxExtAdvDataLen*/ LL_MAX_ADV_DATA_LEN,
/*defExtAdvDataFrag*/ 64,
/*auxDelayUsec*/ 0,
......@@ -63,10 +68,17 @@ const LlRtCfg_t _ll_cfg = {
/*maxExtScanDataLen*/ LL_MAX_ADV_DATA_LEN,
/* Connection */
#ifdef ENABLE_SDMA
/*maxConn*/ 4,
/*numTxBufs*/ 4,
/*numRxBufs*/ 4,
/*maxAclLen*/ 150,
#else /* ENABLE_SDMA */
/*maxConn*/ 2,
/*numTxBufs*/ 16,
/*numRxBufs*/ 16,
/*maxAclLen*/ 512,
#endif /* ENABLE_SDMA */
/*defTxPwrLvl*/ 0,
/*ceJitterUsec*/ 0,
......@@ -75,7 +87,11 @@ const LlRtCfg_t _ll_cfg = {
/* PHY */
/*phy2mSup*/ TRUE,
#ifdef ENABLE_SDMA
/*phyCodedSup*/ FALSE,
#else /* ENABLE_SDMA */
/*phyCodedSup*/ TRUE,
#endif /* ENABLE_SDMA */
/*stableModIdxTxSup*/ FALSE,
/*stableModIdxRxSup*/ FALSE
};
......@@ -120,7 +136,13 @@ void StackInitBeacon(void)
printf("mem_used: 0x%x LL_MEMORY_FOOTPRINT: 0x%x\n", memUsed,
LL_MEMORY_FOOTPRINT);
}
#endif
#endif /* ENABLE_SDMA */
#ifdef ENABLE_SDMA
/* Copy link layer configuration to sdma memory space. */
SDMASetBBCfg(&_bb_cfg);
SDMASetLLCfg(&_ll_cfg);
#endif /* ENABLE_SDMA */
handlerId = WsfOsSetNextHandler(HciHandler);
HciHandlerInit(handlerId);
......
......@@ -234,6 +234,26 @@ endif
endif
endif
ifdef ENABLE_SDMA_UNIFIED_CONFIG
ifneq "$(ENABLE_SDMA_UNIFIED_CONFIG)" ""
ifeq "$(ENABLE_SDMA_UNIFIED_CONFIG)" "0"
ENABLE_SDMA_UNIFIED_CONFIG=
else
ifeq "$(ENABLE_SDMA_UNIFIED_CONFIG)" "FALSE"
ENABLE_SDMA_UNIFIED_CONFIG=
else
ENABLE_SDMA_UNIFIED_CONFIG=1
endif
endif
endif
endif
ifdef ENABLE_SDMA_UNIFIED_CONFIG
ifneq "$(ENABLE_SDMA_UNIFIED_CONFIG)" "0"
PROJ_CFLAGS+=-DENABLE_SDMA_UNIFIED_CONFIG=1
endif
endif
#-------------------------------------------------------------------------------
# Configuration specified here.
......@@ -285,10 +305,6 @@ include ${PERIPH_DRIVER_DIR}/periphdriver.mk
CORDIO_DIR=$(LIBS_DIR)/BTLE
include ${CORDIO_DIR}/btle.mk
# Include MAXUSB library
MAXUSB_DIR=$(LIBS_DIR)/MAXUSB
include $(MAXUSB_DIR)/maxusb.mk
################################################################################
# Include the rules for building for this target. All other makefiles should be
# included before this one.
......
## Application description
The BLE\_datc application demonstrates a BLE central device that can connect to another device running the BLE\_dats application.
......@@ -16,5 +16,8 @@ BTLE_APP_ENABLE_WHITELIST?=0
# Run link layer using SDMA.
ENABLE_SDMA?=0
# Copy sdma config from application.
ENABLE_SDMA_UNIFIED_CONFIG?=1
# Enable file transfer profile
ENABLE_WDX?=0
......@@ -29,13 +29,14 @@
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*
* $Date: 2019-07-26 10:25:33 -0500 (Fri, 26 Jul 2019) $
* $Revision: 44989 $
* $Date: 2020-09-01 12:32:30 -0500 (Tue, 01 Sep 2020) $
* $Revision: 55172 $
*
******************************************************************************/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mxc_config.h"
#include "wsf_types.h"
#include "wsf_os.h"
......@@ -48,9 +49,11 @@
#include "radio_drv.h"
#include "hci_core.h"
#include "hci_vs.h"
#include "hci_drv_sdma.h"
#include "pb.h"
#include "tmr.h"
#include "pal_sys.h"
#include "ipc_defs.h"
/**************************************************************************************************
Macros
......@@ -234,6 +237,9 @@ void SetAddress(uint8_t event)
/*************************************************************************************************/
int main(void)
{
#ifdef ENABLE_SDMA
uint8_t sdmaFlag;
#endif /* ENABLE_SDMA */
#ifndef __IAR_SYSTEMS_ICC__
setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE);
......@@ -265,9 +271,22 @@ int main(void)
printf("Setup Complete\n");
#ifdef ENABLE_SDMA
sdmaFlag = SDMA_FLAG_INIT;
#endif /* ENABLE_SDMA */
while (1)
{
wsfOsDispatcher();
#ifdef ENABLE_SDMA
if (sdmaFlag == SDMA_FLAG_INIT) {
sdmaFlag = SDMAGetSDMAFlag();
}
if (sdmaFlag == SDMA_FLAG_ENOMEM) {
printf ("SDMA core ran out of allocatable memory.");
while(1);
}
#endif /* ENABLE_SDMA */
}
}
......
......@@ -36,8 +36,9 @@
#include "svc_dis.h"
#include "svc_core.h"
#include "sec_api.h"
#include "ll_init_api.h"
#include "gcr_regs.h"
#include "ll_init_api.h"
#include "hci_drv_sdma.h"
#define LL_IMPL_REV 0x2303
......@@ -52,9 +53,13 @@ LlRtCfg_t _ll_cfg = {
/*btVer*/ LL_VER_BT_CORE_SPEC_5_0,
/*_align32 */ 0, // padding for alignment
/* Advertiser */
#ifdef ENABLE_SDMA
/*maxAdvSets*/ 1, // 1 Extended Advertising Set
/*maxAdvReports*/ 1,
#else /* ENABLE_SDMA */
/*maxAdvSets*/ 4, // 4 Extended Advertising Sets
/*maxAdvReports*/ 8,
#endif /* ENABLE_SDMA */
/*maxExtAdvDataLen*/ LL_MAX_ADV_DATA_LEN,
/*defExtAdvDataFrag*/ 64,
/*auxDelayUsec*/ 0,
......@@ -64,10 +69,17 @@ LlRtCfg_t _ll_cfg = {
/*maxExtScanDataLen*/ LL_MAX_ADV_DATA_LEN,
/* Connection */
#ifdef ENABLE_SDMA
/*maxConn*/ 2,
/*numTxBufs*/ 8,
/*numRxBufs*/ 8,
/*maxAclLen*/ 150,
#else /* ENABLE_SDMA */
/*maxConn*/ 2,
/*numTxBufs*/ 16,
/*numRxBufs*/ 16,
/*maxAclLen*/ 512,
#endif /* ENABLE_SDMA */
/*defTxPwrLvl*/ 0,
/*ceJitterUsec*/ 0,
......@@ -124,10 +136,16 @@ void StackInitDatc(void)
// memUsed = LlInitControllerInit(&ll_init_cfg);
if(memUsed != LL_MEMORY_FOOTPRINT)
{
printf("mem_used: 0x%x LL_MEMORY_FOOTPRINT: 0x%x\n", memUsed,
LL_MEMORY_FOOTPRINT);
printf("mem_used: 0x%x LL_MEMORY_FOOTPRINT: 0x%x\n", memUsed,
LL_MEMORY_FOOTPRINT);
}
#endif
#endif /* ENABLE_SDMA */
#ifdef ENABLE_SDMA
/* Copy link layer configuration to sdma memory space. */
SDMASetBBCfg(&_bb_cfg);
SDMASetLLCfg(&_ll_cfg);
#endif /* ENABLE_SDMA */
SecInit();
SecRandInit();
......
......@@ -164,6 +164,26 @@ endif
endif
endif
ifdef ENABLE_SDMA_UNIFIED_CONFIG
ifneq "$(ENABLE_SDMA_UNIFIED_CONFIG)" ""
ifeq "$(ENABLE_SDMA_UNIFIED_CONFIG)" "0"
ENABLE_SDMA_UNIFIED_CONFIG=
else
ifeq "$(ENABLE_SDMA_UNIFIED_CONFIG)" "FALSE"
ENABLE_SDMA_UNIFIED_CONFIG=
else
ENABLE_SDMA_UNIFIED_CONFIG=1
endif
endif
endif
endif
ifdef ENABLE_SDMA_UNIFIED_CONFIG
ifneq "$(ENABLE_SDMA_UNIFIED_CONFIG)" "0"
PROJ_CFLAGS+=-DENABLE_SDMA_UNIFIED_CONFIG=1
endif
endif
ifneq "$(ENABLE_SDMA)" ""
ifdef BTLE_APP_USE_LEGACY_API
ifneq "$(BTLE_APP_USE_LEGACY_API)" ""
......@@ -228,10 +248,6 @@ include ${PERIPH_DRIVER_DIR}/periphdriver.mk
CORDIO_DIR=$(LIBS_DIR)/BTLE
include ${CORDIO_DIR}/btle.mk
# Include MAXUSB library
MAXUSB_DIR=$(LIBS_DIR)/MAXUSB
include $(MAXUSB_DIR)/maxusb.mk
################################################################################
# Include the rules for building for this target. All other makefiles should be
# included before this one.
......
## Application description
The BLE\_dats application demonstrates a BLE peripheral device that can communicate with the BLE\_datc application. These two applications ping each other with a "Hello World" string to demonstrate that they are able to communicate.
......@@ -7,6 +7,9 @@ BTLE_APP_USE_LEGACY_API?=1
# Run link layer using SDMA.
ENABLE_SDMA?=0
# Copy sdma config from application.
ENABLE_SDMA_UNIFIED_CONFIG?=1
# Firmware version string
# 1.0 in ASCII
FW_VERSION?=0x312E31
......
......@@ -29,13 +29,14 @@
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*
* $Date: 2019-07-11 13:33:24 -0500 (Thu, 11 Jul 2019) $
* $Revision: 44549 $
* $Date: 2020-09-01 12:32:30 -0500 (Tue, 01 Sep 2020) $
* $Revision: 55172 $
*
******************************************************************************/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mxc_config.h"
#include "wsf_types.h"
#include "wsf_os.h"
......@@ -47,8 +48,10 @@
#include "app_ui.h"
#include "hci_vs.h"
#include "hci_core.h"
#include "hci_drv_sdma.h"
#include "bb_drv.h"
#include "board.h"
#include "ipc_defs.h"
/**************************************************************************************************
Macros
......@@ -173,6 +176,9 @@ void SetAddress(uint8_t event)
/*************************************************************************************************/
int main(void)
{
#ifdef ENABLE_SDMA
uint8_t sdmaFlag;
#endif /* ENABLE_SDMA */
#ifndef __IAR_SYSTEMS_ICC__
setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE);
......@@ -190,10 +196,23 @@ int main(void)
printf("Setup Complete\n");
#ifdef ENABLE_SDMA
sdmaFlag = SDMA_FLAG_INIT;
#endif /* ENABLE_SDMA */
while (1)
{
wsfOsDispatcher();
#ifdef ENABLE_SDMA
if (sdmaFlag == SDMA_FLAG_INIT) {
sdmaFlag = SDMAGetSDMAFlag();
}
if (sdmaFlag == SDMA_FLAG_ENOMEM) {
printf ("SDMA core ran out of allocatable memory.");
while(1);
}
#endif /* ENABLE_SDMA */
if(resetFlag && wsfOsReadyToSleep() && (Console_PrepForSleep() == E_NO_ERROR)) {
/* Prevent interrupts from pre-empting this operation */
__disable_irq();
......
......@@ -37,8 +37,9 @@
#include "svc_dis.h"
#include "svc_core.h"
#include "sec_api.h"
#include "ll_init_api.h"
#include "gcr_regs.h"
#include "ll_init_api.h"
#include "hci_drv_sdma.h"
#define LL_IMPL_REV 0x2303
......@@ -54,8 +55,13 @@ LlRtCfg_t _ll_cfg = {
/*_align32 */ 0, // padding for alignment
/* Advertiser */
#ifdef ENABLE_SDMA
/*maxAdvSets*/ 1, // 1 Extended Advertising Set
/*maxAdvReports*/ 1,
#else /* ENABLE_SDMA */
/*maxAdvSets*/ 4, // 4 Extended Advertising Sets
/*maxAdvReports*/ 8,
#endif /* ENABLE_SDMA */
/*maxExtAdvDataLen*/ LL_MAX_ADV_DATA_LEN,
/*defExtAdvDataFrag*/ 64,
/*auxDelayUsec*/ 0,
......@@ -65,10 +71,17 @@ LlRtCfg_t _ll_cfg = {
/*maxExtScanDataLen*/ LL_MAX_ADV_DATA_LEN,
/* Connection */
#ifdef ENABLE_SDMA
/*maxConn*/ 2,
/*numTxBufs*/ 8,
/*numRxBufs*/ 8,
/*maxAclLen*/ 150,
#else /* ENABLE_SDMA */
/*maxConn*/ 2,
/*numTxBufs*/ 16,
/*numRxBufs*/ 16,
/*maxAclLen*/ 512,
#endif /* ENABLE_SDMA */
/*defTxPwrLvl*/ 0,
/*ceJitterUsec*/ 0,
......@@ -124,10 +137,16 @@ void StackInitDats(void)
memUsed = LlInitControllerExtInit(&ll_init_cfg);
if(memUsed != LL_MEMORY_FOOTPRINT)
{
printf("mem_used: 0x%x LL_MEMORY_FOOTPRINT: 0x%x\n", memUsed,
LL_MEMORY_FOOTPRINT);
printf("mem_used: 0x%x LL_MEMORY_FOOTPRINT: 0x%x\n", memUsed,
LL_MEMORY_FOOTPRINT);
}
#endif
#endif /* ENABLE_SDMA */
#ifdef ENABLE_SDMA
/* Copy link layer configuration to sdma memory space. */
SDMASetBBCfg(&_bb_cfg);
SDMASetLLCfg(&_ll_cfg);
#endif /* ENABLE_SDMA */
handlerId = WsfOsSetNextHandler(HciHandler);
HciHandlerInit(handlerId);
......
################################################################################
# Copyright (C) 2014 Maxim Integrated Products, Inc., All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
# OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of Maxim Integrated
# Products, Inc. shall not be used except as stated in the Maxim Integrated
# Products, Inc. Branding Policy.
#
# The mere transfer of this software does not imply any licenses
# of trade secrets, proprietary technology, copyrights, patents,
# trademarks, maskwork rights, or any other form of intellectual
# property whatsoever. Maxim Integrated Products, Inc. retains all
# ownership rights.
#
# $Id: Makefile 44505 2019-07-09 20:32:03Z nathan.goldstick $
#
################################################################################
# This is the name of the build output file
ifeq "$(PROJECT)" ""
PROJECT=max32665
endif
# Specify the target processor
ifeq "$(TARGET)" ""
TARGET=MAX32665
endif
# Select 'GCC' or 'IAR' compiler
COMPILER=GCC
# Specify the board used
ifeq "$(BOARD)" ""
BOARD=EvKit_V1
endif
# Create Target name variables
TARGET_UC:=$(shell echo $(TARGET) | tr a-z A-Z)
TARGET_LC:=$(shell echo $(TARGET) | tr A-Z a-z)
# Unset PROJ_CFLAGS so remote building of this application does not carry over
# already defined flags
PROJ_CFLAGS=
## Subsitute WSF critical section entry for default MAXUSB
#PROJ_CFLAGS+=-DMAXUSB_ENTER_CRITICAL=WsfCsEnter
#PROJ_CFLAGS+=-DMAXUSB_EXIT_CRITICAL=WsfCsExit
# This is the path to the CMSIS root directory
ifeq "$(MAXIM_PATH)" ""
LIBS_DIR=../../../Libraries
NDALIBS_DIR=../../../NDALibraries
else