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
6 changes: 5 additions & 1 deletion Makefile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
# linux - POSIX Linux
# freertos - FreeRTOS
# efr32_wisun - EFR32 with Wi-SUN stack and FreeRTOS
# ti_simplelink_wisun - TI CC13xx Wi-SUN FAN + FreeRTOS
# clean - clean binaries
#
.PHONY : linux freertos efr32_wisun clean
.PHONY : linux freertos efr32_wisun ti_simplelink_wisun clean

linux:
make -f linux.target
Expand All @@ -21,6 +22,9 @@ freertos:
efr32_wisun:
make -f efr32_wisun.target

ti_simplelink_wisun:
make clean && make CONFIG=SECUREBOOT -f ti_simplelink_wisun.target

clean:
-rm -rf build/
-rm -f *.o
Expand Down
208 changes: 208 additions & 0 deletions Vendors/TI/LP_CC1312R7/csmp_example_tirf/freertos/csmp_example.syscfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * 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.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 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 OWNER 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.
*/
// @cliArgs --board /ti/boards/LP_CC1312R7 --rtos freertos

/*
* csmp_example_tirf.syscfg
*/

/* ======== RF ======== */
var RF = scripting.addModule("/ti/drivers/RF");

/* If an antenna component exists, assign it to the RF instance */
if (system.deviceData.board && system.deviceData.board.components.RF) {
RF.$hardware = system.deviceData.board.components.RF;
}

/* ======== TRNG ======== */
var TRNG = scripting.addModule("/ti/drivers/TRNG", {}, false);
var trng = TRNG.addInstance();
trng.$name = "NANOSTACK_TRNG";


/* ======== Watchdog ======== */
var Watchdog = scripting.addModule("/ti/drivers/Watchdog", {}, false);
var Watchdog1 = Watchdog.addInstance();

/* ======== UART ======== */
var UART = scripting.addModule("/ti/drivers/UART2", {}, false);
var UART2 = UART.addInstance();
UART2.$hardware = system.deviceData.board.components.XDS110UART;
/* set UART Ringbuffer size to 128 bytes */
UART2.rxRingBufferSize = 128;
UART2.txRingBufferSize = 128;

/* ======== TRNG ======== */
var TRNG = scripting.addModule("/ti/drivers/TRNG", {}, false);
var TRNG1 = TRNG.addInstance();

/* ======== NVS ======== */
const deviceName = system.getScript("/ti/ti_wisunfan/ti_wisunfan_common.js").getLaunchPadFromDevice();
var NVS = scripting.addModule("/ti/drivers/NVS"); // Add a NVS module
var NVS_INT = NVS.addInstance(); // Add an internal NVS module instance

NVS_INT.$name = "CONFIG_NVSINTERNAL"; // Internal NVS
if (deviceName.includes("R7") || deviceName.includes("P7"))
{
NVS_INT.internalFlash.regionBase = 0xA8000;
}
else if (deviceName.includes("R10") || deviceName.includes("P10"))
{
NVS_INT.internalFlash.regionBase = 0xFC000;
}
else
{
NVS_INT.internalFlash.regionBase = 0x52000;
}
NVS_INT.internalFlash.regionSize = 0x4000;

/* ======== NVS External Flash (Off-Chip OAD secondary slot) ======== */
var NVS_EXT = NVS.addInstance();
NVS_EXT.$name = "CONFIG_NVSEXTERNAL";
NVS_EXT.nvsType = "External";
/* Bind to on-board SPI flash (MX25R8035F on LP_CC1352P7_1) — same pattern as coap_oad_offchip */
if (system.deviceData.board && system.deviceData.board.components.SPI_FLASH) {
NVS_EXT.$hardware = system.deviceData.board.components.SPI_FLASH;
var NVSSPI25XDevice1 = NVS_EXT.externalFlash.spiFlashDevice;
NVSSPI25XDevice1.$name = "CONFIG_NVS_SPI_0";
NVSSPI25XDevice1.chipSelectPinInstance.mode = "Output";
NVSSPI25XDevice1.chipSelectPinInstance.$name = "CONFIG_GPIO_SPI_FLASH_CS";
var SPI = NVSSPI25XDevice1.sharedSpiInstance;
SPI.$name = "Board_SPI_0";
NVS_EXT.externalFlash.regionBase = 0;
NVS_EXT.externalFlash.verifyBufferSize = 64;
NVS_EXT.externalFlash.regionSize = 0xA8000; // 672 KB = imgtool --slot-size 0xA8000
}

/* ======== LED Red ======== */
var LED = scripting.addModule("/ti/drivers/apps/LED"); // Add a LED module
var LED_R = LED.addInstance(); // Add a LED module instance for LED_R

/* If a red LED component exists, assign it to the LED_R instance */
if (system.deviceData.board && system.deviceData.board.components.LED_RED) {
LED_R.$hardware = system.deviceData.board.components.LED_RED;
}
else
{
LED_R.mode = "Output"; // Set the LED pin to output
}

LED_R.$name = "CONFIG_LED_RED";
LED_R.gpioPin.$name = "CONFIG_GPIO_RLED"; // Descriptive name for the LED_R GPIO
LED_R.gpioPin.mode = "Output";


