Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
output
.vscode
6 changes: 6 additions & 0 deletions boards.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ set(TI_BOARD_VALUES
"LP_CC2652R7"
"LP_CC2652RB"
"LP_CC2652RSIP"
"CC2674R10"
)

set_property(CACHE TI_SIMPLELINK_BOARD PROPERTY STRINGS ${TI_BOARD_VALUES})
Expand Down Expand Up @@ -106,6 +107,11 @@ elseif(TI_SIMPLELINK_BOARD STREQUAL "LP_EM_CC1354P10_6")
set(TI_SIMPLELINK_DEVICE "cc13x4_cc26x4" )
set(TI_SIMPLELINK_FAMILY "cc13x4_cc26x4" )
set(TI_SIMPLELINK_ISA "m33f" )

elseif(TI_SIMPLELINK_BOARD STREQUAL "CC2674R10")
set(TI_SIMPLELINK_DEVICE "cc13x4_cc26x4" )
set(TI_SIMPLELINK_FAMILY "cc13x4_cc26x4" )
set(TI_SIMPLELINK_ISA "m33f" )

else()
if(TI_PLATFORM STREQUAL "cc13xx_cc26xx"
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ if(OT_APP_CLI)
add_subdirectory(cli)
endif()

add_subdirectory(ncp)
#add_subdirectory(ncp)
50 changes: 47 additions & 3 deletions examples/apps/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,57 @@
set(COMMON_INCLUDES
${OT_PUBLIC_INCLUDES}
${TI_PUBLIC_INCLUDES}
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/openthread/examples/platforms
${PROJECT_SOURCE_DIR}/openthread/src/core
${PROJECT_SOURCE_DIR}/examples/apps/cli

${PROJECT_SOURCE_DIR}/examples/../src/
${TI_SIMPLELINK_SDK_DIR}/source/ti/dmm/apps/dmm_thread_ts_remote_display/source/
${TI_SIMPLELINK_SDK_DIR}/source/ti/dmm/apps/common/freertos/
# JJM include paths for ICall module
${TI_SIMPLELINK_SDK_DIR}/source/ti
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/inc/
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/icall/inc
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/icall/src/inc
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/icall/src
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/hal/src/inc
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/hal/src/target/_common
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/common/cc26xx/
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack/common/cc26xx/freertos
${TI_SIMPLELINK_SDK_DIR}/source/ti/common/nv
${TI_SIMPLELINK_SDK_DIR}/source/ti/common/cc26xx

${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/rom

${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/osal/src/inc
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/controller/cc26xx/inc
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/profiles/dev_info
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/profiles/simple_profile
${TI_SIMPLELINK_SDK_DIR}/source/ti/display
)

set(COMMON_SOURCES
cli_uart.cpp
main.c
bleAppTask.c
#bleStackMenu.c
bget.c
TI_heap_wrapper.c
ble_user_config.c
#icall_FreeRTOS.c
${TI_SIMPLELINK_SDK_DIR}/source/ti/dmm/apps/common/ble_remote_display/stack/osal_icall_ble.c
${TI_SIMPLELINK_SDK_DIR}/source/ti/dmm/dmm_priority_ble_thread.c

#${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/common/cc26xx/util.c
${TI_SIMPLELINK_SDK_DIR}/source/ti/dmm/apps/common/freertos/util.c
${TI_SIMPLELINK_SDK_DIR}/source/ti/dmm/apps/common/freertos/icall_FreeRTOS.c
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/rom/agama_r1/rom_init.c
#${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/common/cc26xx/menu/two_btn_menu.c
#${TI_SIMPLELINK_SDK_DIR}/source/ti/display/Display.c
${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack_flash/common/cc26xx/board_key.c
${TI_SIMPLELINK_SDK_DIR}/kernel/nortos/dpl/SystemP_nortos.c
#${TI_SIMPLELINK_SDK_DIR}/source/ti/ble5stack/common/cc26xx/freertos/bget.c
)

if(TI_SIMPLELINK_KERNEL STREQUAL "freertos")
Expand All @@ -56,6 +100,6 @@ if(OT_MTD)
include(mtd.cmake)
endif()

if(OT_RCP)
include(radio.cmake)
endif()
#if(OT_RCP)
# include(radio.cmake)
#endif()
6 changes: 6 additions & 0 deletions examples/apps/cli/Logger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include <openthread/platform/logging.h>

#if OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_APP
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...);
#endif
63 changes: 63 additions & 0 deletions examples/apps/cli/TI_heap_wrapper.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include "bget.h"
#include <ti/drivers/dpl/HwiP.h>
#include <ti/drivers/dpl/SwiP.h>

typedef unsigned int dpl_CSState;

typedef union _dpl_cs_state_union_t
{
/** critical section variable as declared in the interface */
dpl_CSState state;
/** @internal field used to access internal data */
struct _dpl_cs_state_aggr_t
{
/** field to store Swi_disable() return value */
uint_least16_t swikey;
/** field to store Hwi_disable() return value */
uint_least16_t hwikey;
} each;
} dpl_CSStateUnion;

/* This is enter critical section for DPL supported devices */
dpl_CSState dpl_enterCSImpl(void)
{

dpl_CSStateUnion cu;
cu.each.swikey = (uint_least16_t) SwiP_disable();
cu.each.hwikey = (uint_least16_t) HwiP_disable();
return cu.state;
}

/* This is exit critical section for DPL supported devices */
void dpl_leaveCSImpl(dpl_CSState key)
{
dpl_CSStateUnion *cu = (dpl_CSStateUnion *) &key;
HwiP_restore((uint32_t) cu->each.hwikey);
SwiP_restore((uint32_t) cu->each.swikey);
}

/* Protected allocation */
void *pvPortMalloc( size_t xWantedSize )
{
void* retVal = NULL;

dpl_CSState state;
state = dpl_enterCSImpl();

retVal = bget(xWantedSize);

dpl_leaveCSImpl(state);
return retVal;

}

/* Protected Deallocation */
void vPortFree( void *pv )
{
dpl_CSState state;
state = dpl_enterCSImpl();

brel(pv);

dpl_leaveCSImpl(state);
}
9 changes: 9 additions & 0 deletions examples/apps/cli/TI_heap_wrapper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* Protected allocation
malloc/ICall_heapMalloc --> ti_heap_wrapper --> bget protected by critical section
*/
void *pvPortMalloc( size_t xWantedSize );

/* Protected Deallocation
Free/ICall_heapFree --> ti_heap_wrapper --> brel protected by critical section
*/
void vPortFree( void *pv );
Loading