/* ======== LED Green ======== */
var LED = scripting.addModule("/ti/drivers/apps/LED"); // Add a LED module
var LED_G = LED.addInstance(); // Add a LED module instance for LED_G

/* If a red LED component exists, assign it to the LED_G instance */
if (system.deviceData.board && system.deviceData.board.components.LED_GREEN) {
LED_G.$hardware = system.deviceData.board.components.LED_GREEN;
}
else
{
LED_G.mode = "Output"; // Set the LED pin to output
}

LED_G.$name = "CONFIG_LED_GREEN";
LED_G.gpioPin.$name = "CONFIG_GPIO_GLED"; // Descriptive name for the LED_G GPIO
LED_G.gpioPin.mode = "Output";

/* ======== Left Button ======== */
var BUTTON = scripting.addModule("/ti/drivers/apps/Button"); // Add a BUTTON module
var BUTTON_L = BUTTON.addInstance(); // Add a BUTTON module instance for BUTTON_L

/* If a BUTTON0 component exists, assign it to the BUTTON_L instance */
if (system.deviceData.board && system.deviceData.board.components["BTN-1"]) {
BUTTON_L.$hardware = system.deviceData.board.components["BTN-1"];
}

BUTTON_L.$name = "CONFIG_BTN_LEFT";
BUTTON_L.gpioPin.$name = "CONFIG_GPIO_BTN1"; // Descriptive name for the BUTTON_L GPIO
BUTTON_L.gpioPin.pull = "Pull Up"; // Use Pull up resistor

/* ======== Right Button ======== */
var BUTTON = scripting.addModule("/ti/drivers/apps/Button"); // Add a BUTTON module
var BUTTON_R = BUTTON.addInstance(); // Add a BUTTON module instance for BUTTON_R

/* If a BUTTON0 component exists, assign it to the BUTTON_R instance */
if (system.deviceData.board && system.deviceData.board.components["BTN-2"]) {
BUTTON_R.$hardware = system.deviceData.board.components["BTN-2"];
}

BUTTON_R.$name = "CONFIG_BTN_RIGHT";
BUTTON_R.gpioPin.$name = "CONFIG_GPIO_BTN2"; // Descriptive name for the BUTTON_R GPIO
BUTTON_R.gpioPin.pull = "Pull Up"; // Use Pull up resistor

/* ======== RF Design ======== */
var rfDesign = scripting.addModule("ti/devices/radioconfig/rfdesign");
const rfDesignSettings = system.getScript("/ti/common/lprf_rf_design_settings.js").rfDesignSettings;
for(var setting in rfDesignSettings)
{
rfDesign[setting] = rfDesignSettings[setting];
}

/* ======== TI-15.4 Stack ======== */
var TI154Stack = scripting.addModule("/ti/ti_wisunfan/ti_wisunfan");
if(rfDesignSettings.rfDesign !== undefined)
{
TI154Stack.rfDesign = rfDesignSettings.rfDesign;
}

TI154Stack.project = "routernode";
TI154Stack.lockProject = true;
TI154Stack.rxOnIdle = true;
TI154Stack.secureLevel = "macSecure";
TI154Stack.rapidJoin = false;

/* ======== Device ======== */
var device = scripting.addModule("ti/devices/CCFG");
const ccfgSettings = system.getScript("/ti/common/lprf_ccfg_settings.js").ccfgSettings;
for(var setting in ccfgSettings)
{
device[setting] = ccfgSettings[setting];
}
/* Note: CCFG is retained in the application build. When preparing the MCUBoot-
* compatible OTA image, use: tiarmobjcopy --remove-section=.ccfg to exclude it.
* MCUBoot owns the CCFG (at 0xAC000) — but we strip it at image-prep time, not here. */

/* genLibs omitted — SysConfig generates prebuilt library entries in ti_utils_build_linker.cmd.genlibs */

/* ======== RTOS ======== */
const FreeRTOS = scripting.addModule("/freertos/FreeRTOS");
FreeRTOS.heapSize = 0xC000;
FreeRTOS.posixThreadStackSize = 0x00000200;
FreeRTOS.idleStackSize = 0x00000180;
FreeRTOS.timerStackSize = 0x00001000;

const POSIX = scripting.addModule("/ti/posix/freertos/Settings");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Config-specific post-build commands
.PHONY: postbuild
postbuild: $(NAME).hex
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LFLAGS += -Wl,--define=SBL_ENABLE


# Config-specific post-build commands
.PHONY: postbuild
postbuild: $(NAME).hex
$(TICLANG_ARMCOMPILER)/bin/tiarmobjcopy $(NAME).out --output-target binary $(NAME)-noheader.bin
$(SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR)/tools/common/mcuboot/imgtool sign --header-size 0x80 --align 4 --slot-size 0xA8000 --pad --version 1.0.0+$(shell date +%Y%m%d) --pad-header --key $(SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR)/source/third_party/mcuboot/root-ec-p256.pem $(NAME)-noheader.bin $(NAME).bin;
Loading