Update repo

This commit is contained in:
hangpersonal committed 2026-08-30 23:04:35 -07:00
1 parent 749dab5721
commit ce65a0f59a
14950 files changed
+4408250 -1

No files matched your search

@@ -0,0 +1,50 @@
<projectSpec>
<project
name="cla_ex1_asin_cpu1"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../cla_ex1_asin_cpu1.c" targetDirectory="" />
</project>
<project
name="cla_ex1_asin_cpu2"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100 --define=CLA_C" />
<configuration name="CPU2_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100 --define=CLA_C" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_CLA_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU2_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_CLA_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU2_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../cla_ex1_asin_cpu2.c" targetDirectory="" />
<file action="copy" path="../cla_ex1_asin_shared.h" targetDirectory="" />
<file action="copy" path="../cla_ex1_asin.cla" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,50 @@
<projectSpec>
<project
name="cla_ex2_iir2p2z_cpu1"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM"/>
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH"/>
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../cla_ex2_iir2p2z_cpu1.c" targetDirectory="" />
</project>
<project
name="cla_ex2_iir2p2z_cpu2"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100 --define=CLA_C" />
<configuration name="CPU2_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100 --define=CLA_C" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_CLA_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU2_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_CLA_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU2_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../cla_ex2_iir2p2z_cpu2.c" targetDirectory="" />
<file action="copy" path="../cla_ex2_iir2p2z_shared.h" targetDirectory="" />
<file action="copy" path="../cla_ex2_iir2p2z.cla" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,144 @@
//#############################################################################
//
// FILE: cla_ex1_asin.cla
//
// TITLE: Arc Sine example
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "cla_ex1_asin_shared.h"
//
// function definitions
//
//Task 1 : Calculate asin(X)
// Description:
// Step(1): Calculate absolute of the input X
//
// Step(2): Use the upper 6-bits of input "X" value as an
// index into the table to obtain the coefficients
// for a second order equation:
//
// _FPUasinTable:
// CoeffA0[0]
// CoeffA1[0]
// CoeffA2[0]
// .
// .
// CoeffA0[63]
// CoeffA1[63]
// CoeffA2[63]
//
// Step(3): Calculate the angle using the following equation:
//
// arctan(Ratio) = A0 + A1*Ratio + A2*Ratio*Ratio
// arctan(Ratio) = A0 + Ratio(A1 + A2*Ratio)
//
// Step(4): The final angle is determined as follows:
//
// if( X < 0 )
// Angle = -Angle
__attribute__((interrupt)) void Cla1Task1 ( void )
{
//Local Variables
int xTblIdx; //integer valued Table index
float A0,A1,A2; //Table coefficients
float *entry;
float result;
//Preprocessing
__mdebugstop();
xTblIdx = fVal * TABLE_SIZE_M_1; //convert table index to u16-bits
xTblIdx = xTblIdx * 3; //Table is ordered as 3 32-bit coefficients, the
//index points to these triplets, hence the *3*sizeof(float)
entry = &CLAasinTable[xTblIdx];
A0 = *entry++;
A1 = *entry++;
A2 = *entry;
result = A0 + fVal*(A1 + A2*fVal);
//Post processing
if(fVal < 0)
{
result = - result;
}
fResult = result;
}
__attribute__((interrupt)) void Cla1Task2 ( void )
{
}
__attribute__((interrupt)) void Cla1Task3 ( void )
{
}
__attribute__((interrupt)) void Cla1Task4 ( void )
{
}
__attribute__((interrupt)) void Cla1Task5 ( void )
{
}
__attribute__((interrupt)) void Cla1Task6 ( void )
{
}
__attribute__((interrupt)) void Cla1Task7 ( void )
{
}
__attribute__((interrupt)) void Cla1Task8 ( void )
{
}
//
// End of file
//
@@ -0,0 +1,193 @@
//###########################################################################
//
// FILE: cla_ex1_asin_cpu1.c
//
// TITLE: CLA Arcsine Example for F2837xD.
//
//! \addtogroup dual_example_list
//! <h1>CLA \f$arcsine(x)\f$ using a lookup table (cla_asin_cpu01)</h1>
//!
//! In this example, cpu1 will be used to initialize the clocks for cpu2.cla1.
//! Task 1 of the CLA on cpu2 will calculate the arcsine of
//! an input argument in the range (-1.0 to 1.0) using a lookup table.
//!
//! \b Memory \b Allocation \n
//! - CLA1 Math Tables (RAMLS0)
//! - CLAasinTable - Lookup table
//! - CLA1 to CPU Message RAM
//! - fResult - Result of the lookup algorithm
//! - CPU to CLA1 Message RAM
//! - fVal - Sample input to the lookup algorithm
//!
//! \b Watch \b Variables \n
//! - fVal - Argument to task 1
//! - fResult - Result of \f$arcsin(fVal)\f$
//!
//! \note CPU2 must turn on the CLA clock by writing a 1 to
//! CpuSysRegs.PCLKCR0.bit.CLA1.
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
//
// Globals
//
uint16_t pass=0;
uint16_t fail=0;
//
// Function Prototypes
//
void initCpuXCla1(void);
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
#ifdef _STANDALONE
#ifdef _FLASH
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
#else
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_RAM);
#endif // _FLASH
#endif // _STANDALONE
//
// Disable pin locks and enable internal pullups.
//
Device_initGPIO();
//
// Disable global interrupts.
//
DINT;
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Turn on the CLA clocks on both CPUs.
//
initCpuXCla1();
//
// Enable global Interrupts and higher priority real-time debug events:
//
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global real-time interrupt DBGM
while(1);
}
//
// initCpuXCla1 - Enable CLA1 on CPU1 and CPU2
//
void initCpuXCla1(void)
{
uint16_t ipcFlag = 5U;
#ifdef CPU1
EALLOW;
//
// Enable CPU1 CLA1
//
HWREG(DEVCFG_BASE + SYSCTL_O_DC1) |= SYSCTL_DC1_CPU1_CLA1;
//
// Enable CPU2 CLA1
//
HWREG(DEVCFG_BASE + SYSCTL_O_DC1) |= SYSCTL_DC1_CPU2_CLA1;
EDIS;
#endif //CPU1
//
// Send IPC flag 5 to CPU2
//
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag;
//
// Wait for IPC flag 5 from CPU2
//
while((HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag)) == 0x00000000UL)
{
}
//
// ACK IPC flag 5 for CPU2
//
HWREG(IPC_BASE + IPC_O_ACK) = 1UL << ipcFlag;
//
// Wait for ACK of IPC flag 5 from CPU2
//
while((HWREG(IPC_BASE + IPC_O_FLG) & (1UL << ipcFlag)) != 0x00000000UL)
{
}
}
//
// End of file
//
@@ -0,0 +1,597 @@
//###########################################################################
//
// FILE: cla_ex1_asin_cpu2.c
//
// TITLE: CLA Arcsine Example for F2837xD.
//
// Dual Core arcsine example. This example demonstrates how to run CLA tasks
// on cpu2.cla1
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
#include "cla_ex1_asin_shared.h"
//
// Defines
//
#define WAITSTEP asm(" RPT #255 || NOP")
//
// Globals
//
//Task 1 (C) Variables
// NOTE: Do not initialize the Message RAM variables globally, they will be
// reset during the message ram initialization phase in the CLA memory
// configuration routine
//
#ifdef __cplusplus
#pragma DATA_SECTION("CpuToCla1MsgRAM");
float fVal;
#pragma DATA_SECTION("Cla1ToCpuMsgRAM");
float fResult;
#else
#pragma DATA_SECTION(fVal,"CpuToCla1MsgRAM");
float fVal;
#pragma DATA_SECTION(fResult,"Cla1ToCpuMsgRAM");
float fResult;
#endif //__cplusplus
float y[BUFFER_SIZE];
//
//Task 2 (C) Variables
//
//
//Task 3 (C) Variables
//
//
//Task 4 (C) Variables
//
//
//Task 5 (C) Variables
//
//
//Task 6 (C) Variables
//
//
//Task 7 (C) Variables
//
//
//Task 8 (C) Variables
//
//
//Common (C) Variables
//The Exponential table
//
#ifdef __cplusplus
#pragma DATA_SECTION("CLADataLS0")
#else
#pragma DATA_SECTION(CLAasinTable,"CLADataLS0")
#endif //__cplusplus
float CLAasinTable[]={
0.0, 1.0, 0.0,
0.000000636202, 0.999877862610, 0.007815361896,
0.000005099694, 0.999510644409, 0.015647916155,
0.000017268312, 0.998895919094, 0.023514960332,
0.000041121765, 0.998029615282, 0.031434003631,
0.000080794520, 0.996905974725, 0.039422875916,
0.000140631089, 0.995517492804, 0.047499840611,
0.000225244584, 0.993854840311, 0.055683712914,
0.000339579512, 0.991906765146, 0.063993984848,
0.000488979852, 0.989659972212, 0.072450958820,
0.000679263611, 0.987098979366, 0.081075891529,
0.000916805182, 0.984205946802, 0.089891150305,
0.001208627040, 0.980960476685, 0.098920384204,
0.001562502549, 0.977339379243, 0.108188712551,
0.001987071928, 0.973316400729, 0.117722933997,
0.002491973784, 0.968861907789, 0.127551759665,
0.003087995053, 0.963942521723, 0.137706074532,
0.003787242692, 0.958520694794, 0.148219231941,
0.004603341138, 0.952554219267, 0.159127386977,
0.005551660294, 0.945995657913, 0.170469875522,
0.006649579796, 0.938791682505, 0.182289647088,
0.007916796475, 0.930882303984, 0.194633761132,
0.009375683410, 0.922199974574, 0.207553958472,
0.011051710808, 0.912668537890, 0.221107321885,
0.012973941175, 0.902201997769, 0.235357042896,
0.015175614174, 0.890703070035, 0.250373315541,
0.017694840102, 0.878061473098, 0.266234382514,
0.020575425537, 0.864151902887, 0.283027765009,
0.023867860513, 0.848831624374, 0.300851714968,
0.027630504055, 0.831937595031, 0.319816937941,
0.031931014547, 0.813283013821, 0.340048646894,
0.036848083955, 0.792653161200, 0.361689022958,
0.042473551274, 0.769800358920, 0.384900179460,
0.048914992206, 0.744437830278, 0.409867752228,
0.056298910750, 0.716232177740, 0.436805274317,
0.064774696786, 0.684794109766, 0.465959540059,
0.074519565699, 0.649666934178, 0.497617226179,
0.085744766889, 0.610312179660, 0.532113122767,
0.098703445606, 0.566091493186, 0.569840443472,
0.113700678529, 0.516243664372, 0.611263845480,
0.131106395009, 0.459855210927, 0.656936015611,
0.151372169232, 0.395822366759, 0.707518998893,
0.175053263659, 0.322801460177, 0.763811905770,
0.202837883870, 0.239143420888, 0.826787304376,
0.235586468765, 0.142806299514, 0.897639596948,
0.274385149825, 0.031236880585, 0.977850174820,
0.320619535938, -0.098791845166, 1.069276441800,
0.376078169620, -0.251407364538, 1.174275392129,
0.443100143614, -0.431959397725, 1.295878193174,
0.524789871827, -0.647485610469, 1.438041695773,
0.625336471263, -0.907400624736, 1.606018804842,
0.750500589935, -1.224540947101, 1.806917563896,
0.908377657341, -1.616794995066, 2.050569262035,
1.110633894185, -2.109729648039, 2.350920816737,
1.374584721437, -2.740985157716, 2.728353889708,
1.726848242753, -3.567962877198, 3.213722960014,
2.210117561056, -4.682006534082, 3.855770086891,
2.896554011854, -6.236312386687, 4.735651038017,
3.916505715382, -8.505488022524, 5.997790945975,
5.526855868703, -12.026617159136, 7.922628470498,
8.298197116322, -17.983705080358, 11.123941286820,
13.741706072449, -29.488929624542, 17.203344479111,
27.202707817485, -57.466598393615, 31.741016484669,
83.158101335898, -171.803399517566, 90.149831709374
};
float asin_expected[BUFFER_SIZE]={
1.570796, 1.393789, 1.320141, 1.263401, 1.215375,
1.172892, 1.134327, 1.098718, 1.065436, 1.034046,
1.004232, 0.9757544, 0.9484279, 0.9221048, 0.8966658,
0.8720123, 0.8480621, 0.8247454, 0.8020028, 0.7797828,
0.7580408, 0.7367374, 0.7158381, 0.6953120, 0.6751316,
0.6552721, 0.6357113, 0.6164289, 0.5974064, 0.5786270,
0.5600753, 0.5417370, 0.5235988, 0.5056486, 0.4878751,
0.4702678, 0.4528166, 0.4355124, 0.4183464, 0.4013104,
0.3843968, 0.3675981, 0.3509074, 0.3343180, 0.3178237,
0.3014185, 0.2850964, 0.2688521, 0.2526802, 0.2365756,
0.2205333, 0.2045484, 0.1886164, 0.1727327, 0.1568929,
0.1410927, 0.1253278, 0.1095943, 0.09388787, 0.07820469,
0.06254076, 0.04689218, 0.03125509, 0.01562564
};
uint16_t pass=0;
uint16_t fail=0;
//
// Function Prototypes
//
void runTest(void);
void configClaMemory(void);
void initCpu2Cla1(void);
__interrupt void cla1Isr1();
__interrupt void cla1Isr2();
__interrupt void cla1Isr3();
__interrupt void cla1Isr4();
__interrupt void cla1Isr5();
__interrupt void cla1Isr6();
__interrupt void cla1Isr7();
__interrupt void cla1Isr8();
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
// This is configured by CPU1
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Configure the CLA memory spaces first followed by
// the CLA task vectors.
//
configClaMemory();
initCpu2Cla1();
//
// Enable global Interrupts and higher priority real-time debug events:
//
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
//
// Run the test
//
runTest();
while(1);
}
//
// runTest - Run CLA test
//
void runTest(void)
{
int16_t i, error;
for(i = 0; i < BUFFER_SIZE; i++)
{
fVal= (float)(BUFFER_SIZE - i)/(float)BUFFER_SIZE;
//
// Force Task 1 and wait
//
asm(" IACK #0x0001");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_1))
{
}
WAITSTEP;
y[i] = fResult;
error = fabs(asin_expected[i]-y[i]);
if(error < 0.1)
{
pass++;
}
else
{
fail++;
}
}
#if 0
//
// Force Task 2 and wait
//
asm(" IACK #0x0002");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_2))
{
}
WAITSTEP;
//
// Force Task 3 and wait
//
asm(" IACK #0x0004");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_3))
{
}
WAITSTEP;
//
// Force Task 4 and wait
//
asm(" IACK #0x0008");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_4))
{
}
WAITSTEP;
//
// Force Task 5 and wait
//
asm(" IACK #0x0010");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_5))
{
}
WAITSTEP;
//
// Force Task 6 and wait
//
asm(" IACK #0x0020");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_6))
{
}
WAITSTEP;
//
// Force Task 7 and wait
//
asm(" IACK #0x0040");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_7))
{
}
WAITSTEP;
//
// Force Task 8 and wait
//
asm(" IACK #0x0080");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_8))
{
}
WAITSTEP;
#endif
}
//
// configClaMemory - Configure CLA memory
//
void configClaMemory(void)
{
uint16_t ipcFlag = 5U;
//
// Wait for signal from CPU1 before configuring
//
//
// Send IPC flag 5 to CPU1
//
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag;
//
// Wait for IPC flag 5 from CPU1
//
while((HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag)) == 0x00000000UL)
{
}
//
// ACK IPC flag 5 for CPU1
//
HWREG(IPC_BASE + IPC_O_ACK) = 1UL << ipcFlag;
//
// Wait for ACK of IPC flag 5 from CPU1
//
while((HWREG(IPC_BASE + IPC_O_FLG) & (1UL << ipcFlag)) != 0x00000000UL)
{
}
#ifdef _FLASH
extern uint32_t Cla1funcsRunStart, Cla1funcsLoadStart, Cla1funcsLoadSize;
//
// Copy over code from FLASH to RAM
//
memcpy((uint32_t *)&Cla1funcsRunStart, (uint32_t *)&Cla1funcsLoadStart,
(uint32_t)&Cla1funcsLoadSize);
#endif //_FLASH
#ifdef CPU2
//
// Enable CPU2 clocking at the sys clock level
//
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_CLA1);
#endif //CPU2
//
// Initialize and wait for CLA1ToCPUMsgRAM
//
MemCfg_initSections(MEMCFG_SECT_MSGCLA1TOCPU);
while(!MemCfg_getInitStatus(MEMCFG_SECT_MSGCLA1TOCPU))
{
}
//
// Initialize and wait for CPUToCLA1MsgRAM
//
MemCfg_initSections(MEMCFG_SECT_MSGCPUTOCLA1);
while(!MemCfg_getInitStatus(MEMCFG_SECT_MSGCPUTOCLA1))
{
}
//
// Select LS4RAM and LS5RAM to be the programming space for the CLA
// First configure the CLA to be the master for LS4 and LS5 and then
// set the space to be a program block
//
MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS4, MEMCFG_LSRAMMASTER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS4, MEMCFG_CLA_MEM_PROGRAM);
MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS5, MEMCFG_LSRAMMASTER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS5, MEMCFG_CLA_MEM_PROGRAM);
//
// Next configure LS0RAM and LS1RAM as data spaces for the CLA
// First configure the CLA to be the master for LS0(1) and then
// set the spaces to be code blocks
//
MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS0, MEMCFG_LSRAMMASTER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS0, MEMCFG_CLA_MEM_DATA);
MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS1, MEMCFG_LSRAMMASTER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS1, MEMCFG_CLA_MEM_DATA);
}
//
// initCpu2Cla1 - Initialize CLA1 task vectors and end of task ISRs
//
void initCpu2Cla1(void)
{
//
// Compute all CLA task vectors
// On Type-1 CLAs the MVECT registers accept full 16-bit task addresses as
// opposed to offsets used on older Type-0 CLAs
//
// Adding a pragma to suppress the warnings when casting the CLA tasks'
// function pointers to uint16_t. Compiler believes this to be improper
// although the CLA only has 16-bit addressing.
//
#pragma diag_suppress=770
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_1, (uint16_t)&Cla1Task1);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_2, (uint16_t)&Cla1Task2);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_3, (uint16_t)&Cla1Task3);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_4, (uint16_t)&Cla1Task4);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_5, (uint16_t)&Cla1Task5);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_6, (uint16_t)&Cla1Task6);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_7, (uint16_t)&Cla1Task7);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_8, (uint16_t)&Cla1Task8);
#pragma diag_warning=770
//
// Enable the IACK instruction to start a task on CLA in software
// for all 8 CLA tasks. Also, globally enable all 8 tasks (or a
// subset of tasks) by writing to their respective bits in the
// MIER register
//
CLA_enableIACK(CLA1_BASE);
CLA_enableTasks(CLA1_BASE, 0x00FF);
//
// Configure the vectors for the end-of-task interrupt for all
// 8 tasks
//
Interrupt_register(INT_CLA1_1, cla1Isr1);
Interrupt_register(INT_CLA1_2, cla1Isr2);
Interrupt_register(INT_CLA1_3, cla1Isr3);
Interrupt_register(INT_CLA1_4, cla1Isr4);
Interrupt_register(INT_CLA1_5, cla1Isr5);
Interrupt_register(INT_CLA1_6, cla1Isr6);
Interrupt_register(INT_CLA1_7, cla1Isr7);
Interrupt_register(INT_CLA1_8, cla1Isr8);
//
// Enable CLA interrupts at the group and subgroup levels
//
Interrupt_enable(INT_CLA1_1);
Interrupt_enable(INT_CLA1_2);
Interrupt_enable(INT_CLA1_3);
Interrupt_enable(INT_CLA1_4);
Interrupt_enable(INT_CLA1_5);
Interrupt_enable(INT_CLA1_6);
Interrupt_enable(INT_CLA1_7);
Interrupt_enable(INT_CLA1_8);
IER |= INTERRUPT_CPU_INT11;
}
//
// cla1Isr1 - CLA1 ISR 1
//
__interrupt void cla1Isr1 ()
{
//
// Acknowledge the end-of-task interrupt for task 1
//
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP11);
// asm(" ESTOP0");
}
//
// cla1Isr2 - CLA1 ISR 2
//
__interrupt void cla1Isr2 ()
{
asm(" ESTOP0");
}
//
// cla1Isr3 - CLA1 ISR 3
//
__interrupt void cla1Isr3 ()
{
asm(" ESTOP0");
}
//
// cla1Isr4 - CLA1 ISR 4
//
__interrupt void cla1Isr4 ()
{
asm(" ESTOP0");
}
//
// cla1Isr5 - CLA1 ISR 5
//
__interrupt void cla1Isr5 ()
{
asm(" ESTOP0");
}
//
// cla1Isr6 - CLA1 ISR 6
//
__interrupt void cla1Isr6 ()
{
asm(" ESTOP0");
}
//
// cla1Isr7 - CLA1 ISR 7
//
__interrupt void cla1Isr7 ()
{
asm(" ESTOP0");
}
//
// cla1Isr8 - CLA1 ISR 8
//
__interrupt void cla1Isr8 ()
{
//
// Acknowledge the end-of-task interrupt for task 8
//
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP11);
// asm(" ESTOP0");
}
//
// End of file
//
@@ -0,0 +1,135 @@
//#############################################################################
//
// FILE: cla_ex1_asin_shared.h
//
// TITLE: CLA arcsine example header file
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
#ifndef CLA_ASIN_SHARED_H
#define CLA_ASIN_SHARED_H
//
// Included Files
//
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
//
// Defines
//
#define BUFFER_SIZE 64
#define TABLE_SIZE 64
#define TABLE_SIZE_M_1 TABLE_SIZE-1
#define PIBYTWO 1.570796327
#define PI 3.141592653589
#define INV2PI 0.159154943
//
// Globals
//
//Task 1 (C) Variables
//
extern float y[]; //Result vector
extern float fVal; //Holds the input argument to the task
extern float fResult; //The arsine of the input argument
//
//Task 2 (C) Variables
//
//
//Task 3 (C) Variables
//
//
//Task 4 (C) Variables
//
//
//Task 5 (C) Variables
//
//
//Task 6 (C) Variables
//
//
//Task 7 (C) Variables
//
//
//Task 8 (C) Variables
//
//
//Common (C) Variables
//
extern float CLAasinTable[]; //The arcsine lookup table
//
// Function Prototypes
//
// The following are symbols defined in the CLA assembly code
// Including them in the shared header file makes them
// .global and the main CPU can make use of them.
//
//
//CLA C Tasks
//
__interrupt void Cla1Task1();
__interrupt void Cla1Task2();
__interrupt void Cla1Task3();
__interrupt void Cla1Task4();
__interrupt void Cla1Task5();
__interrupt void Cla1Task6();
__interrupt void Cla1Task7();
__interrupt void Cla1Task8();
#ifdef __cplusplus
}
#endif // extern "C"
#endif // CLA_EX1_ASIN_SHARED_H
//
// End of file
//
@@ -0,0 +1,165 @@
//#############################################################################
//
// FILE: cla_ex2_iir2p2z.cla
//
// TITLE: 2-Pole 2-Zero IIR Filter Example
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "cla_ex2_iir2p2z_shared.h"
//
// Globals
//
// Note that the globals defined in the .cla source are global to the cla source
// file. i.e. they may be shared across tasks. All of the data shared between
// the CLA and the C28x CPU must be defined in the C (or C++) code, and not the
// CLA code.
//
float W2[2]; //w2(n) and w2(n-1)
float W1[2]; //w1(n) and w1(n-1)
//
// function definitions
//
//Task 1 : 2p2z IIR Transposed Direct Form II Filter
// ALGORITHM:
//
// Difference Equation :
//
// The operations for each biquad, in order, is as follows
// 1. yn = xn*b(0) + q4
// 2. q3 = xn*b(1) + yn*a(1) + q2
// 3. q4 = q3
// 4. q1 = xn*b(2) + yn*a(2)
// 5. q2 = q1
// where
// yn =output sample of the filter at index n
// xn =input sample of the filter at index n
// qx =intermediate values stored in the delay buffer
//
// Transfer Function :
// The difference equation is split up into multiple Second-Order Sections(SOS)
// Each SOS represents a Biquad with the following transfer function
// -1 -2
// Y(z) b(0) + b(1) z + b(2) z
// ----- = -----------------------
// X(z) -1 -2
// a(0) + a(1) z + a(2) z
//
// For a detailed treatment of Direct II Forms see
// [1]Digital Signal Processing, Proakis, J. G. and Manolakis, D. G. - Chapter 7
// [2]Understanding Digital Signal Processing 3rd ed, Lyons, R. G.
//
// Network Diagram :
//
// xn------>(x)--->(+)--------------->yn
// | ^ ^ |
// | | |q4 |
// | b(0) (z) |
// | ^ |
// | |q3 |
// |-->(x)--->(+)<-----(x)---|
// | ^ ^ ^ |
// | | |q2 | |
// | b(1) (z) a(1) |
// | ^ |
// | |q1 |
// --->(x)--->(+)<-----(x)----
// ^ ^
// | |
// b(2) a(2)
interrupt void Cla1Task1 ( void )
{
//Local Variables
//Code
__mdebugstop();
yn = xn*S1_B[0] + W2[1];
W2[0] = xn*S1_B[1] + yn*S1_A[1] + W1[1];
W2[1] = W2[0];
W1[0] = xn*S1_B[2] + yn*S1_A[2];
W1[1] = W1[0];
// __mnop();
// __mnop();
// __mnop();
}
interrupt void Cla1Task2 ( void )
{
}
interrupt void Cla1Task3 ( void )
{
}
interrupt void Cla1Task4 ( void )
{
}
interrupt void Cla1Task5 ( void )
{
}
interrupt void Cla1Task6 ( void )
{
}
interrupt void Cla1Task7 ( void )
{
}
//Task 8 will initialize the variables used in Task 1
interrupt void Cla1Task8 ( void )
{
W2[0] = 0; W2[1] = 0;
W1[0] = 0; W1[1] = 0;
}
//
// End of file
//
@@ -0,0 +1,196 @@
//###########################################################################
//
// FILE: cla_ex2_iir2p2z_cpu1.c
//
// TITLE: CLA IIR2p2Z Example for F2837xD.
//
//! \addtogroup dual_example_list
//! <h1>CLA 2 Pole 2 Zero Infinite Impulse Response Filter (cla_iir2p2z_cpu01)</h1>
//!
//! This example implements a Transposed Direct Form II IIR filter, commonly
//! known as a Biquad. The input vector is a software simulated noisy signal
//! that is fed to the biquad one sample at a time, filtered and then stored
//! in an output buffer for storage.
//!
//! \b Memory \b Allocation \n
//! - CLA1 Data RAM 1 (RAML2)
//! - S1_A - Feedback coefficients
//! - S1_B - Feedforward coefficients
//! - CLA1 to CPU Message RAM
//! - yn - Output of the Biquad
//! - CPU to CLA1 Message RAM
//! - xn - Sample input to the filter
//!
//! \b Watch \b Variables \n
//! - fBiquadOutput
//! - pass
//! - fail
//!
//! \note CPU2 must turn on the CLA clock by writing a 1 to
//! CpuSysRegs.PCLKCR0.bit.CLA1.
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
//
// Globals
//
uint16_t pass=0;
uint16_t fail=0;
//
// Function Prototypes
//
void initCpuXCla1(void);
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
#ifdef _STANDALONE
#ifdef _FLASH
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
#else
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_RAM);
#endif // _FLASH
#endif // _STANDALONE
//
// Disable pin locks and enable internal pullups.
//
Device_initGPIO();
//
// Disable global interrupts.
//
DINT;
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Turn on the CLA clocks on both CPUs.
//
initCpuXCla1();
//
// Enable global Interrupts and higher priority real-time debug events:
//
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global real-time interrupt DBGM
while(1);
}
//
// initCpuXCla1 - Enable CLA1 on CPU1 and CPU2
//
void initCpuXCla1(void)
{
uint16_t ipcFlag = 5U;
#ifdef CPU1
EALLOW;
//
// Enable CPU1 CLA1
//
HWREG(DEVCFG_BASE + SYSCTL_O_DC1) |= SYSCTL_DC1_CPU1_CLA1;
//
// Enable CPU2 CLA1
//
HWREG(DEVCFG_BASE + SYSCTL_O_DC1) |= SYSCTL_DC1_CPU2_CLA1;
EDIS;
#endif //CPU1
//
// Send IPC flag 5 to CPU2
//
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag;
//
// Wait for IPC flag 5 from CPU2
//
while((HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag)) == 0x00000000UL)
{
}
//
// ACK IPC flag 5 for CPU2
//
HWREG(IPC_BASE + IPC_O_ACK) = 1UL << ipcFlag;
//
// Wait for ACK of IPC flag 5 from CPU2
//
while((HWREG(IPC_BASE + IPC_O_FLG) & (1UL << ipcFlag)) != 0x00000000UL)
{
}
}
//
// End of file
//
@@ -0,0 +1,600 @@
//###########################################################################
//
// FILE: cla_ex2_iir2p2z_cpu2.c
//
// TITLE: CLA 2-pole 2-zero IIR Filter Example for F2837xD.
//
// Dual Core iir2p2z example. This example demonstrates how to run CLA tasks
// on cpu2.cla1
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
#include "cla_ex2_iir2p2z_shared.h"
//
// Defines
//
#define NUM_SAMPLES 128
#define WAITSTEP asm(" RPT #255 || NOP")
//
// Globals
//
//Task 1 (C) Variables
//
#ifdef __cplusplus
#pragma DATA_SECTION("CLADataLS0")
float S1_B[]={0.02008, 0.04017, 0.02008};
#pragma DATA_SECTION("CLADataLS0")
float S1_A[]={-1.0, 1.56102, -0.64135};
#pragma DATA_SECTION("CLADataLS0")
float S2_B[]={0, 0, 0};
#pragma DATA_SECTION("CLADataLS0")
float S2_A[]={0, 0, 0};
#pragma DATA_SECTION("CLADataLS0")
float S3_B[]={0, 0, 0};
#pragma DATA_SECTION("CLADataLS0")
float S3_A[]={0, 0, 0};
#pragma DATA_SECTION("CpuToCla1MsgRAM")
float xn;
#pragma DATA_SECTION("Cla1ToCpuMsgRAM")
float yn;
#else
#pragma DATA_SECTION(S1_B,"CLADataLS0")
float S1_B[]={0.02008, 0.04017, 0.02008};
#pragma DATA_SECTION(S1_A,"CLADataLS0")
float S1_A[]={-1.0, 1.56102, -0.64135};
#pragma DATA_SECTION(S2_B,"CLADataLS0")
float S2_B[]={0, 0, 0};
#pragma DATA_SECTION(S2_A,"CLADataLS0")
float S2_A[]={0, 0, 0};
#pragma DATA_SECTION(S3_B,"CLADataLS0")
float S3_B[]={0, 0, 0};
#pragma DATA_SECTION(S3_A,"CLADataLS0")
float S3_A[]={0, 0, 0};
#pragma DATA_SECTION(xn,"CpuToCla1MsgRAM")
float xn;
#pragma DATA_SECTION(yn,"Cla1ToCpuMsgRAM")
float yn;
#endif //__cplusplus
//
//Task 2 (C) Variables
//
//
//Task 3 (C) Variables
//
//
//Task 4 (C) Variables
//
//
//Task 5 (C) Variables
//
//
//Task 6 (C) Variables
//
//
//Task 7 (C) Variables
//
//
//Task 8 (C) Variables
//
//
//Common (C) Variables
//
float fBiquadOutput[NUM_SAMPLES];
float fAdcInput[NUM_SAMPLES] = {
0, 0.4359, -0.4129, 0.2482,
0.4182, -0.3455, 0.4780, 0.3674,
-0.2347, 0.6724, 0.2939, -0.0858,
0.8178, 0.2100, 0.0914, 0.9045,
0.1283, 0.2836, 0.9279, 0.0604,
0.4755, 0.8888, 0.0156, 0.6506,
0.7929, 0, 0.7929, 0.6506,
0.0156, 0.8888, 0.4755, 0.0604,
0.9279, 0.2836, 0.1283, 0.9045,
0.0914, 0.2100, 0.8178, -0.0858,
0.2939, 0.6724, -0.2347, 0.3674,
0.4780, -0.3455, 0.4182, 0.2482,
-0.4129, 0.4359, 0.0000, -0.4359,
0.4129, -0.2482, -0.4182, 0.3455,
-0.4780, -0.3674, 0.2347, -0.6724,
-0.2939, 0.0858, -0.8178, -0.2100,
-0.0914, -0.9045, -0.1283, -0.2836,
-0.9279, -0.0604, -0.4755, -0.8888,
-0.0156, -0.6506, -0.7929, 0,
-0.7929, -0.6506, -0.0156, -0.8888,
-0.4755, -0.0604, -0.9279, -0.2836,
-0.1283, -0.9045, -0.0914, -0.2100,
-0.8178, 0.0858, -0.2939, -0.6724,
0.2347, -0.3674, -0.4780, 0.3455,
-0.4182, -0.2482, 0.4129, -0.4359,
-0.0000, 0.4359, -0.4129, 0.2482,
0.4182, -0.3455, 0.4780, 0.3674,
-0.2347, 0.6724, 0.2939, -0.0858,
0.8178, 0.2100, 0.0914, 0.9045,
0.1283, 0.2836, 0.9279, 0.0604,
0.4755, 0.8888, 0.0156, 0.6506,
0.7929, 0, 0.7929, 0.6506
};
float iir_expected[NUM_SAMPLES]={
0, 0.008754415, 0.02288298, 0.02726187,
0.03795755, 0.05661327, 0.06815149, 0.08971455,
0.1159805, 0.1349670, 0.1645004, 0.1938129,
0.2159233, 0.2481003, 0.2754995, 0.2969926,
0.3276609, 0.3500223, 0.3688507, 0.3954768,
0.4113952, 0.4267188, 0.4478308, 0.4569381,
0.4684406, 0.4831003, 0.4855416, 0.4930161,
0.5005732, 0.4967500, 0.4999563, 0.5000126,
0.4904927, 0.4891656, 0.4816235, 0.4671103,
0.4610198, 0.4461307, 0.4274355, 0.4164503,
0.3948304, 0.3728325, 0.3569719, 0.3295808,
0.3051807, 0.2846532, 0.2527421, 0.2268174,
0.2020469, 0.1670849, 0.1404567, 0.1120952,
0.07568341, 0.04909494, 0.01802110, -0.01820113,
-0.04409146, -0.07679208, -0.1112392, -0.1358536,
-0.1689253, -0.2001516, -0.2229802, -0.2550509,
-0.2818236, -0.3024068, -0.3320566, -0.3534117,
-0.3713224, -0.3971615, -0.4124396, -0.4272688,
-0.4480195, -0.4568799, -0.4682287, -0.4828069,
-0.4852195, -0.4927015, -0.5002885, -0.4965075,
-0.4997604, -0.4998623, -0.4903836, -0.4890918,
-0.4815782, -0.4670869, -0.4610124, -0.4461341,
-0.4274456, -0.4164638, -0.3948451, -0.3728467,
-0.3569847, -0.3295917, -0.3051894, -0.2846599,
-0.2527469, -0.2268206, -0.2020488, -0.1670859,
-0.1404569, -0.1120951, -0.07568294, -0.04909432,
-0.01802043, 0.01820178, 0.04409203, 0.07679256,
0.1112396, 0.1358539, 0.1689255, 0.2001518,
0.2229803, 0.2550510, 0.2818236, 0.3024068,
0.3320566, 0.3534117, 0.3713224, 0.3971614,
0.4124396, 0.4272687, 0.4480195, 0.4568799,
0.4682287, 0.4828069, 0.4852195, 0.4927014
};
uint16_t pass=0;
uint16_t fail=0;
//
// Function Prototypes
//
void runTest(void);
void configClaMemory(void);
void initCpu2Cla1(void);
__interrupt void cla1Isr1();
__interrupt void cla1Isr2();
__interrupt void cla1Isr3();
__interrupt void cla1Isr4();
__interrupt void cla1Isr5();
__interrupt void cla1Isr6();
__interrupt void cla1Isr7();
__interrupt void cla1Isr8();
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
// This is configured by CPU1
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Configure the CLA memory spaces first followed by
// the CLA task vectors.
//
configClaMemory();
initCpu2Cla1();
//
// Enable global Interrupts and higher priority real-time debug events:
//
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
//
// Run the test
//
runTest();
while(1);
}
//
// runTest - Run CLA test
//
void runTest(void)
{
int16_t i;
float fError[NUM_SAMPLES];
//
// Force Task 8 and wait
//
asm(" IACK #0x0080");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_8))
{
}
WAITSTEP;
for(i = 0; i < NUM_SAMPLES; i++)
{
xn = fAdcInput[i];
//
// Force Task 1 and wait
//
asm(" IACK #0x0001");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_1))
{
}
WAITSTEP;
fBiquadOutput[i] = yn;
fError[i] = fabs(iir_expected[i]-fBiquadOutput[i]);
if(fError[i] < 0.01)
{
pass++;
}
else
{
fail++;
}
}
#if 0
//
// Force Task 2 and wait
//
asm(" IACK #0x0002");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_2))
{
}
WAITSTEP;
//
// Force Task 3 and wait
//
asm(" IACK #0x0004");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_3))
{
}
WAITSTEP;
//
// Force Task 4 and wait
//
asm(" IACK #0x0008");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_4))
{
}
WAITSTEP;
//
// Force Task 5 and wait
//
asm(" IACK #0x0010");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_5))
{
}
WAITSTEP;
//
// Force Task 6 and wait
//
asm(" IACK #0x0020");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_6))
{
}
WAITSTEP;
//
// Force Task 7 and wait
//
asm(" IACK #0x0040");
asm(" RPT #3 || NOP");
while(CLA_getTaskRunStatus(CLA1_BASE, CLA_TASK_7))
{
}
WAITSTEP;
#endif
}
//
// configClaMemory - Configure CLA memory
//
void configClaMemory(void)
{
uint16_t ipcFlag = 5U;
//
// Wait for signal from CPU1 before configuring
//
//
// Send IPC flag 5 to CPU1
//
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag;
//
// Wait for IPC flag 5 from CPU1
//
while((HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag)) == 0x00000000UL)
{
}
//
// ACK IPC flag 5 for CPU1
//
HWREG(IPC_BASE + IPC_O_ACK) = 1UL << ipcFlag;
//
// Wait for ACK of IPC flag 5 from CPU1
//
while((HWREG(IPC_BASE + IPC_O_FLG) & (1UL << ipcFlag)) != 0x00000000UL)
{
}
#ifdef _FLASH
extern uint32_t Cla1funcsRunStart, Cla1funcsLoadStart, Cla1funcsLoadSize;
//
// Copy over code from FLASH to RAM
//
memcpy((uint32_t *)&Cla1funcsRunStart, (uint32_t *)&Cla1funcsLoadStart,
(uint32_t)&Cla1funcsLoadSize);
#endif //_FLASH
#ifdef CPU2
//
// Enable CPU2 clocking at the sys clock level
//
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_CLA1);
#endif //CPU2
//
// Initialize and wait for CLA1ToCPUMsgRAM
//
MemCfg_initSections(MEMCFG_SECT_MSGCLA1TOCPU);
while(!MemCfg_getInitStatus(MEMCFG_SECT_MSGCLA1TOCPU))
{
}
//
// Initialize and wait for CPUToCLA1MsgRAM
//
MemCfg_initSections(MEMCFG_SECT_MSGCPUTOCLA1);
while(!MemCfg_getInitStatus(MEMCFG_SECT_MSGCPUTOCLA1))
{
}
//
// Select LS4RAM and LS5RAM to be the programming space for the CLA
// First configure the CLA to be the master for LS4 and LS5 and then
// set the space to be a program block
//
MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS4, MEMCFG_LSRAMMASTER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS4, MEMCFG_CLA_MEM_PROGRAM);
MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS5, MEMCFG_LSRAMMASTER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS5, MEMCFG_CLA_MEM_PROGRAM);
//
// Next configure LS0RAM and LS1RAM as data spaces for the CLA
// First configure the CLA to be the master for LS0(1) and then
// set the spaces to be code blocks
//
MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS0, MEMCFG_LSRAMMASTER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS0, MEMCFG_CLA_MEM_DATA);
MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS1, MEMCFG_LSRAMMASTER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS1, MEMCFG_CLA_MEM_DATA);
}
//
// initCpu2Cla1 - Initialize CLA1 task vectors and end of task ISRs
//
void initCpu2Cla1(void)
{
//
// Compute all CLA task vectors
// On Type-1 CLAs the MVECT registers accept full 16-bit task addresses as
// opposed to offsets used on older Type-0 CLAs
//
// Adding a pragma to suppress the warnings when casting the CLA tasks'
// function pointers to uint16_t. Compiler believes this to be improper
// although the CLA only has 16-bit addressing.
//
#pragma diag_suppress=770
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_1, (uint16_t)&Cla1Task1);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_2, (uint16_t)&Cla1Task2);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_3, (uint16_t)&Cla1Task3);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_4, (uint16_t)&Cla1Task4);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_5, (uint16_t)&Cla1Task5);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_6, (uint16_t)&Cla1Task6);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_7, (uint16_t)&Cla1Task7);
CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_8, (uint16_t)&Cla1Task8);
#pragma diag_warning=770
//
// Enable the IACK instruction to start a task on CLA in software
// for all 8 CLA tasks. Also, globally enable all 8 tasks (or a
// subset of tasks) by writing to their respective bits in the
// MIER register
//
CLA_enableIACK(CLA1_BASE);
CLA_enableTasks(CLA1_BASE, 0x00FF);
//
// Configure the vectors for the end-of-task interrupt for all
// 8 tasks
//
Interrupt_register(INT_CLA1_1, cla1Isr1);
Interrupt_register(INT_CLA1_2, cla1Isr2);
Interrupt_register(INT_CLA1_3, cla1Isr3);
Interrupt_register(INT_CLA1_4, cla1Isr4);
Interrupt_register(INT_CLA1_5, cla1Isr5);
Interrupt_register(INT_CLA1_6, cla1Isr6);
Interrupt_register(INT_CLA1_7, cla1Isr7);
Interrupt_register(INT_CLA1_8, cla1Isr8);
//
// Enable CLA interrupts at the group and subgroup levels
//
Interrupt_enable(INT_CLA1_1);
Interrupt_enable(INT_CLA1_2);
Interrupt_enable(INT_CLA1_3);
Interrupt_enable(INT_CLA1_4);
Interrupt_enable(INT_CLA1_5);
Interrupt_enable(INT_CLA1_6);
Interrupt_enable(INT_CLA1_7);
Interrupt_enable(INT_CLA1_8);
IER |= INTERRUPT_CPU_INT11;
}
//
// cla1Isr1 - CLA1 ISR 1
//
__interrupt void cla1Isr1()
{
//
// Acknowledge the end-of-task interrupt for task 1
//
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP11);
// asm(" ESTOP0");
}
//
// cla1Isr2 - CLA1 ISR 2
//
__interrupt void cla1Isr2()
{
asm(" ESTOP0");
}
//
// cla1Isr3 - CLA1 ISR 3
//
__interrupt void cla1Isr3()
{
asm(" ESTOP0");
}
//
// cla1Isr4 - CLA1 ISR 4
//
__interrupt void cla1Isr4()
{
asm(" ESTOP0");
}
//
// cla1Isr5 - CLA1 ISR 5
//
__interrupt void cla1Isr5()
{
asm(" ESTOP0");
}
//
// cla1Isr6 - CLA1 ISR 6
//
__interrupt void cla1Isr6()
{
asm(" ESTOP0");
}
//
// cla1Isr7 - CLA1 ISR 7
//
__interrupt void cla1Isr7()
{
asm(" ESTOP0");
}
//
// cla1Isr8 - CLA1 ISR 8
//
__interrupt void cla1Isr8()
{
//
// Acknowledge the end-of-task interrupt for task 8
//
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP11);
// asm(" ESTOP0");
}
//
// End of file
//
@@ -0,0 +1,145 @@
//#############################################################################
//
// FILE: cla_ex2_iir2p2z_shared.h
//
// TITLE: CLA IIR 2-pole 2-zero filter
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
#ifndef CLA_IIR2P2Z_SHARED_H
#define CLA_IIR2P2Z_SHARED_H
//
// Included Files
//
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
//
// Defines
//
#define BUFFER_SIZE 64
#define TABLE_SIZE 64
#define TABLE_SIZE_M_1 (TABLE_SIZE-1)
#define PIBYTWO 1.570796327
#define PI 3.141592653589
#define INV2PI 0.159154943
//
// Globals
//
//
//Task 1 (C) Variables
//
#define NUM_SAMPLES 128
extern float S1_B[];
extern float S1_A[];
extern float S2_B[];
extern float S2_A[];
extern float S3_B[];
extern float S3_A[];
extern float xn; //Sample input
extern float yn; //Sample output
extern float fAdcInput[];
extern float fBiquadOutput[];
extern float fAdcInput[];
//
//Task 2 (C) Variables
//
//
//Task 3 (C) Variables
//
//
//Task 4 (C) Variables
//
//
//Task 5 (C) Variables
//
//
//Task 6 (C) Variables
//
//
//Task 7 (C) Variables
//
//
//Task 8 (C) Variables
//
//
//Common (C) Variables
//
//
// Function Prototypes
//
// The following are symbols defined in the CLA assembly code
// Including them in the shared header file makes them
// .global and the main CPU can make use of them.
//
//
//CLA C Tasks
//
__interrupt void Cla1Task1();
__interrupt void Cla1Task2();
__interrupt void Cla1Task3();
__interrupt void Cla1Task4();
__interrupt void Cla1Task5();
__interrupt void Cla1Task6();
__interrupt void Cla1Task7();
__interrupt void Cla1Task8();
#ifdef __cplusplus
}
#endif // extern "C"
#endif // CLA_EX2_IIR2P2Z_SHARED_H_
//
// End of file
//
@@ -0,0 +1,58 @@
<projectSpec>
<project
name="dcsm_security_tool_cpu1"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="sysconfig;C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${DCSMTOOL_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --define=DEBUG --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
<pathVariable name="DCSMTOOL_SYSCFG_ROOT" path="../../../../../../utilities/dcsm_tool/dcsm_syscfg/" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../dcsm_security_tool_cpu1.c" targetDirectory="" />
<file action="copy" path="../dcsm_security_tool_cpu1.syscfg" targetDirectory="" />
</project>
<project
name="dcsm_security_tool_cpu2"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="sysconfig;C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${DCSMTOOL_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --define=DEBUG --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
<pathVariable name="DCSMTOOL_SYSCFG_ROOT" path="../../../../../../utilities/dcsm_tool/dcsm_syscfg/" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../dcsm_security_tool_cpu2.c" targetDirectory="" />
<file action="copy" path="../dcsm_security_tool_cpu2.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,91 @@
//#############################################################################
//
// FILE: dcsm_security_tool_cpu1.c
//
// TITLE: DCSM Security Project
//
// CPU1 DCSM Security Example
//
// This example is an empty project setup for DCSM Tool and Driverlib
// development.
// For guidance refer to: http://www.ti.com/lit/pdf/spracp8
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Disable pin locks and enable internal pull-ups.
//
Device_initGPIO();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
//
EINT;
ERTM;
//
// IDLE loop. Just sit and loop forever (optional):
//
for(;;)
{
NOP;
}
}
@@ -0,0 +1,17 @@
// These arguments were used when this file was generated. They will be automatically applied on subsequent loads
// via the GUI or CLI invocations. Run CLI with '--help' for additional information on how to override these arguments.
// @cliArgs --device "F28X7X"
// @versions {"data":"2019083011","timestamp":"2019083011","tool":"1.2.952","templates":"2019083011"}
var DCSM = scripting.addModule("/utilities/dcsm_tool/dcsm_syscfg/source/DCSM", {}, false);
var DCSM1 = DCSM.addInstance();
// Name
DCSM1.$name = "DCSM0";
// Name
DCSM1.ZONE1_OTP.$name = "ZONE_OTP0";
// Name
DCSM1.ZONE1.$name = "ZONE0";
// Name
DCSM1.ZONE2_OTP.$name = "ZONE_OTP1";
// Name
DCSM1.ZONE2.$name = "ZONE1";
@@ -0,0 +1,93 @@
//#############################################################################
//
// FILE: dcsm_security_tool_cpu2.c
//
// TITLE: DCSM Security Project
//
// CPU2 DCSM Security Example
//
// This example is an empty project setup for DCSM Tool and Driverlib
// development.
// For guidance refer to: http://www.ti.com/lit/pdf/spracp8
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
//
EINT;
ERTM;
//
// IDLE loop. Just sit and loop forever (optional):
//
for(;;)
{
NOP;
}
}
//
// End of File
//
@@ -0,0 +1,17 @@
// These arguments were used when this file was generated. They will be automatically applied on subsequent loads
// via the GUI or CLI invocations. Run CLI with '--help' for additional information on how to override these arguments.
// @cliArgs --device "F28X7X"
// @versions {"data":"2019083011","timestamp":"2019083011","tool":"1.2.952","templates":"2019083011"}
var DCSM = scripting.addModule("/utilities/dcsm_tool/dcsm_syscfg/source/DCSM", {}, false);
var DCSM1 = DCSM.addInstance();
// Name
DCSM1.$name = "DCSM0";
// Name
DCSM1.ZONE1_OTP.$name = "ZONE_OTP0";
// Name
DCSM1.ZONE1.$name = "ZONE0";
// Name
DCSM1.ZONE2_OTP.$name = "ZONE_OTP1";
// Name
DCSM1.ZONE2.$name = "ZONE1";
@@ -0,0 +1,48 @@
<projectSpec>
<project
name="dma_ex1_shared_periph_cpu1"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_shared_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../dma_ex1_shared_periph_cpu1.c" targetDirectory="" />
</project>
<project
name="dma_ex1_shared_periph_cpu2"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU2_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_shared_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU2_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU2_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../dma_ex1_shared_periph_cpu2.c" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,71 @@
<projectSpec>
<project
name="dma_ex2_sysconfig_multi"
configurations="
FLASH,
RAM,
"
device="TMS320F28377D"
outputType="system"
cgtVersion="20.2.1.LTS"
>
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<file path="../system.xml" action="copy" openOnCreation="true"/>
<configuration name="FLASH"
></configuration>
<configuration name="RAM"
></configuration>
</project>
<project
name="dma_ex2_sysconfig_cpu1"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="FLASH" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="RAM" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../dma_ex2_sysconfig_cpu1.c" targetDirectory="" />
<file action="copy" path="../dma_ex2_sysconfig_cpu1.syscfg" targetDirectory="" />
</project>
<project
name="dma_ex2_sysconfig_cpu2"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_FLASH_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="FLASH" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_RAM_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="RAM" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../dma_ex2_sysconfig_cpu2.c" targetDirectory="" />
<file action="copy" path="../dma_ex2_sysconfig_cpu2.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,332 @@
//#############################################################################
//
// FILE: dma_ex1_shared_periph_cpu1.c
//
// TITLE: DMA Transfer for Shared Peripheral Example
//
//! \addtogroup driver_dual_example_list
//! <h1> DMA Transfer Shared Peripheral </h1>
//!
//! This example shows how to initiate a DMA transfer on CPU1 from a shared
//! peripheral which is owned by CPU2. In this specific example, a timer ISR
//! is used on CPU2 to initiate a SPI transfer which will trigger the CPU1 DMA.
//! CPU1's DMA will then in turn update the ePWM1 CMPA value for the PWM which
//! it owns. The PWM output can be observed on the GPIO pins.
//!
//! \b Watch \b Pins
//! - GPIO0 and GPIO1 - ePWM output can be viewed with oscilloscope
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
//
// Defines
//
//#define USE_DMA_INTERRUPT
//
// Globals
//
uint16_t newCMPValue;
#pragma DATA_SECTION(newCMPValue, "SHARERAMGS2");
//
// Function Prototypes
//
void Example_deviceInit(void);
void initEPWM1(void);
void setupDMA(void);
#ifdef USE_DMA_INTERRUPT
__interrupt void dmaISR(void);
#endif
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Example_deviceInit();
//
// Initialize GPIO and configure the GPIOs 0 and 1 as ePWM outputs
//
Device_initGPIO();
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
GPIO_setPinConfig(GPIO_0_EPWM1A);
GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);
GPIO_setPinConfig(GPIO_1_EPWM1B);
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Configure ePWM1 and the DMA
//
initEPWM1();
setupDMA();
//
// Send IPC to CPU2 telling it to proceed with configuring the SPI
//
HWREG(IPC_BASE + IPC_O_SET) = IPC_SET_IPC1;
//
// Enable DMA interrupt
//
#ifdef USE_DMA_INTERRUPT
Interrupt_enable(INT_DMA_CH5);
Interrupt_register(INT_DMA_CH5, &dmaISR);
#endif
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop indefinitely
//
for(;;)
{
NOP;
}
}
//
// Example_deviceInit function
// This example uses custom Device_init function since CPU2 owns some of the
// peripherals
//
void Example_deviceInit(void)
{
//
// Disable the watchdog
//
SysCtl_disableWatchdog();
#ifdef _FLASH
//
// Copy time critical code and flash setup code to RAM. This includes the
// following functions: InitFlash();
//
// The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart symbols
// are created by the linker. Refer to the device .cmd file.
//
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
//
// Call Flash Initialization to setup flash waitstates. This function must
// reside in RAM.
//
Flash_initModule(FLASH0CTRL_BASE, FLASH0ECC_BASE, DEVICE_FLASH_WAITSTATES);
#endif
//
// Set up PLL control and clock dividers
//
SysCtl_setClock(DEVICE_SETCLOCK_CFG);
//
// Make sure the LSPCLK divider is set to the default (divide by 4)
//
SysCtl_setLowSpeedClock(SYSCTL_LSPCLK_PRESCALE_4);
//
// These asserts will check that the #defines for the clock rates in
// device.h match the actual rates that have been configured. If they do
// not match, check that the calculations of DEVICE_SYSCLK_FREQ and
// DEVICE_LSPCLK_FREQ are accurate. Some examples will not perform as
// expected if these are not correct.
//
ASSERT(SysCtl_getClock(DEVICE_OSCSRC_FREQ) == DEVICE_SYSCLK_FREQ);
ASSERT(SysCtl_getLowSpeedClock(DEVICE_OSCSRC_FREQ) == DEVICE_LSPCLK_FREQ);
//
// Give control of SPIA and GS2 to CPU2, and ePWM a secondary master to DMA
//
SysCtl_selectCPUForPeripheral(SYSCTL_CPUSEL6_SPI, 1, SYSCTL_CPUSEL_CPU2);
SysCtl_selectSecMaster(SYSCTL_SEC_MASTER_DMA, SYSCTL_SEC_MASTER_DMA);
MemCfg_setGSRAMMasterSel(MEMCFG_SECT_GS2, MEMCFG_GSRAMMASTER_CPU2);
//
// Send IPC flag to CPU2 signaling the completion of system initialization
//
HWREG(IPC_BASE + IPC_O_SET) = IPC_SET_IPC0;
//
// Turn on the required peripherals
//
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_DMA);
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
}
//
// initEPWM1 - Function to Initialize ePWM1
//
void initEPWM1(void)
{
//
// Disable sync (freeze clock to PWM as well)
//
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
//
// Set-up TBCLK
//
EPWM_setTimeBasePeriod(EPWM1_BASE, 6000);
EPWM_setPhaseShift(EPWM1_BASE, 0U);
EPWM_setTimeBaseCounter(EPWM1_BASE, 0U);
EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_UP_DOWN);
EPWM_disablePhaseShiftLoad(EPWM1_BASE);
//
// Set ePWM clock pre-scaler
//
EPWM_setClockPrescaler(EPWM1_BASE,
EPWM_CLOCK_DIVIDER_4,
EPWM_HSCLOCK_DIVIDER_4);
//
// Set up shadowing
//
EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE,
EPWM_COUNTER_COMPARE_A,
EPWM_COMP_LOAD_ON_CNTR_ZERO);
EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE,
EPWM_COUNTER_COMPARE_B,
EPWM_COMP_LOAD_ON_CNTR_ZERO);
//
// Setup compare
//
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, 3000U);
//
// Set actions
//
EPWM_setActionQualifierAction(EPWM1_BASE,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setActionQualifierAction(EPWM1_BASE,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
EPWM_setActionQualifierAction(EPWM1_BASE,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setActionQualifierAction(EPWM1_BASE,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
//
// Enable sync and clock to PWM
//
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
}
//
// setupDMA - Function to Setup DMA
//
void setupDMA(void)
{
const void *destAddr, *srcAddr;
//
// Initialize DMA
//
DMA_initController();
destAddr = (const void *)(EPWM1_BASE + EPWM_O_CMPA + 1);
srcAddr = (const void *)&newCMPValue;
//
// Setup DMA to transfer a single 16-bit word. The DMA is setup to run
// continuously so that an interrupt is not required to restart the RUN
// bit. The DMA trigger is SPIA-FFTX.
//
DMA_configAddresses(DMA_CH5_BASE, destAddr, srcAddr);
DMA_configBurst(DMA_CH5_BASE, 1, 1, 1);
DMA_configTransfer(DMA_CH5_BASE, 1, 1, 1);
DMA_configWrap(DMA_CH5_BASE, 0xFFFF, 0, 0xFFFF, 0);
DMA_configMode(DMA_CH5_BASE, DMA_TRIGGER_SPIATX, DMA_CFG_ONESHOT_ENABLE |
DMA_CFG_CONTINUOUS_ENABLE |
DMA_CFG_SIZE_16BIT);
DMA_setInterruptMode(DMA_CH5_BASE, DMA_INT_AT_END);
DMA_enableTrigger(DMA_CH5_BASE);
DMA_enableInterrupt(DMA_CH5_BASE);
DMA_startChannel(DMA_CH5_BASE);
}
//
// dmaISR - DMA Interrupt Service Routine (uncomment to enable DMA ISR)
//
#ifdef USE_DMA_INTERRUPT
__interrupt void dmaISR(void)
{
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP7);
}
#endif
//
// End of File
//
@@ -0,0 +1,371 @@
//#############################################################################
//
// FILE: dma_ex1_shared_periph_cpu2.c
//
// TITLE: DMA Transfer for Shared Peripheral Example (CPU2)
//
// This example shows how to initiate a DMA transfer on CPU1 from a shared
// peripheral which is owned by CPU2. In this specific example, a timer ISR
// is used on CPU2 to initiate a SPI transfer which will trigger the CPU1 DMA.
// CPU1's DMA will then in turn update the ePWM1 CMPA value for the PWM which
// it owns. The PWM output can be observed on the GPIO pins.
//
//#############################################################################
//
// $Release Date: $
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
//
// Globals
//
uint16_t newCMPValue;
#pragma DATA_SECTION(newCMPValue, "SHARERAMGS2");
uint16_t direction = 1;
//
// Function Prototypes
//
void Example_deviceInit(void);
void initSpi(void);
void loadBuffer(void);
void initCPUTimer(uint32_t);
void configCPUTimer(uint32_t, float, float);
__interrupt void cpuTimer1ISR(void);
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Example_deviceInit();
newCMPValue = 3000; // Set CMP value
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Wait for IPC from CPU1 confirming DMA is configured before initializing
// SPI. Note that because of the way the TXFIFO interrupt is configured a
// DMA transfer will be triggered immediately after the SPI is released
// from reset.
//
while((HWREG(IPC_BASE + IPC_O_STS) & IPC_STS_IPC1) == 0U)
{
}
//
// Configure the SPI
//
initSpi();
//
// Setup CPU Timer 1 to interrupt every 10 ms
//
initCPUTimer(CPUTIMER1_BASE);
configCPUTimer(CPUTIMER1_BASE, DEVICE_SYSCLK_FREQ, 10000);
CPUTimer_startTimer(CPUTIMER1_BASE);
//
// Interrupts that are used in this example are re-mapped to ISR functions
// found within this file.
//
Interrupt_register(INT_TIMER1, &cpuTimer1ISR);
//
// Enable CPU Timer 1 interrupt
//
Interrupt_enable(INT_TIMER1);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop indefinitely
//
for(;;)
{
NOP;
}
}
//
// Example_deviceInit function
// This example uses custom Device_init function since CPU2 owns some of the
// peripherals
//
void Example_deviceInit(void)
{
//
// Disable the watchdog
//
SysCtl_disableWatchdog();
#ifdef _FLASH
//
// Copy time critical code and flash setup code to RAM. This includes the
// following functions: InitFlash();
//
// The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart symbols
// are created by the linker. Refer to the device .cmd file.
//
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
//
// Call Flash Initialization to setup flash waitstates. This function must
// reside in RAM.
//
Flash_initModule(FLASH0CTRL_BASE, FLASH0ECC_BASE, DEVICE_FLASH_WAITSTATES);
#endif
//
// Wait for IPC flag from CPU1
//
while((HWREG(IPC_BASE + IPC_O_STS) & IPC_STS_IPC0) == 0U)
{
}
HWREG(IPC_BASE + IPC_O_ACK) = IPC_ACK_IPC0;
//
// Turn on required peripherals
//
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_SPIA);
}
//
// initSpi - Function to Setup SPI for FIFO mode
//
void initSpi(void)
{
//
// Must put SPI into reset before configuring it
//
SPI_disableModule(SPIA_BASE);
//
// SPI configuration. Use a 500kHz SPICLK and 16-bit word size.
//
SPI_setConfig(SPIA_BASE, DEVICE_LSPCLK_FREQ, SPI_PROT_POL0PHA0,
SPI_MODE_MASTER, 500000, 16);
SPI_enableLoopback(SPIA_BASE);
SPI_enableModule(SPIA_BASE);
//
// FIFO configuration
//
SPI_enableFIFO(SPIA_BASE);
SPI_clearInterruptStatus(SPIA_BASE, SPI_INT_RXFF | SPI_INT_TXFF);
SPI_setFIFOInterruptLevel(SPIA_BASE, SPI_FIFO_TX2, SPI_FIFO_RX2);
//
// A DMA transfer will be triggered here!
//
//
// Load the SPI FIFO Tx Buffer
//
loadBuffer();
//
// Disable the clock to prevent continuous transfer/DMA triggers. Note that
// this method of disabling the clock should not be used if actual data is
// being transmitted.
//
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_SPIA);
}
//
// loadBuffer - Function to load SPI Tx FIFO Buffer
//
void loadBuffer(void)
{
//
// Fill up the FIFO buffer
//
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
}
//
// initCPUTimer - This function initializes a CPU Timer to a known state.
//
void
initCPUTimer(uint32_t cpuTimer)
{
//
// Initialize timer period to maximum
//
CPUTimer_setPeriod(cpuTimer, 0xFFFFFFFF);
//
// Initialize pre-scale counter to divide by 1 (SYSCLKOUT)
//
CPUTimer_setPreScaler(cpuTimer, 0);
//
// Make sure timer is stopped
//
CPUTimer_stopTimer(cpuTimer);
//
// Reload all counter registers with period value
//
CPUTimer_reloadTimerCounter(cpuTimer);
}
//
// configCPUTimer - This function initializes the selected timer to the
// period specified by the "freq" and "period" parameters. The "freq" is
// entered as Hz and the period in microseconds. The timer is held in the
// stopped state after configuration.
//
void
configCPUTimer(uint32_t cpuTimer, float freq, float period)
{
uint32_t temp;
//
// Initialize timer period:
//
temp = (uint32_t)(freq / 1000000 * period);
CPUTimer_setPeriod(cpuTimer, temp);
//
// Set pre-scale counter to divide by 1 (SYSCLKOUT):
//
CPUTimer_setPreScaler(cpuTimer, 0);
//
// Initializes timer control register. The timer is stopped, reloaded,
// free run disabled, and interrupt enabled.
//
CPUTimer_stopTimer(cpuTimer);
CPUTimer_reloadTimerCounter(cpuTimer);
CPUTimer_setEmulationMode(cpuTimer,
CPUTIMER_EMULATIONMODE_STOPAFTERNEXTDECREMENT);
CPUTimer_enableInterrupt(cpuTimer);
}
//
// cpuTimer1ISR - CPU Timer 1 ISR
//
__interrupt void cpuTimer1ISR(void)
{
//
// Re-enable SPI clock to allow DMA trigger
//
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_SPIA);
//
// Wait for interrupt flag. This is when the DMA trigger will occur.
//
while((SPI_getInterruptStatus(SPIA_BASE) & SPI_INT_TXFF) == 0)
{
}
//
// Reload the SPI TX buffer and clear interrupt flag
//
loadBuffer();
SPI_clearInterruptStatus(SPIA_BASE, SPI_INT_TXFF);
//
// Disable the clock to prevent continuous transfer/DMA triggers. Note that
// this method of disabling the clock should not be used if actual data is
// being transmitted.
//
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_SPIA);
//
// Update next value to be transferred to the ePWM
//
if(newCMPValue >= 4500)
{
direction = 0;
}
else if(newCMPValue <= 1500)
{
direction = 1;
}
if(!direction)
{
newCMPValue -= 50;
}
else
{
newCMPValue += 50;
}
}
//
// End of File
//
@@ -0,0 +1,191 @@
//#############################################################################
//
// FILE: dma_ex2_sysconfig_cpu1.c
//
// TITLE: SysConfig DMA Transfer for Shared Peripheral Example
//
//! \addtogroup driver_dual_example_list
//! <h1> DMA Transfer Shared Peripheral </h1>
//!
//! This example shows how to initiate a DMA transfer on CPU1 from a shared
//! peripheral which is owned by CPU2. In this specific example, a timer ISR
//! is used on CPU2 to initiate a SPI transfer which will trigger the CPU1 DMA.
//! CPU1's DMA will then in turn update the ePWM1 CMPA value for the PWM which
//! it owns. The PWM output can be observed on the GPIO pins.
//!
//! \b Watch \b Pins
//! - GPIO0 and GPIO1 - ePWM output can be viewed with oscilloscope
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
#include "board.h"
//
// Defines
//
//#define USE_DMA_INTERRUPT
//
// Globals
//
uint16_t newCMPValue;
#pragma DATA_SECTION(newCMPValue, "SHARERAMGS2");
//
// Function Prototypes
//
void Example_deviceInit(void);
void initEPWM1(void);
void setupDMA(void);
#ifdef USE_DMA_INTERRUPT
__interrupt void dmaISR(void);
#endif
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Initialize SysConfig Settings
//
Board_init();
//
// Send IPC_FLAG0 from CPU1 to CPU2 to let CPU2 continue initialization
//
HWREG(IPC_BASE + IPC_O_SET) = IPC_SET_IPC0;
//
// Finish Configuring the DMA, mostly done in SysConfig
//
setupDMA();
//
// Send IPC to CPU2 telling it to proceed with configuring the SPI
//
HWREG(IPC_BASE + IPC_O_SET) = IPC_SET_IPC1;
//
// Enable DMA interrupt
//
#ifdef USE_DMA_INTERRUPT
Interrupt_enable(INT_DMA_CH5);
Interrupt_register(INT_DMA_CH5, &dmaISR);
#endif
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
uint16_t full_cycles = 0;
//
// Loop indefinitely
//
for(;;)
{
if(newCMPValue == 4500){
if(full_cycles++ > 20){
GPIO_togglePin(CPU1_LED1);
GPIO_togglePin(CPU1_LED2);
full_cycles = 0;
}
}
}
}
//
// setupDMA - Function to Setup DMA, most of DMA setup done in SysConfig
//
void setupDMA(void)
{
//
// Setup DMA to transfer a single 16-bit word. The DMA is setup to run
// continuously so that an interrupt is not required to restart the RUN
// bit. The DMA trigger is SPIA-FFTX.
//
//
// Set the source and destination addresses for the DMA transfers
//
const void *destAddr, *srcAddr;
destAddr = (const void *)(EPWM1_BASE + EPWM_O_CMPA + 1);
srcAddr = (const void *)&newCMPValue;
DMA_configAddresses(DMA_CH5_BASE, destAddr, srcAddr);
}
//
// dmaISR - DMA Interrupt Service Routine (uncomment to enable DMA ISR)
//
#ifdef USE_DMA_INTERRUPT
__interrupt void dmaISR(void)
{
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP7);
}
#endif
//
// End of File
//
@@ -0,0 +1,75 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU1" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const dma = scripting.addModule("/driverlib/dma.js", {}, false);
const dma1 = dma.addInstance();
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
const epwm1 = epwm.addInstance();
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
const gpio1 = gpio.addInstance();
const gpio2 = gpio.addInstance();
const ipc = scripting.addModule("/driverlib/ipc.js");
const memcfg = scripting.addModule("/driverlib/memcfg.js");
const sysctl = scripting.addModule("/driverlib/sysctl.js");
/**
* Write custom configuration values to the imported modules.
*/
dma1.$name = "myDMA5";
dma1.dmaBase = "DMA_CH5_BASE";
dma1.enableTriggers = true;
dma1.triggerSource = "DMA_TRIGGER_SPIATX";
dma1.useInterrupts = true;
dma1.enableInterrupts = true;
dma1.interruptMode = "DMA_INT_AT_END";
dma1.oneShotConfig = "DMA_CFG_ONESHOT_ENABLE";
dma1.continuousModeConfig = "DMA_CFG_CONTINUOUS_ENABLE";
dma1.startChannel = true;
dma1.srcBurstStep = 1;
dma1.srcTransferStep = 1;
dma1.destBurstStep = 1;
dma1.destTransferStep = 1;
epwm1.$name = "myEPWM0";
epwm1.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
epwm1.epwmTimebase_period = 6000;
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
epwm1.epwmTimebase_syncOutPulseMode = "EPWM_SYNC_OUT_PULSE_DISABLED";
epwm1.epwmCounterCompare_cmpA = 3000;
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW";
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_HIGH";
epwm1.epwm.$assign = "EPWM1";
gpio1.direction = "GPIO_DIR_MODE_OUT";
gpio1.$name = "CPU1_LED1";
gpio1.gpioPin.$assign = "GPIO31";
gpio2.$name = "CPU1_LED2";
gpio2.direction = "GPIO_DIR_MODE_OUT";
gpio2.gpioPin.$assign = "GPIO34";
memcfg.config_MEMCFG_SECT_GS2 = "MEMCFG_GSRAMCONTROLLER_CPU2";
sysctl.enable_SYSCTL_PERIPH_CLK_TBCLKSYNC = true;
sysctl.cpuSel_SPIC = "SYSCTL_CPUSEL_CPU2";
sysctl.secMasterFrame1 = "SYSCTL_SEC_CONTROLLER_DMA";
sysctl.cpuSel_SPIA = "SYSCTL_CPUSEL_CPU2";
sysctl.secMasterFrame2 = "SYSCTL_SEC_CONTROLLER_DMA";
/**
* Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
* re-solve from scratch.
*/
epwm1.epwm.epwm_aPin.$suggestSolution = "GPIO0";
epwm1.epwm.epwm_bPin.$suggestSolution = "GPIO1";
@@ -0,0 +1,273 @@
//#############################################################################
//
// FILE: dma_ex2_sysconfig_cpu2.c
//
// TITLE: SysConfig DMA Transfer for Shared Peripheral Example (CPU2)
//
// This example shows how to initiate a DMA transfer on CPU1 from a shared
// peripheral which is owned by CPU2. In this specific example, a timer ISR
// is used on CPU2 to initiate a SPI transfer which will trigger the CPU1 DMA.
// CPU1's DMA will then in turn update the ePWM1 CMPA value for the PWM which
// it owns. The PWM output can be observed on the GPIO pins.
//
//#############################################################################
//
// $Release Date: $
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
#include "board.h"
//
// Globals
//
uint16_t newCMPValue;
#pragma DATA_SECTION(newCMPValue, "SHARERAMGS2");
uint16_t direction = 1;
//
// Function Prototypes
//
void Example_deviceInit(void);
void initSpi(void);
void loadBuffer(void);
void initCPUTimer(uint32_t);
void configCPUTimer(uint32_t, float, float);
__interrupt void cpuTimer1ISR(void);
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Wait for IPC flag from CPU1
//
while((HWREG(IPC_BASE + IPC_O_STS) & IPC_STS_IPC0) == 0U)
{
}
HWREG(IPC_BASE + IPC_O_ACK) = IPC_ACK_IPC0;
newCMPValue = 3000; // Set CMP value
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Initialize settings from SysConfig
//
Board_init();
//
// Wait for IPC from CPU1 confirming DMA is configured before initializing
// SPI. Note that because of the way the TXFIFO interrupt is configured a
// DMA transfer will be triggered immediately after the SPI is released
// from reset.
//
while((HWREG(IPC_BASE + IPC_O_STS) & IPC_STS_IPC1) == 0U)
{
}
//
// Fill up SPI buffer
//
loadBuffer();
//
// Setup CPU Timer 1 to interrupt every 10 ms
//
configCPUTimer(CPUTIMER1_BASE, DEVICE_SYSCLK_FREQ, 10000);
CPUTimer_startTimer(CPUTIMER1_BASE);
//
// Interrupts that are used in this example are re-mapped to ISR functions
// found within this file.
//
Interrupt_register(INT_TIMER1, &cpuTimer1ISR);
//
// Enable CPU Timer 1 interrupt
//
Interrupt_enable(INT_TIMER1);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop indefinitely
//
for(;;)
{
NOP;
}
}
//
// loadBuffer - Function to load SPI Tx FIFO Buffer
//
void loadBuffer(void)
{
//
// Fill up the FIFO buffer
//
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
HWREGH(SPIA_BASE + SPI_O_TXBUF) = 0xAAAA;
}
//
// configCPUTimer - This function initializes the selected timer to the
// period specified by the "freq" and "period" parameters. The "freq" is
// entered as Hz and the period in microseconds. The timer is held in the
// stopped state after configuration.
//
void
configCPUTimer(uint32_t cpuTimer, float freq, float period)
{
uint32_t temp;
//
// Initialize timer period:
//
temp = (uint32_t)(freq / 1000000 * period);
CPUTimer_setPeriod(cpuTimer, temp);
//
// Set pre-scale counter to divide by 1 (SYSCLKOUT):
//
CPUTimer_setPreScaler(cpuTimer, 0);
//
// Initializes timer control register. The timer is stopped, reloaded,
// free run disabled, and interrupt enabled.
//
CPUTimer_stopTimer(cpuTimer);
CPUTimer_reloadTimerCounter(cpuTimer);
CPUTimer_setEmulationMode(cpuTimer,
CPUTIMER_EMULATIONMODE_STOPAFTERNEXTDECREMENT);
CPUTimer_enableInterrupt(cpuTimer);
}
//
// cpuTimer1ISR - CPU Timer 1 ISR
//
__interrupt void cpuTimer1ISR(void)
{
//
// Re-enable SPI clock to allow DMA trigger
//
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_SPIA);
//
// Wait for interrupt flag. This is when the DMA trigger will occur.
//
while((SPI_getInterruptStatus(SPIA_BASE) & SPI_INT_TXFF) == 0)
{
}
//
// Reload the SPI TX buffer and clear interrupt flag
//
loadBuffer();
SPI_clearInterruptStatus(SPIA_BASE, SPI_INT_TXFF);
//
// Disable the clock to prevent continuous transfer/DMA triggers. Note that
// this method of disabling the clock should not be used if actual data is
// being transmitted.
//
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_SPIA);
//
// Update next value to be transferred to the ePWM
//
if(newCMPValue >= 4500)
{
direction = 0;
}
else if(newCMPValue <= 1500)
{
direction = 1;
}
if(!direction)
{
newCMPValue -= 50;
}
else
{
newCMPValue += 50;
}
}
//
// End of File
//
@@ -0,0 +1,43 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU2" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const cputimer = scripting.addModule("/driverlib/cputimer.js", {}, false);
const cputimer1 = cputimer.addInstance();
const ipc = scripting.addModule("/driverlib/ipc.js");
const spi = scripting.addModule("/driverlib/spi.js", {}, false);
const spi1 = spi.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
cputimer1.timerPeriod = 4294967295;
cputimer1.enableInterrupt = true;
cputimer1.cputimerBase = "CPUTIMER1_BASE";
cputimer1.$name = "myCPUTIMER1";
spi1.$name = "mySPI0";
spi1.mode = "SPI_MODE_CONTROLLER";
spi1.emulationMode = "SPI_EMULATION_STOP_AFTER_TRANSMIT";
spi1.bitRate = 500000;
spi1.txFifo = "SPI_FIFO_TX2";
spi1.rxFifo = "SPI_FIFO_RX2";
spi1.loopback = true;
spi1.enabledFIFOInterrupts = ["SPI_INT_RXFF","SPI_INT_TXFF"];
/**
* Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
* re-solve from scratch.
*/
spi1.spi.$suggestSolution = "SPIA";
spi1.spi.spi_picoPin.$suggestSolution = "GPIO16";
spi1.spi.spi_pociPin.$suggestSolution = "GPIO17";
spi1.spi.spi_clkPin.$suggestSolution = "GPIO18";
spi1.spi.spi_ptePin.$suggestSolution = "GPIO19";
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<system>
<project configuration="@match" id="project_0" name="dma_ex2_sysconfig_cpu1">
</project>
<core id="C28xx_CPU1" project="project_0"/>
<project configuration="@match" id="project_1" name="dma_ex2_sysconfig_cpu2">
</project>
<core id="C28xx_CPU2" project="project_1"/>
<preBuildSteps>
</preBuildSteps>
<postBuildSteps>
</postBuildSteps>
</system>
@@ -0,0 +1,44 @@
<projectSpec>
<project
name="emif_ex1_16bit_asram_dual_access_cpu1"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../emif_ex1_16bit_asram_dual_access_cpu1.c" targetDirectory="" />
</project>
<project
name="emif_ex1_16bit_asram_dual_access_cpu2"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../emif_ex1_16bit_asram_dual_access_cpu2.c" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,300 @@
//#############################################################################
//
// FILE: emif_ex1_16bit_asram_dual_access_cpu1.c
//
// TITLE: EMIF1 ASYNC module accessing 16bit ASRAM through CPU1 and CPU2.
//
//! \addtogroup driver_example_list
//! <h1> EMIF1 ASYNC module accessing 16bit ASRAM through CPU1 and CPU2. </h1>
//!
//! This example configures EMIF1 in 16bit ASYNC mode and uses CS2 as chip
//! enable. The EMIF1 ownership is passed between CPU1 and CPU2 to access
//! different memory regions. Initially CPU2 grabs and configures the EMIF1,
//! thereafter both CPU1 and CPU2 grabs EMIF1 to access different memory regions
//! in external memory.
//!
//! \b External \b Connections \n
//! - External ASRAM memory (CY7C1041CV33 -10ZSXA) daughter card
//!
//! \b Watch \b Variables \n
//! - \b testStatusGlobalCPU1 - Equivalent to \b TEST_PASS if test finished
//! correctly, else the value is set to \b TEST_FAIL
//! - \b errCountGlobalCPU1 - Error counter
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
//
// Defines
//
#define TEST_PASS 0xABCDABCDU
#define TEST_FAIL 0xDEADDEADU
//
// Defines for external memory addresses to be be accessed. The ASRAM memory
// size used for this example is 256K x 16. CPU1 accesses upper 128K x 16
// memory range.
//
#define ASRAM_CS2_START_ADDR_CPU1 0x120000U
#define ASRAM_CS2_SIZE 0x20000U
//
// Define for memory R/W iterations
//
#define MEM_RW_ITER 0x2U
//
// Globals
//
uint16_t errCountGlobalCPU1 = 0U;
uint32_t testStatusGlobalCPU1;
uint32_t i, iter;
//
// Function Prototypes
//
void setupEMIF1Pinmux256KAsync16Bit(void);
uint16_t readWriteMemCPU1(uint32_t startAddr, uint32_t memSize);
//
// Main
//
void main(void)
{
uint16_t errCountLocal;
uint16_t ipcFlag11 = 11U;
testStatusGlobalCPU1 = TEST_FAIL;
//
// Initialize device clock and peripherals.
//
Device_init();
//
// Disable all the interrupts.
//
DINT;
//
// Setup GPIO by disabling pin locks and enabling pullups.
//
Device_initGPIO();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Configure EMIF1 Pins.
//
setupEMIF1Pinmux256KAsync16Bit();
//
// Wait until CPU2 is ready and IPC flag 11 is set.
//
while(!(HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag11)))
{
}
for(iter = 0; iter < MEM_RW_ITER; iter++)
{
//
// Grab EMIF1 for CPU1.
//
while(HWREGH(EMIF1CONFIG_BASE + MEMCFG_O_EMIF1MSEL) !=
EMIF_MASTER_CPU1_G)
{
EMIF_selectMaster(EMIF1CONFIG_BASE, EMIF_MASTER_CPU1_G);
}
//
// Check basic RD/WR access to CS2 space.
//
errCountLocal = readWriteMemCPU1(ASRAM_CS2_START_ADDR_CPU1,
ASRAM_CS2_SIZE);
errCountGlobalCPU1 = errCountGlobalCPU1 + errCountLocal;
//
// Release EMI1.
//
EMIF_selectMaster(EMIF1CONFIG_BASE, EMIF_MASTER_CPU1_NG);
}
if(errCountGlobalCPU1 == 0x0U)
{
testStatusGlobalCPU1 = TEST_PASS;
}
else
{
testStatusGlobalCPU1 = TEST_FAIL;
}
while(1);
}
//
// Setup EMIF1 Pinmux 256K Async 16Bit - This function configures pins
// for 16-bit 256x16 size Asynchronous EMIF1.
//
void setupEMIF1Pinmux256KAsync16Bit(void)
{
uint16_t i;
//
// Selecting control pins.
//
GPIO_setPinConfig(GPIO_34_EM1CS2N);
GPIO_setPinConfig(GPIO_31_EM1WEN);
GPIO_setPinConfig(GPIO_37_EM1OEN);
GPIO_setPinConfig(GPIO_36_EM1WAIT);
GPIO_setPinConfig(GPIO_33_EM1RNW);
//
// Selecting 18 address lines.
//
GPIO_setPinConfig(GPIO_92_EM1BA1);
GPIO_setPinConfig(GPIO_38_EM1A0);
GPIO_setPinConfig(GPIO_39_EM1A1);
GPIO_setPinConfig(GPIO_40_EM1A2);
GPIO_setPinConfig(GPIO_41_EM1A3);
GPIO_setPinConfig(GPIO_44_EM1A4);
GPIO_setPinConfig(GPIO_45_EM1A5);
GPIO_setPinConfig(GPIO_46_EM1A6);
GPIO_setPinConfig(GPIO_47_EM1A7);
GPIO_setPinConfig(GPIO_48_EM1A8);
GPIO_setPinConfig(GPIO_49_EM1A9);
GPIO_setPinConfig(GPIO_50_EM1A10);
GPIO_setPinConfig(GPIO_51_EM1A11);
GPIO_setPinConfig(GPIO_52_EM1A12);
GPIO_setPinConfig(GPIO_86_EM1A13);
GPIO_setPinConfig(GPIO_87_EM1A14);
GPIO_setPinConfig(GPIO_88_EM1A15);
GPIO_setPinConfig(GPIO_89_EM1A16);
//
// Selecting 16 data lines.
//
GPIO_setPinConfig(GPIO_69_EM1D15);
GPIO_setPinConfig(GPIO_70_EM1D14);
GPIO_setPinConfig(GPIO_71_EM1D13);
GPIO_setPinConfig(GPIO_72_EM1D12);
GPIO_setPinConfig(GPIO_73_EM1D11);
GPIO_setPinConfig(GPIO_74_EM1D10);
GPIO_setPinConfig(GPIO_75_EM1D9);
GPIO_setPinConfig(GPIO_76_EM1D8);
GPIO_setPinConfig(GPIO_77_EM1D7);
GPIO_setPinConfig(GPIO_78_EM1D6);
GPIO_setPinConfig(GPIO_79_EM1D5);
GPIO_setPinConfig(GPIO_80_EM1D4);
GPIO_setPinConfig(GPIO_81_EM1D3);
GPIO_setPinConfig(GPIO_82_EM1D2);
GPIO_setPinConfig(GPIO_83_EM1D1);
GPIO_setPinConfig(GPIO_85_EM1D0);
//
// Setup async mode and enable pull-ups for Data pins.
//
for(i=69; i<=85;i++)
{
if(i != 84)
{
GPIO_setPadConfig(i, GPIO_PIN_TYPE_PULLUP);
GPIO_setQualificationMode(i, GPIO_QUAL_ASYNC);
}
}
}
//
// Read Write Memory - This function performs simple read/write word accesses
// to memory.
//
uint16_t readWriteMemCPU1(uint32_t startAddr, uint32_t memSize)
{
static uint16_t iterCnt = 0;
uint16_t memReadData;
uint16_t memWriteData;
uint16_t *memPtr;
uint32_t i;
iterCnt++;
memPtr = (uint16_t *)startAddr;
//
// Write data to memory.
//
memWriteData = 0x0101U;
for(i = 0U; i < memSize; i++)
{
*memPtr++ = memWriteData;
memWriteData += (0x0001U + iterCnt);
}
//
// Verify data written to memory.
//
memWriteData = 0x0101U;
memPtr = (uint16_t *)startAddr;
for(i = 0U; i < memSize; i++)
{
memReadData = *memPtr;
if(memReadData != memWriteData)
{
return(1U);
}
memPtr++;
memWriteData += (0x0001U + iterCnt);
}
return(0U);
}
//
// End of File
//
@@ -0,0 +1,256 @@
//#############################################################################
//
// FILE: emif_ex1_16bit_asram_dual_access_cpu2.c
//
// TITLE: EMIF1 ASYNC module accessing 16bit ASRAM through CPU1 and CPU2.
//
//! \addtogroup driver_example_list
//! <h1> EMIF1 ASYNC module accessing 16bit ASRAM trhough CPU1 and CPU2. </h1>
//!
//! This example configures EMIF1 in 16bit ASYNC mode and uses CS2 as chip
//! enable. The EMIF1 ownership is passed between CPU1 and CPU2 to access
//! different memory regions. Initially CPU2 grabs and configures the EMIF1,
//! thereafter both CPU1 and CPU2 grabs EMIF1 to access different memory regions
//! in external memory.
//!
//! \b External \b Connections \n
//! - External ASRAM memory (CY7C1041CV33 -10ZSXA) daughter card
//!
//! \b Watch \b Variables \n
//! - \b testStatusGlobalCPU2 - Equivalent to \b TEST_PASS if test finished
//! correctly, else the value is set to \b TEST_FAIL
//! - \b errCountGlobalCPU2 - Error counter
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
//
// Defines
//
#define TEST_PASS 0xABCDABCDU
#define TEST_FAIL 0xDEADDEADU
//
// Defines for external memory addresses to be be accessed. The ASRAM memory
// size used for this example is 256K x 16. CPU2 accesses lower 128K x 16
// memory range.
//
#define ASRAM_CS2_START_ADDR_CPU2 0x100000U
#define ASRAM_CS2_SIZE 0x20000U
//
// Define for memory R/W iterations
//
#define MEM_RW_ITER 0x2U
//
// Globals
//
uint16_t errCountGlobalCPU2 = 0U;
uint32_t testStatusGlobalCPU2;
uint32_t i, iter;
//
// Function Prototypes
//
uint16_t readWriteMemCPU2(uint32_t startAddr, uint32_t memSize);
//
// Main
//
void main(void)
{
uint16_t errCountLocal;
EMIF_AsyncTimingParams tparam;
uint16_t ipcFlag11 = 11U;
testStatusGlobalCPU2 = TEST_FAIL;
//
// Initialize device clock and peripherals.
//
Device_init();
//
// Disable all the interrupts.
//
DINT;
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Grab EMIF1 For CPU2.
//
EMIF_selectMaster(EMIF1CONFIG_BASE, EMIF_MASTER_CPU2_G);
//
// Configure to run EMIF1 on full Rate. (EMIF1CLK = CPU1SYSCLK)
//
SysCtl_setEMIF1ClockDivider(SYSCTL_EMIF1CLK_DIV_1);
//
// Configures Normal Asynchronous Mode of Operation.
//
EMIF_setAsyncMode(EMIF1_BASE, EMIF_ASYNC_CS2_OFFSET,
EMIF_ASYNC_NORMAL_MODE);
//
// Disables Extended Wait Mode.
//
EMIF_disableAsyncExtendedWait(EMIF1_BASE, EMIF_ASYNC_CS2_OFFSET);
//
// Configure EMIF1 Data Bus Width.
//
EMIF_setAsyncDataBusWidth(EMIF1_BASE, EMIF_ASYNC_CS2_OFFSET,
EMIF_ASYNC_DATA_WIDTH_16);
//
// Configure the access timing for CS2 space.
//
tparam.rSetup = 0;
tparam.rStrobe = 3;
tparam.rHold = 0;
tparam.turnArnd = 0;
tparam.wSetup = 0;
tparam.wStrobe = 1;
tparam.wHold = 0;
EMIF_setAsyncTimingParams(EMIF1_BASE, EMIF_ASYNC_CS2_OFFSET, &tparam);
EMIF_selectMaster(EMIF1CONFIG_BASE, EMIF_MASTER_CPU1_NG);
//
// Sync CPU1 and CPU2. Send IPC flag 11 to CPU1.
//
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag11;
for(iter = 0; iter < MEM_RW_ITER; iter++)
{
//
// Grab EMIF1 For CPU2.
//
while(HWREGH(EMIF1CONFIG_BASE + MEMCFG_O_EMIF1MSEL) !=
EMIF_MASTER_CPU2_G)
{
EMIF_selectMaster(EMIF1CONFIG_BASE, EMIF_MASTER_CPU2_G);
}
//
// Check basic RD/WR access to CS2 space.
//
errCountLocal = readWriteMemCPU2(ASRAM_CS2_START_ADDR_CPU2,
ASRAM_CS2_SIZE);
errCountGlobalCPU2 = errCountGlobalCPU2 + errCountLocal;
//
// Release EMIF1.
//
EMIF_selectMaster(EMIF1CONFIG_BASE, EMIF_MASTER_CPU1_NG);
}
if(errCountGlobalCPU2 == 0x0U)
{
testStatusGlobalCPU2 = TEST_PASS;
}
else
{
testStatusGlobalCPU2 = TEST_FAIL;
}
while(1);
}
//
// Read Write Memory - This function performs simple read/write word accesses
// to memory.
//
uint16_t readWriteMemCPU2(uint32_t startAddr, uint32_t memSize)
{
static uint16_t iterCnt = 0;
uint16_t memReadData;
uint16_t memWriteData;
uint16_t *memPtr;
uint32_t i;
iterCnt++;
memPtr = (uint16_t *)startAddr;
//
// Write data to memory.
//
memWriteData = 0x1111U;
for(i = 0U; i < memSize; i++)
{
*memPtr++ = memWriteData;
memWriteData += (0x1111U + iterCnt);
}
//
// Verify data written to memory.
//
memWriteData = 0x1111U;
memPtr = (uint16_t *)startAddr;
for(i = 0U; i < memSize; i++)
{
memReadData = *memPtr;
if(memReadData != memWriteData)
{
return(1U);
}
memPtr++;
memWriteData += (0x1111U + iterCnt);
}
return(0U);
}
//
// End of File
//
@@ -0,0 +1,48 @@
<projectSpec>
<project
name="empty_driverlib_project_cpu1"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --define=DEBUG --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --define=_FLASH --define=DEBUG --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib" targetDirectory="device" excludeFromBuild="True"/>
<file action="copy" path="../empty_driverlib_main_cpu1.c" targetDirectory="" />
</project>
<project
name="empty_driverlib_project_cpu2"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --define=DEBUG --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU2_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --define=_FLASH --define=DEBUG --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU2_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU2_FLASH" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib" targetDirectory="device" excludeFromBuild="True"/>
<file action="copy" path="../empty_driverlib_main_cpu2.c" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,71 @@
<projectSpec>
<project
name="empty_sysconfig_multi"
configurations="
FLASH,
RAM,
"
device="TMS320F28377D"
outputType="system"
cgtVersion="20.2.1.LTS"
>
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<file path="../system.xml" action="copy" openOnCreation="true"/>
<configuration name="FLASH"
></configuration>
<configuration name="RAM"
></configuration>
</project>
<project
name="empty_sysconfig_cpu1"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2837xD --context CPU1"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="FLASH" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="RAM" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../empty_sysconfig_cpu1.c" targetDirectory="" />
<file action="copy" path="../empty_sysconfig_cpu1.syscfg" targetDirectory="" />
</project>
<project
name="empty_sysconfig_cpu2"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2837xD --context CPU2"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_FLASH_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="FLASH" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_RAM_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="RAM" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../empty_sysconfig_cpu2.c" targetDirectory="" />
<file action="copy" path="../empty_sysconfig_cpu2.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,63 @@
//#############################################################################
//
// FILE: empty_driverlib_main_cpu1.c
//
// TITLE: Empty Project
//
// CPU1 Empty Project Example
//
// This example is an empty project setup for Driverlib development for CPU1.
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
//
// Main
//
void main(void)
{
}
//
// End of File
//
@@ -0,0 +1,63 @@
//#############################################################################
//
// FILE: empty_driverlib_main_cpu2.c
//
// TITLE: Empty Project
//
// CPU2 Empty Project Example
//
// This example is an empty project setup for Driverlib development for CPU2.
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
//
// Main
//
void main(void)
{
}
//
// End of File
//
@@ -0,0 +1,63 @@
//#############################################################################
//
// FILE: empty_sysconfig_cpu1.c
//
// TITLE: SysConfig Empty Project
//
// CPU1 Empty Project Example
//
// This example is an empty project setup for SysConfig development for CPU1.
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
//
// Main
//
void main(void)
{
}
//
// End of File
//
@@ -0,0 +1,6 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU1" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
@@ -0,0 +1,63 @@
//#############################################################################
//
// FILE: empty_sysconfig_cpu2.c
//
// TITLE: SysConfig Empty Project
//
// CPU2 Empty Project Example
//
// This example is an empty project setup for Driverlib development for CPU2.
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
//
// Main
//
void main(void)
{
}
//
// End of File
//
@@ -0,0 +1,6 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU1" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<system>
<project configuration="@match" id="project_0" name="empty_sysconfig_cpu1">
</project>
<core id="C28xx_CPU1" project="project_0"/>
<project configuration="@match" id="project_1" name="empty_sysconfig_cpu2">
</project>
<core id="C28xx_CPU2" project="project_1"/>
<preBuildSteps>
</preBuildSteps>
<postBuildSteps>
</postBuildSteps>
</system>
@@ -0,0 +1,48 @@
<projectSpec>
<project
name="ipc_ex1_gpio_toggle_cpu1"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../ipc_ex1_gpio_toggle_cpu1.c" targetDirectory="" />
</project>
<project
name="ipc_ex1_gpio_toggle_cpu2"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU2_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU2_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU2_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../ipc_ex1_gpio_toggle_cpu2.c" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,67 @@
<projectSpec>
<project
name="ipc_ex2_gpio_sysconfig_multi"
configurations="
FLASH,
RAM,
"
device="TMS320F28377D"
outputType="system"
cgtVersion="20.2.1.LTS"
>
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<file path="../system.xml" action="copy" openOnCreation="true"/>
<configuration name="FLASH"
></configuration>
<configuration name="RAM"
></configuration>
</project>
<project
name="ipc_ex2_gpio_sysconfig_cpu1"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../ipc_ex2_gpio_sysconfig_cpu1.c" targetDirectory="" />
<file action="copy" path="../ipc_ex2_gpio_sysconfig_cpu1.syscfg" targetDirectory="" />
</project>
<project
name="ipc_ex2_gpio_sysconfig_cpu2"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../ipc_ex2_gpio_sysconfig_cpu2.c" targetDirectory="" />
<file action="copy" path="../ipc_ex2_gpio_sysconfig_cpu2.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,67 @@
<projectSpec>
<project
name="ipc_ex3_basic_sysconfig_multi"
configurations="
FLASH,
RAM,
"
device="TMS320F28377D"
outputType="system"
cgtVersion="20.2.1.LTS"
>
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<file path="../system/system_ex3/system.xml" action="copy" openOnCreation="true"/>
<configuration name="FLASH"
></configuration>
<configuration name="RAM"
></configuration>
</project>
<project
name="ipc_ex3_basic_sysconfig_c28x1"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2837xD --context CPU1"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../ipc_ex3_basic_sysconfig_c28x1.c" targetDirectory="" />
<file action="copy" path="../ipc_ex3_basic_sysconfig_c28x1.syscfg" targetDirectory="" />
</project>
<project
name="ipc_ex3_basic_sysconfig_c28x2"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2837xD --context CPU2"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../ipc_ex3_basic_sysconfig_c28x2.c" targetDirectory="" />
<file action="copy" path="../ipc_ex3_basic_sysconfig_c28x2.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,67 @@
<projectSpec>
<project
name="ipc_ex4_msgqueue_sysconfig_multi"
configurations="
FLASH,
RAM,
"
device="TMS320F28377D"
outputType="system"
cgtVersion="20.2.1.LTS"
>
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<file path="../system/system_ex4/system.xml" action="copy" openOnCreation="true"/>
<configuration name="FLASH"
></configuration>
<configuration name="RAM"
></configuration>
</project>
<project
name="ipc_ex4_msgqueue_sysconfig_c28x1"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2837xD --context CPU1"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../ipc_ex4_msgqueue_sysconfig_c28x1.c" targetDirectory="" />
<file action="copy" path="../ipc_ex4_msgqueue_sysconfig_c28x1.syscfg" targetDirectory="" />
</project>
<project
name="ipc_ex4_msgqueue_sysconfig_c28x2"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2837xD --context CPU2"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../ipc_ex4_msgqueue_sysconfig_c28x2.c" targetDirectory="" />
<file action="copy" path="../ipc_ex4_msgqueue_sysconfig_c28x2.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,249 @@
//###########################################################################
//
// FILE: ipc_ex1_gpio_toggle_cpu1.c
//
// TITLE: GPIO Toggle for F2837xD CPU1.
//
//! \addtogroup dual_example_list
//! <h1> IPC GPIO toggle </h1>
//!
//! This example shows GPIO input on the local CPU triggering an output on the
//! remote CPU. A GPIO input change on CPU01 causes an output change on CPU02
//! and vice versa. \n
//! CPU1 has control of GPIO31 , GPIO15 and GPIO14.\n
//! CPU2 has control of GPIO34 , GPIO10 and GPIO11.\n
//!
//! The IPC is used to signal a change on the CPU's input pin.\n
//!
//! \b Hardware \b Connections
//! - connect GPIO15 to GPIO11
//! - connect GPIO14 to GPIO10
//!
//! \b Watch \b Pins
//! - GPIO34 - output on CPU2
//! - GPIO11 - input on CPU2
//! - GPIO31 - output on CPU1
//! - GPIO14 - input on CPU1
//! - GPIO10 - square wave output on CPU02
//! - GPIO15 - square wave output on CPU01
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
//
// Main
//
void main(void)
{
uint16_t state;
uint32_t count;
uint16_t ipcFlag17 = 17U;
uint16_t ipcFlag10 = 10U;
uint16_t ipcFlag11 = 11U;
//
// Initialize device clock and peripherals
//
Device_init();
#ifdef _STANDALONE
#ifdef _FLASH
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
#else
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_RAM);
#endif // _FLASH
#endif // _STANDALONE
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
Device_initGPIO();
//
// GPIO34 (LED2) is assigned to CPU2 and is an output pin.
//
GPIO_setPadConfig(DEVICE_GPIO_PIN_LED2, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED2, GPIO_DIR_MODE_OUT);
GPIO_setMasterCore(DEVICE_GPIO_PIN_LED2, GPIO_CORE_CPU2);
//
// GPIO10 is assigned to CPU2 and is an output pin.
//
GPIO_setPadConfig(10UL, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(10UL, GPIO_DIR_MODE_OUT);
GPIO_setMasterCore(10UL, GPIO_CORE_CPU2);
//
// GPIO11 is assigned to CPU2 and is an input pin.
//
GPIO_setPadConfig(11UL, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(11UL, GPIO_DIR_MODE_IN);
GPIO_setMasterCore(11UL, GPIO_CORE_CPU2);
//
// GPIO31 (LED2) is assigned to CPU1 and is an output pin.
//
GPIO_setPadConfig(DEVICE_GPIO_PIN_LED1, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED1, GPIO_DIR_MODE_OUT);
GPIO_setMasterCore(DEVICE_GPIO_PIN_LED1, GPIO_CORE_CPU1);
//
// GPIO15 is assigned to CPU1 and is an output pin.
//
GPIO_setPadConfig(15UL, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(15UL, GPIO_DIR_MODE_OUT);
GPIO_setMasterCore(15UL, GPIO_CORE_CPU1);
//
// GPIO14 is assigned to CPU1 and is an input pin.
//
GPIO_setPadConfig(14UL, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(14UL, GPIO_DIR_MODE_IN);
GPIO_setMasterCore(14UL, GPIO_CORE_CPU1);
//
// Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
//
DINT;
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Wait until CPU02 is ready and IPC flag 17 is set
//
while(!(HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag17)))
{
}
//
// ACK IPC flag 17 for CPU2
//
HWREG(IPC_BASE + IPC_O_ACK) = 1UL << ipcFlag17;
//
// Set the state to the DAT value of GPIO14
//
state = GPIO_readPin(14UL);
while(1)
{
//
// Generate a Square Wave on GPIO15. This signal will be used to drive
// GPIO11 input on CPU2
//
if(count++ > 1000000)
{
count = 0;
//
// Toggle GPIO15
//
GPIO_togglePin(15UL);
}
//
// Set Flag 10 when GPIO14 input changes
//
if(GPIO_readPin(14UL) != state)
{
state = GPIO_readPin(14UL);
if(!(HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag10)))
{
//
// Send IPC flag 10 to CPU2
//
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag10;
}
}
//
// Toggle GPIO31 output if Flag 11 is set by CPU2
//
if((HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag11)))
{
//
// Toggle GPIO31 (LED1)
//
GPIO_togglePin(DEVICE_GPIO_PIN_LED1);
//
// ACK IPC flag 11 for CPU2
//
HWREG(IPC_BASE + IPC_O_ACK) = 1UL << ipcFlag11;
//
// Clear IPC flag 11 for CPU2
//
HWREG(IPC_BASE + IPC_O_CLR) = 1UL << ipcFlag11;
}
}
}
//
// End of file
//
@@ -0,0 +1,180 @@
//###########################################################################
//
// FILE: ipc_gpio_toggle_cpu02.c
//
// TITLE: IPC GPIO Toggle for F2837xD CPU2.
//
// This example shows GPIO input on the local CPU triggering an output on the
// remote CPU. A GPIO input change on CPU01 causes an output change on CPU02
// and vice versa.
// CPU1 has control of GPIO31 , GPIO15 and GPIO14.
// CPU2 has control of GPIO34 , GPIO10 and GPIO11.
//
// The IPC is used to signal a change on the CPU's input pin.
//
// \b Hardware \b Connections
// - connect GPIO15 to GPIO11
// - connect GPIO14 to GPIO10
//
// \b Watch \b Pins
// - GPIO34 - output on CPU2
// - GPIO11 - input on CPU2
// - GPIO31 - output on CPU1
// - GPIO14 - input on CPU1
// - GPIO10 - square wave output on CPU02
// - GPIO15 - square wave output on CPU01
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
//
// Main
//
void main(void)
{
uint32_t count;
uint16_t state;
uint16_t ipcFlag17 = 17U;
uint16_t ipcFlag10 = 10U;
uint16_t ipcFlag11 = 11U;
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
// This is configured by CPU1
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Send IPC flag 5 to CPU2
//
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag17;
//
// Set the state to the DAT value of GPIO11
//
state = GPIO_readPin(11UL);
//
// Toggle GPIO10
//
GPIO_togglePin(10UL);
while(1)
{
//
// Produce a Square Wave on GPIO10. This signal will be used to drive
// GPIO14 input on CPU1
//
if(count++ > 2000000)
{
count = 0;
//
// Toggle GPIO10
//
GPIO_togglePin(10UL);
}
//
// Set Flag 11 when GPIO11 input changes
//
if(GPIO_readPin(11UL) != state)
{
state = GPIO_readPin(11UL);
if(!(HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag11)))
{
//
// Send IPC flag 11 to CPU2
//
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag11;
}
}
//
// Toggle GPIO34 output if Flag 10 is set by CPU1
//
if((HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag10)))
{
//
// Toggle GPIO34 (LED2)
//
GPIO_togglePin(DEVICE_GPIO_PIN_LED2);
//
// ACK IPC flag 11 for CPU2
//
HWREG(IPC_BASE + IPC_O_ACK) = 1UL << ipcFlag10;
//
// Clear IPC flag 11 for CPU2
//
HWREG(IPC_BASE + IPC_O_CLR) = 1UL << ipcFlag10;
}
}
}
//
// End of file
//
@@ -0,0 +1,180 @@
//###########################################################################
//
// FILE: ipc_ex2_sysconfig_cpu1.c
//
// TITLE: SysConfig GPIO Toggle for F2837xD CPU1.
//
//! \addtogroup dual_example_list
//! <h1> IPC GPIO toggle </h1>
//!
//! This example shows GPIO input on the local CPU triggering an output on the
//! remote CPU. A GPIO input change on CPU01 causes an output change on CPU02
//! and vice versa. \n
//! CPU1 has control of GPIO31 , GPIO15 and GPIO14.\n
//! CPU2 has control of GPIO34 , GPIO10 and GPIO11.\n
//!
//! The IPC is used to signal a change on the CPU's input pin.\n
//!
//! \b Hardware \b Connections
//! - connect GPIO15 to GPIO11
//! - connect GPIO14 to GPIO10
//!
//! \b Watch \b Pins
//! - GPIO34 - output on CPU2
//! - GPIO11 - input on CPU2
//! - GPIO31 - output on CPU1
//! - GPIO14 - input on CPU1
//! - GPIO10 - square wave output on CPU02
//! - GPIO15 - square wave output on CPU01
//
//#############################################################################
// $TI Release: $
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Main
//
void main(void)
{
uint16_t state;
uint32_t count;
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
Device_initGPIO();
//
// Initialize settings from SysConfig
//
Board_init();
//
// Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
//
DINT;
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Sync the CPUs
//
IPC_sync(IPC_CPU1_L_CPU2_R, IPC_FLAG31);
//
// Set the state to the DAT value of GPIO14
//
state = GPIO_readPin(myGPIO14);
while(1)
{
//
// Generate a Square Wave on GPIO15. This signal will be used to drive
// GPIO11 input on CPU2
//
if(count++ > 1000000)
{
count = 0;
//
// Toggle GPIO15
//
GPIO_togglePin(myGPIO15);
}
//
// Set Flag 10 when GPIO14 input changes
//
if(GPIO_readPin(myGPIO14) != state)
{
state = GPIO_readPin(myGPIO14);
//
// This checks to see if flag 10 for CPU1_to_CPU2 is already set, then sets the Flag if it wasn't busy
//
IPC_sendCommand(IPC_CPU1_L_CPU2_R, IPC_FLAG10, IPC_ADDR_CORRECTION_ENABLE,
0, 0, 0);
}
//
// Toggle GPIO31 output if Flag 11 is set by CPU2
//
if (IPC_isFlagBusyRtoL(IPC_CPU1_L_CPU2_R, IPC_FLAG11))
{
//
// Toggle GPIO31 (LED1)
//
GPIO_togglePin(CPU1_LED);
//
// Acknowledge and clear the flag
//
IPC_ackFlagRtoL(IPC_CPU1_L_CPU2_R, IPC_FLAG11);
}
}
}
//
// End of file
//
@@ -0,0 +1,73 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU1" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
const gpio1 = gpio.addInstance();
const gpio2 = gpio.addInstance();
const gpio3 = gpio.addInstance();
const gpio4 = gpio.addInstance();
const gpio5 = gpio.addInstance();
const gpio6 = gpio.addInstance();
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
gpio1.$name = "CPU1_LED";
gpio1.direction = "GPIO_DIR_MODE_OUT";
gpio1.gpioPin.$assign = "GPIO31";
gpio2.$name = "CPU2_LED";
gpio2.controllerCore = "GPIO_CORE_CPU2";
gpio2.direction = "GPIO_DIR_MODE_OUT";
gpio2.gpioPin.$assign = "GPIO34";
gpio3.$name = "myGPIO10";
gpio3.direction = "GPIO_DIR_MODE_OUT";
gpio3.controllerCore = "GPIO_CORE_CPU2";
gpio3.gpioPin.$assign = "GPIO10";
gpio4.$name = "myGPIO11";
gpio4.controllerCore = "GPIO_CORE_CPU2";
gpio4.gpioPin.$assign = "GPIO11";
gpio5.$name = "myGPIO14";
gpio5.gpioPin.$assign = "GPIO14";
gpio6.$name = "myGPIO15";
gpio6.direction = "GPIO_DIR_MODE_OUT";
gpio6.gpioPin.$assign = "GPIO15";
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionAlignEnable_binit = true;
CMD1.sectionMemory_binit = ["FLASHA"];
@@ -0,0 +1,170 @@
//###########################################################################
//
// FILE: ipc_ex2_sysconfig_cpu2.c
//
// TITLE: SysConfig IPC GPIO Toggle for F2837xD CPU2.
//
// This example shows GPIO input on the local CPU triggering an output on the
// remote CPU. A GPIO input change on CPU01 causes an output change on CPU02
// and vice versa.
// CPU1 has control of GPIO31 , GPIO15 and GPIO14.
// CPU2 has control of GPIO34 , GPIO10 and GPIO11.
//
// The IPC is used to signal a change on the CPU's input pin.
//
// \b Hardware \b Connections
// - connect GPIO15 to GPIO11
// - connect GPIO14 to GPIO10
//
// \b Watch \b Pins
// - GPIO34 - output on CPU2
// - GPIO11 - input on CPU2
// - GPIO31 - output on CPU1
// - GPIO14 - input on CPU1
// - GPIO10 - square wave output on CPU02
// - GPIO15 - square wave output on CPU01
//
//#############################################################################
// $TI Release: $
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Main
//
void main(void)
{
uint32_t count;
uint16_t state;
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize SysConfig Settings
//
Board_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Sync the CPUs
//
IPC_sync(IPC_CPU2_L_CPU1_R, IPC_FLAG31);
//
// Set the state to the DAT value of GPIO11
//
state = GPIO_readPin(myGPIO11);
//
// Toggle GPIO10
//
GPIO_togglePin(myGPIO10);
while(1)
{
//
// Produce a Square Wave on GPIO10. This signal will be used to drive
// GPIO14 input on CPU1
//
if(count++ > 2000000)
{
count = 0;
//
// Toggle GPIO10
//
GPIO_togglePin(myGPIO10);
}
//
// Set Flag 11 for CPU2_to_CPU1 flags when GPIO11 input changes
//
if(GPIO_readPin(myGPIO11) != state)
{
state = GPIO_readPin(myGPIO11);
//
// This checks to see if flag 11 for CPU2_to_CPU1 is already set, then sets the Flag if it wasn't busy
//
IPC_sendCommand(IPC_CPU2_L_CPU1_R, IPC_FLAG11, IPC_ADDR_CORRECTION_ENABLE,
0, 0, 0);
}
//
// Toggle GPIO34 output if Flag 10 is set by CPU1
//
if (IPC_isFlagBusyRtoL(IPC_CPU2_L_CPU1_R, IPC_FLAG10))
{
//
// Toggle GPIO34 (LED2)
//
GPIO_togglePin(CPU2_LED);
//
// Acknowledge and clear the flag
//
IPC_ackFlagRtoL(IPC_CPU2_L_CPU1_R, IPC_FLAG10);
}
}
}
//
// End of file
//
@@ -0,0 +1,41 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU2" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionAlignEnable_binit = true;
CMD1.sectionMemory_binit = ["FLASHA"];
@@ -0,0 +1,163 @@
//#############################################################################
//
// FILE: ipc_ex3_basic_sysconfig_c28x1.c
//
// TITLE: SysConfig IPC example with interrupt
//
//! \addtogroup driver_dual_example_list
//! <h1> IPC basic message passing example with interrupt </h1>
//!
//! This example demonstrates how to configure IPC and pass information from
//! C28x1 to C28x2 core without message queues.
//! It is recommended to run the C28x1 core first, followed by the C28x2 core.
//!
//! \b External \b Connections \n
//! - None.
//!
//! \b Watch \b Variables \n
//! - pass
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//###########################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Defines
//
#define IPC_CMD_READ_MEM 0x1001
#define IPC_CMD_RESP 0x2001
#define TEST_PASS 0x5555
#define TEST_FAIL 0xAAAA
#pragma DATA_SECTION(readData, "MSGRAM_CPU1_TO_CPU2")
uint32_t readData[10];
uint32_t pass;
//
// Main
//
void main(void)
{
int i;
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Initialize SysConfig Settings
//
Board_init();
// Clear any IPC flags if set already
//
IPC_clearFlagLtoR(IPC_CPU1_L_CPU2_R, IPC_FLAG_ALL);
//
// Synchronize both the cores.
//
IPC_sync(IPC_CPU1_L_CPU2_R, SYNC_FLAG);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Fill in the data to be sent
//
for(i=0; i<10; i++)
{
readData[i] = i;
}
//
// Send a message without message queue
// Length of the data to be read is passed as data.
//
IPC_sendCommand(IPC_CPU1_L_CPU2_R, IPC_FLAG0, IPC_ADDR_CORRECTION_ENABLE,
IPC_CMD_READ_MEM, (uint32_t)readData, 10);
//
// Wait for acknowledgment
//
IPC_waitForAck(IPC_CPU1_L_CPU2_R, IPC_FLAG0);
//
// Read response
//
if(IPC_getResponse(IPC_CPU1_L_CPU2_R) == TEST_PASS)
{
pass = 1;
}
else
{
pass = 0;
}
//
// End of example. Loop forever
//
while(1);
}
//
// End of File
//
@@ -0,0 +1,50 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU1" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const ipc = scripting.addModule("/driverlib/ipc.js");
const memcfg = scripting.addModule("/driverlib/memcfg.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
ipc.flagHandler31 = "SYNC_FLAG";
ipc.ipcRegisterFlag = ["IPC_FLAG0","IPC_FLAG31"];
ipc.enableInterrupt0 = true;
memcfg.init_MEMCFG_SECT_MSGCPUTOCPU = true;
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionMemory_binit = ["FLASHA"];
CMD1.sectionAlignEnable_binit = true;
CMD1.sectionBinit_ramfunc = false;
@@ -0,0 +1,176 @@
//#############################################################################
//
// FILE: ipc_ex3_basic_sysconfig_c28x2.c
//
// TITLE: SysConfig IPC example with interrupt
//
//! \addtogroup driver_dual_example_list
//! <h1> IPC basic message passing example with interrupt </h1>
//!
//! This example demonstrates how to configure IPC and pass information from
//! C28x1 to C28x2 core without message queues.
//! It is recommended to run the C28x1 core first, followed by the C28x2 core.
//!
//! \b External \b Connections \n
//! - None.
//!
//! \b Watch \b Variables \n
//! - None.
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//###########################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Defines
//
#define IPC_CMD_READ_MEM 0x1001
#define IPC_CMD_RESP 0x2001
#define TEST_PASS 0x5555
#define TEST_FAIL 0xAAAA
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Initialize SysConfig Settings
//
Board_init();
//
// Clear any IPC flags if set already
//
IPC_clearFlagLtoR(IPC_CPU2_L_CPU1_R, IPC_FLAG_ALL);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Synchronize both the cores.
//
IPC_sync(IPC_CPU2_L_CPU1_R, SYNC_FLAG);
//
// Loop forever. Wait for IPC interrupt
//
while(1);
}
//
// IPC ISR for Flag 0.
// C28x core sends data without message queue using Flag 0
//
__interrupt void IPC_ISR0()
{
int i;
uint32_t command, addr, data;
bool status = false;
//
// Read the command
//
IPC_readCommand(IPC_CPU2_L_CPU1_R, IPC_FLAG0, IPC_ADDR_CORRECTION_ENABLE,
&command, &addr, &data);
if(command == IPC_CMD_READ_MEM)
{
status = true;
//
// Read and compare data
//
for(i=0; i<data; i++)
{
if( *((uint32_t *)addr + i) != i)
status = false;
}
}
//
// Send response to C28x core
//
if(status)
{
IPC_sendResponse(IPC_CPU2_L_CPU1_R, TEST_PASS);
}
else
{
IPC_sendResponse(IPC_CPU2_L_CPU1_R, TEST_FAIL);
}
//
// Acknowledge the flag
//
IPC_ackFlagRtoL(IPC_CPU2_L_CPU1_R, IPC_FLAG0);
//
// Acknowledge the PIE interrupt.
//
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
//
// End of File
//
@@ -0,0 +1,48 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU2" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const ipc = scripting.addModule("/driverlib/ipc.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
ipc.registerInterrupts = ["0"];
ipc.ipcRegisterFlag = ["IPC_FLAG31"];
ipc.flagHandler31 = "SYNC_FLAG";
ipc.ipcInt0.enableInterrupt = true;
ipc.ipcInt0.interruptHandler = "IPC_ISR0";
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionMemory_binit = ["FLASHA"];
CMD1.sectionAlignEnable_binit = true;
@@ -0,0 +1,173 @@
//#############################################################################
//
// FILE: ipc_ex4_msgqueue_sysconfig_c28x1.c
//
// TITLE: SysConfig IPC example with interrupt and message queue
//
//! \addtogroup driver_dual_example_list
//! <h1> IPC message passing example with interrupt and message queue </h1>
//!
//! This example demonstrates how to configure IPC and pass information from
//! C28x1 to C28x2 core with message queues.
//! It is recommended to run the C28x1 core first, followed by the C28x2 core.
//!
//! \b External \b Connections \n
//! - None.
//!
//! \b Watch \b Variables \n
//! - pass
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//###########################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Defines
//
#define IPC_CMD_READ_MEM 0x1001
#define IPC_CMD_RESP 0x2001
#define TEST_PASS 0x5555
#define TEST_FAIL 0xAAAA
#pragma DATA_SECTION(readData, "MSGRAM_CPU1_TO_CPU2")
uint32_t readData[10];
uint32_t pass;
//
// Main
//
void main(void)
{
int i;
IPC_MessageQueue_t messageQueue;
IPC_Message_t TxMsg, RxMsg;
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Initialize settings from SysConfig
//
Board_init();
//
// Clear any IPC flags if set already
//
IPC_clearFlagLtoR(IPC_CPU1_L_CPU2_R, IPC_FLAG_ALL);
//
// Initialize message queue
//
IPC_initMessageQueue(IPC_CPU1_L_CPU2_R, &messageQueue, IPC_INT1, IPC_INT1);
//
// Synchronize both the cores
//
IPC_sync(IPC_CPU1_L_CPU2_R, SYNC_FLAG);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Fill in the data to be sent
//
for(i=0; i<10; i++)
{
readData[i] = i;
}
//
// Update the message
//
TxMsg.command = IPC_CMD_READ_MEM;
TxMsg.address = (uint32_t)readData;
TxMsg.dataw1 = 10; // Using dataw1 as data length
TxMsg.dataw2 = 1; // Message identifier
//
// Send message to the queue
//
IPC_sendMessageToQueue(IPC_CPU1_L_CPU2_R, &messageQueue, IPC_ADDR_CORRECTION_ENABLE,
&TxMsg, IPC_BLOCKING_CALL);
//
// Read message from the queue
//
IPC_readMessageFromQueue(IPC_CPU1_L_CPU2_R, &messageQueue, IPC_ADDR_CORRECTION_DISABLE,
&RxMsg, IPC_BLOCKING_CALL);
if((RxMsg.command == IPC_CMD_RESP) && (RxMsg.dataw1 == TEST_PASS) && (RxMsg.dataw2 == 1))
pass = 1;
else
pass = 0;
//
// End of example. Loop forever
//
while(1);
}
//
// End of File
//
@@ -0,0 +1,46 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU1" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const ipc = scripting.addModule("/driverlib/ipc.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
ipc.flagHandler31 = "SYNC_FLAG";
ipc.ipcRegisterFlag = ["IPC_FLAG1","IPC_FLAG31"];
ipc.enableInterrupt1 = true;
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionAlignEnable_binit = true;
CMD1.sectionMemory_binit = ["FLASHA"];
@@ -0,0 +1,184 @@
//#############################################################################
//
// FILE: ipc_ex4_msgqueue_sysconfig_c28x2.c
//
// TITLE: SysConfig IPC example with interrupt and message queue
//
//! \addtogroup driver_dual_example_list
//! <h1> IPC message passing example with interrupt and message queue </h1>
//!
//! This example demonstrates how to configure IPC and pass information from
//! C28x1 to C28x2 core with message queues.
//! It is recommended to run the C28x1 core first, followed by the C28x2 core.
//!
//! \b External \b Connections \n
//! - None.
//!
//! \b Watch \b Variables \n
//! - None.
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//###########################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Defines
//
#define IPC_CMD_READ_MEM 0x1001
#define IPC_CMD_RESP 0x2001
#define TEST_PASS 0x5555
#define TEST_FAIL 0xAAAA
IPC_MessageQueue_t messageQueue;
//
// Function prototypes
//
//__interrupt void IPC_ISR1();
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
Board_init();
//
// Clear any IPC flags if set already
//
IPC_clearFlagLtoR(IPC_CPU2_L_CPU1_R, IPC_FLAG_ALL);
//
// Initialize message queue
//
IPC_initMessageQueue(IPC_CPU2_L_CPU1_R, &messageQueue, IPC_INT1, IPC_INT1);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Synchronize both the cores.
//
IPC_sync(IPC_CPU2_L_CPU1_R, SYNC_FLAG);
//
// Loop forever. Wait for IPC interrupt
//
while(1);
}
//
// IPC ISR for Flag 1
// C28x core sends data with message queue using Flag 0
//
__interrupt void IPC_ISR1()
{
int i;
IPC_Message_t TxMsg, RxMsg;
bool status = false;
//
// Read the message from the message queue
//
IPC_readMessageFromQueue(IPC_CPU2_L_CPU1_R, &messageQueue, IPC_ADDR_CORRECTION_ENABLE,
&RxMsg, IPC_NONBLOCKING_CALL);
if(RxMsg.command == IPC_CMD_READ_MEM)
{
status = true;
//
// Read and compare data
//
for(i=0; i<RxMsg.dataw1; i++)
{
if(*((uint32_t *)RxMsg.address + i) != i)
status = false;
}
}
//
// Send response message
//
TxMsg.command = IPC_CMD_RESP;
TxMsg.address = 0; // Not used
TxMsg.dataw1 = status ? TEST_PASS : TEST_FAIL;
TxMsg.dataw2 = RxMsg.dataw2; // Use the message identifier from the received message
IPC_sendMessageToQueue(IPC_CPU2_L_CPU1_R, &messageQueue, IPC_ADDR_CORRECTION_DISABLE,
&TxMsg, IPC_NONBLOCKING_CALL);
//
// Acknowledge the flag
//
IPC_ackFlagRtoL(IPC_CPU2_L_CPU1_R, IPC_FLAG1);
//
// Acknowledge the PIE interrupt.
//
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
//
// End of File
//
@@ -0,0 +1,48 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU2" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const ipc = scripting.addModule("/driverlib/ipc.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
ipc.ipcRegisterFlag = ["IPC_FLAG31"];
ipc.flagHandler31 = "SYNC_FLAG";
ipc.registerInterrupts = ["1"];
ipc.ipcInt1.enableInterrupt = true;
ipc.ipcInt1.interruptHandler = "IPC_ISR1";
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionAlignEnable_binit = true;
CMD1.sectionMemory_binit = ["FLASHA"];
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<system>
<project configuration="@match" id="project_0" name="ipc_ex2_gpio_sysconfig_cpu1">
</project>
<core id="C28xx_CPU1" project="project_0"/>
<project configuration="@match" id="project_1" name="ipc_ex2_gpio_sysconfig_cpu2">
</project>
<core id="C28xx_CPU2" project="project_1"/>
<preBuildSteps>
</preBuildSteps>
<postBuildSteps>
</postBuildSteps>
</system>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<system>
<project configuration="@match" id="project_0" name="ipc_ex3_basic_sysconfig_c28x1">
</project>
<core id="C28xx_CPU1" project="project_0"/>
<project configuration="@match" id="project_1" name="ipc_ex3_basic_sysconfig_c28x2">
</project>
<core id="C28xx_CPU2" project="project_1"/>
<preBuildSteps>
</preBuildSteps>
<postBuildSteps>
</postBuildSteps>
</system>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<system>
<project configuration="@match" id="project_0" name="ipc_ex4_msgqueue_sysconfig_c28x1">
</project>
<core id="C28xx_CPU1" project="project_0"/>
<project configuration="@match" id="project_1" name="ipc_ex4_msgqueue_sysconfig_c28x2">
</project>
<core id="C28xx_CPU2" project="project_1"/>
<preBuildSteps>
</preBuildSteps>
<postBuildSteps>
</postBuildSteps>
</system>
@@ -0,0 +1,49 @@
<projectSpec>
<project
name="led_ex1_blinky_cpu1"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 --define=_FLASH -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU1_FLASH_STANDALONE" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 --define=_FLASH --define=_STANDALONE -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM"/>
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH,CPU1_FLASH_STANDALONE"/>
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../led_ex1_blinky_cpu1.c" targetDirectory="" />
</project>
<project
name="led_ex1_blinky_cpu2"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU2_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 --define=_FLASH -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU2_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU2_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../led_ex1_blinky_cpu2.c" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,67 @@
<projectSpec>
<project
name="led_ex2_sysconfig_multi"
configurations="
FLASH,
RAM,
"
device="TMS320F28377D"
outputType="system"
cgtVersion="20.2.1.LTS"
>
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<file path="../system.xml" action="copy" openOnCreation="true"/>
<configuration name="FLASH"
></configuration>
<configuration name="RAM"
></configuration>
</project>
<project
name="led_ex2_sysconfig_cpu1"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../led_ex2_sysconfig_cpu1.c" targetDirectory="" />
<file action="copy" path="../led_ex2_sysconfig_cpu1.syscfg" targetDirectory="" />
</project>
<project
name="led_ex2_sysconfig_cpu2"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../led_ex2_sysconfig_cpu2.c" targetDirectory="" />
<file action="copy" path="../led_ex2_sysconfig_cpu2.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,147 @@
//#############################################################################
//
// FILE: led_ex1_blinky_cpu1.c
//
// TITLE: LED Blinky Example
//
//! \addtogroup driver_dual_example_list
//! <h1> LED Blinky Example</h1>
//!
//! This example demonstrates how to blink a LED using CPU1 and blink another
//! LED using CPU2 (led_ex1_blinky_cpu2.c).
//!
//! \b External \b Connections \n
//! - None.
//!
//! \b Watch \b Variables \n
//! - None.
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
#ifdef _STANDALONE
#ifdef _FLASH
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
#else
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_RAM);
#endif // _FLASH
#endif // _STANDALONE
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
Device_initGPIO();
GPIO_setPadConfig(DEVICE_GPIO_PIN_LED1, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED1, GPIO_DIR_MODE_OUT);
GPIO_setPadConfig(DEVICE_GPIO_PIN_LED2, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED2, GPIO_DIR_MODE_OUT);
//
// Configure CPU2 to control the LED GPIO
//
GPIO_setMasterCore(DEVICE_GPIO_PIN_LED2, GPIO_CORE_CPU2);
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop Forever
//
for(;;)
{
//
// Turn on LED
//
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
//
// Turn off LED
//
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 1);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
}
}
//
// End of File
//
@@ -0,0 +1,121 @@
//#############################################################################
//
// FILE: led_ex1_blinky_cpu2.c
//
// TITLE: LED Blinky Example
//
// <h1> LED Blinky Example (CPU2) </h1>
//
// This example demonstrates how to blink a LED using CPU2.
//
// \b External \b Connections \n
// - None.
//
// \b Watch \b Variables \n
// - None.
//
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
// This is configured by CPU1
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop Forever
//
for(;;)
{
//
// Turn on LED
//
GPIO_writePin(DEVICE_GPIO_PIN_LED2, 0);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
//
// Turn off LED
//
GPIO_writePin(DEVICE_GPIO_PIN_LED2, 1);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
}
}
//
// End of File
//
@@ -0,0 +1,142 @@
//#############################################################################
//
// FILE: led_ex2_sysconfig_cpu1.c
//
// TITLE: SysConfig LED Blinky Example
//
//! \addtogroup driver_dual_example_list
//! <h1> LED Blinky Example</h1>
//!
//! This example demonstrates how to blink a LED using CPU1 and blink another
//! LED using CPU2 (led_ex1_blinky_cpu2.c).
//!
//! \b External \b Connections \n
//! - None.
//!
//! \b Watch \b Variables \n
//! - None.
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Defines
//
// Define AUTOBAUD to use the autobaud lock feature
//#define AUTOBAUD
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
Device_initGPIO();
//
// Initialize SysConfig Configuration
//
Board_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Sync CPUs so the blinking starts at the same time, though the LEDs toggle at different frequency
//
IPC_sync(IPC_CPU1_L_CPU2_R, IPC_SYNC);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop Forever
//
for(;;)
{
//
// Turn on LED
//
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
//
// Turn off LED
//
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 1);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
}
}
//
// End of File
//
@@ -0,0 +1,57 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU1" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
const gpio1 = gpio.addInstance();
const gpio2 = gpio.addInstance();
const ipc = scripting.addModule("/driverlib/ipc.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
gpio1.$name = "CPU1_LED";
gpio1.direction = "GPIO_DIR_MODE_OUT";
gpio1.gpioPin.$assign = "GPIO31";
gpio2.$name = "CPU2_LED";
gpio2.direction = "GPIO_DIR_MODE_OUT";
gpio2.controllerCore = "GPIO_CORE_CPU2";
gpio2.gpioPin.$assign = "GPIO34";
ipc.ipcRegisterFlag = ["IPC_FLAG31"];
ipc.flagHandler31 = "IPC_SYNC";
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionMemory_binit = ["FLASHA"];
CMD1.sectionAlignEnable_binit = true;
@@ -0,0 +1,139 @@
//#############################################################################
//
// FILE: led_ex2_sysconfig_cpu2.c
//
// TITLE: SysConfig LED Blinky Example
//
// <h1> LED Blinky Example (CPU2) </h1>
//
// This example demonstrates how to blink a LED using CPU2.
//
// \b External \b Connections \n
// - None.
//
// \b Watch \b Variables \n
// - None.
//
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Defines
//
// Define AUTOBAUD to use the autobaud lock feature
//#define AUTOBAUD
//
// Globals
//
uint16_t loopCounter = 0;
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize SysConfig Configuration
//
Board_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Sync CPUs so the blinking starts at the same time, though the LEDs toggle at different frequency
//
IPC_sync(IPC_CPU2_L_CPU1_R, IPC_SYNC);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop Forever
//
for(;;)
{
//
// Turn on LED
//
GPIO_writePin(DEVICE_GPIO_PIN_LED2, 1);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
//
// Turn off LED
//
GPIO_writePin(DEVICE_GPIO_PIN_LED2, 0);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
}
}
//
// End of File
//
@@ -0,0 +1,45 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU2" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const ipc = scripting.addModule("/driverlib/ipc.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
ipc.ipcRegisterFlag = ["IPC_FLAG31"];
ipc.flagHandler31 = "IPC_SYNC";
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionAlignEnable_binit = true;
CMD1.sectionMemory_binit = ["FLASHA"];
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<system>
<project configuration="@match" id="project_0" name="led_ex2_sysconfig_cpu1">
</project>
<core id="C28xx_CPU1" project="project_0"/>
<project configuration="@match" id="project_1" name="led_ex2_sysconfig_cpu2">
</project>
<core id="C28xx_CPU2" project="project_1"/>
<preBuildSteps>
</preBuildSteps>
<postBuildSteps>
</postBuildSteps>
</system>
@@ -0,0 +1,67 @@
<projectSpec>
<project
name="memcfg_ex1_sysconfig_multi"
configurations="
FLASH,
RAM,
"
device="TMS320F28377D"
outputType="system"
cgtVersion="20.2.1.LTS"
>
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<file path="../system.xml" action="copy" openOnCreation="true"/>
<configuration name="FLASH"
></configuration>
<configuration name="RAM"
></configuration>
</project>
<project
name="memcfg_ex1_sysconfig_cpu1"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../memcfg_ex1_sysconfig_cpu1.c" targetDirectory="" />
<file action="copy" path="../memcfg_ex1_sysconfig_cpu1.syscfg" targetDirectory="" />
</project>
<project
name="memcfg_ex1_sysconfig_cpu2"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../memcfg_ex1_sysconfig_cpu2.c" targetDirectory="" />
<file action="copy" path="../memcfg_ex1_sysconfig_cpu2.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,225 @@
//#############################################################################
//
// FILE: memcfg_ex1_sysconfig_cpu1.c
//
// TITLE: SysConfig RAM Management Example
//
//! \addtogroup driver_dual_example_list
//! <h1> LED Blinky Example</h1>
//!
//! This example demonstrates how to blink a LED using CPU1 and blink another
//! LED using CPU2 (led_ex1_blinky_cpu2.c).
//!
//! \b External \b Connections \n
//! - None.
//!
//! \b Watch \b Variables \n
//! - None.
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
#include "board.h"
//
// Globals
//
uint16_t cpu1RArray[256]; // Mapped to GS0 of shared RAM owned by CPU2
uint16_t cpu1RWArray[256]; // Mapped to GS1 of shared RAM owned by CPU1
#pragma DATA_SECTION(cpu1RArray,"SHARERAMGS0");
#pragma DATA_SECTION(cpu1RWArray,"SHARERAMGS1");
uint16_t error;
uint16_t multiplier;
uint16_t isrfuncLoadStart;
extern uint16_t isrfuncLoadEnd;
uint16_t isrfuncRunStart;
uint16_t isrfuncLoadSize;
//
// Function Prototypes
//
void initCPUTimer(uint32_t);
void configCPUTimer(uint32_t, float, float);
__interrupt void cpuTimer0ISR(void);
#pragma CODE_SECTION(cpuTimer0ISR, "isrfunc")
void readDataCPU1(void);
void writeDataCPU1(void);
//
// Main
//
void main(void)
{
uint16_t ipcFlag10 = 10U;
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize GPIO
//
Device_initGPIO();
//
// Initialize SysConfig Settings
//
Board_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
error = 0;
multiplier = 0;
writeDataCPU1();
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag10;
uint32_t counter = 0;
//
// Loop indefinitely
//
for(;;)
{
//
// If there is no pending flag
//
if( (HWREG(IPC_BASE + IPC_O_FLG) & (1UL << ipcFlag10)) == 0)
{
readDataCPU1();
if(multiplier++ > 255)
{
multiplier = 0;
}
//
// Write an array to a memory location owned by CPU01
//
writeDataCPU1();
//
// Set a flag to notify CPU02 that data is available
//
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag10;
}
if (counter++ > 2000000)
{
//
// Toggle CPU1_LED, defined in sysconfig
//
GPIO_togglePin(CPU1_LED);
counter = 0;
}
}
}
//
// writeDataCPU1 - Write a pattern to an array in shared RAM
//
void writeDataCPU1(void)
{
uint16_t index;
//
// Use first location to write a multiplier.
//
cpu1RWArray[0] = multiplier;
for(index = 1; index < 256; index++)
{
cpu1RWArray[index] = index;
//
// The following code will attempt to write to a shared RAM assigned
// to CPU2 and as a result will cause an access violation.
//
// cpu1RArray[index] = 1000 + index;
}
}
//
// readDataCPU1 - Read and compare an array from shared RAM
//
void readDataCPU1(void)
{
uint16_t index;
if(cpu1RArray[0] == multiplier)
{
for(index = 1; index < 256; index++)
{
if(cpu1RArray[index] != multiplier * cpu1RWArray[index])
{
error = 1;
}
}
}
else
{
error = 1;
}
}
//
// End of File
//
@@ -0,0 +1,68 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU1" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
const gpio1 = gpio.addInstance();
const gpio2 = gpio.addInstance();
const ipc = scripting.addModule("/driverlib/ipc.js");
const memcfg = scripting.addModule("/driverlib/memcfg.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
gpio1.$name = "CPU1_LED";
gpio1.direction = "GPIO_DIR_MODE_OUT";
gpio1.gpioPin.$assign = "GPIO34";
gpio2.$name = "CPU2_LED";
gpio2.direction = "GPIO_DIR_MODE_OUT";
gpio2.controllerCore = "GPIO_CORE_CPU2";
gpio2.gpioPin.$assign = "GPIO31";
memcfg.config_MEMCFG_SECT_GS0 = "MEMCFG_GSRAMCONTROLLER_CPU2";
memcfg.config_MEMCFG_SECT_GS14 = "MEMCFG_GSRAMCONTROLLER_CPU2";
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionMemory_binit = ["FLASHA"];
CMD1.sectionAlignEnable_binit = true;
CMD1.userSection.create(4);
CMD1.userSection[0].$name = "isrfunc";
CMD1.userSection[0].sectionMemory = ["RAMGS15"];
CMD1.userSection[1].$name = "SHARERAMGS0";
CMD1.userSection[1].sectionMemory = ["RAMGS0"];
CMD1.userSection[2].$name = "SHARERAMGS1";
CMD1.userSection[2].sectionMemory = ["RAMGS1"];
CMD1.userSection[3].$name = "SHARERAMGS2";
CMD1.userSection[3].sectionMemory = ["RAMGS2"];
scripting.suppress("RAMGS0 is not configured to be owned by CPU1 in @@@.+?@@@\\. CPU1 will only have read access to this memory\\.", CMD1.userSection[1], "sectionMemory");
@@ -0,0 +1,252 @@
//#############################################################################
//
// FILE: memcfg_ex1_sysconfig_cpu2.c
//
// TITLE: SysConfig RAM Management Example
//
//! \addtogroup driver_dual_example_list
//! <h1> LED Blinky Example</h1>
//!
//! This example demonstrates how to blink a LED using CPU1 and blink another
//! LED using CPU2 (led_ex1_blinky_cpu2.c).
//!
//! \b External \b Connections \n
//! - None.
//!
//! \b Watch \b Variables \n
//! - None.
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
#include "board.h"
//
// Globals
//
uint16_t cpu2RWArray[256]; // Mapped to GS1 of shared RAM owned by CPU02
uint16_t cpu2RArray[256]; // Mapped to GS0 of shared RAM owned by CPU01
#pragma DATA_SECTION(cpu2RArray,"SHARERAMGS1");
#pragma DATA_SECTION(cpu2RWArray,"SHARERAMGS0");
uint16_t isrfuncLoadStart;
extern uint16_t isrfuncLoadEnd;
uint16_t isrfuncRunStart;
uint16_t isrfuncLoadSize;
//
// Function Prototypes
//
void initCPUTimer(uint32_t);
void configCPUTimer(uint32_t, float, float);
__interrupt void cpuTimer0ISR(void);
#pragma CODE_SECTION(cpuTimer0ISR, "isrfunc")
void writeDataCPU2(void);
//
// Main
//
void main(void)
{
uint16_t ipcFlag10 = 10U;
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Initialize SysConfig Settings
//
Board_init();
//
// Wait until shared RAM is available.
//
while((HWREGH(MEMCFG_BASE + MEMCFG_O_GSXMSEL) &
(MEMCFG_GSXMSEL_MSEL_GS14 | MEMCFG_GSXMSEL_MSEL_GS15)) == 0U)
{
}
//
// Interrupts that are used in this example are re-mapped to ISR functions
// found within this file.
//
Interrupt_register(INT_TIMER0, &cpuTimer0ISR);
//
// Configure CPU Timer 0 to a 1 second period
//
initCPUTimer(CPUTIMER0_BASE);
configCPUTimer(CPUTIMER0_BASE, DEVICE_SYSCLK_FREQ, 1000000);
//
// Start CPU Timer 0
//
CPUTimer_startTimer(CPUTIMER0_BASE);
//
// Enable CPU Timer 0 interrupt
//
Interrupt_enable(INT_TIMER0);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop indefinitely
//
while(1)
{
if((HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag10)) == 1)
{
//
// Read cpu2RArray and modify cpu2RWArray
//
writeDataCPU2();
HWREG(IPC_BASE + IPC_O_ACK) = 1UL << ipcFlag10;
}
}
}
//
// initCPUTimer - This function initializes a CPU Timer to a known state.
//
void initCPUTimer(uint32_t cpuTimer)
{
//
// Initialize timer period to maximum
//
CPUTimer_setPeriod(cpuTimer, 0xFFFFFFFF);
//
// Initialize pre-scale counter to divide by 1 (SYSCLKOUT)
//
CPUTimer_setPreScaler(cpuTimer, 0);
//
// Make sure timer is stopped
//
CPUTimer_stopTimer(cpuTimer);
//
// Reload all counter registers with period value
//
CPUTimer_reloadTimerCounter(cpuTimer);
}
//
// configCPUTimer - This function initializes the selected timer to the
// period specified by the "freq" and "period" parameters. The "freq" is
// entered as Hz and the period in microseconds. The timer is held in the
// stopped state after configuration.
//
void configCPUTimer(uint32_t cpuTimer, float freq, float period)
{
uint32_t temp;
//
// Initialize timer period:
//
temp = (uint32_t)(freq / 1000000 * period);
CPUTimer_setPeriod(cpuTimer, temp);
//
// Set pre-scale counter to divide by 1 (SYSCLKOUT):
//
CPUTimer_setPreScaler(cpuTimer, 0);
//
// Initializes timer control register. The timer is stopped, reloaded,
// free run disabled, and interrupt enabled.
//
CPUTimer_stopTimer(cpuTimer);
CPUTimer_reloadTimerCounter(cpuTimer);
CPUTimer_setEmulationMode(cpuTimer,
CPUTIMER_EMULATIONMODE_STOPAFTERNEXTDECREMENT);
CPUTimer_enableInterrupt(cpuTimer);
}
//
// cpuTimer0ISR - CPU Timer0 ISR
//
__interrupt void cpuTimer0ISR(void)
{
GPIO_togglePin(CPU2_LED); // CPU2_LED Defined in Sysconfig
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
//
// writeDataCPU2 - Read data from cpu2RArray written by CPU01 and modify and
// write into cpu2RWArray. cpu2RArray[0] is used to hold the
// multiplier value.
//
void writeDataCPU2(void)
{
uint16_t index;
uint16_t multiplier;
multiplier = cpu2RArray[0];
cpu2RWArray[0] = multiplier;
for(index = 1; index < 256; index ++)
{
cpu2RWArray[index] = multiplier * cpu2RArray[index];
}
}
//
// End of File
//
@@ -0,0 +1,53 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU2" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const ipc = scripting.addModule("/driverlib/ipc.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionMemory_binit = ["FLASHA"];
CMD1.sectionAlignEnable_binit = true;
CMD1.userSection.create(4);
CMD1.userSection[0].$name = "isrfunc";
CMD1.userSection[0].sectionMemory = ["RAMGS14"];
CMD1.userSection[1].$name = "SHARERAMGS0";
CMD1.userSection[1].sectionMemory = ["RAMGS0"];
CMD1.userSection[2].$name = "SHARERAMGS1";
CMD1.userSection[2].sectionMemory = ["RAMGS1"];
CMD1.userSection[3].$name = "SHARERAMGS2";
CMD1.userSection[3].sectionMemory = ["RAMGS2"];
scripting.suppress("RAMGS1 is not configured to be owned by CPU2 in @@@.+?@@@\\. CPU2 will only have read access to this memory\\.", CMD1.userSection[2], "sectionMemory");
scripting.suppress("RAMGS2 is not configured to be owned by CPU2 in @@@.+?@@@\\. CPU2 will only have read access to this memory\\.", CMD1.userSection[3], "sectionMemory");
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<system>
<project configuration="@match" id="project_0" name="memcfg_ex1_sysconfig_cpu1">
</project>
<core id="C28xx_CPU1" project="project_0"/>
<project configuration="@match" id="project_1" name="memcfg_ex1_sysconfig_cpu2">
</project>
<core id="C28xx_CPU2" project="project_1"/>
<preBuildSteps>
</preBuildSteps>
<postBuildSteps>
</postBuildSteps>
</system>
@@ -0,0 +1,50 @@
<projectSpec>
<project
name="nmi_ex1_cpu1handling"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_COMMON_INCLUDE} -I${C2000WARE_HEADERS_INCLUDE} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_COMMON_INCLUDE} -I${C2000WARE_HEADERS_INCLUDE} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_COMMON_INCLUDE" path="../../../../../../device_support/f2837xd/common/include/" scope="project" />
<pathVariable name="C2000WARE_HEADERS_INCLUDE" path="../../../../../../device_support/f2837xd/headers/include/" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../nmi_ex1_cpu1handling.c" targetDirectory="" />
</project>
<project
name="nmi_ex1_cpu2wdreset"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU2_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU2_RAM" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU2_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../nmi_ex1_cpu2wdreset.c" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,71 @@
<projectSpec>
<project
name="nmi_ex2_sysconfig_multi"
configurations="
FLASH,
RAM,
"
device="TMS320F28377D"
outputType="system"
cgtVersion="20.2.1.LTS"
>
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<file path="../system.xml" action="copy" openOnCreation="true"/>
<configuration name="FLASH"
></configuration>
<configuration name="RAM"
></configuration>
</project>
<project
name="nmi_ex2_sysconfig_cpu1"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="FLASH" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="RAM" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../nmi_ex2_sysconfig_cpu1.c" targetDirectory="" />
<file action="copy" path="../nmi_ex2_sysconfig_cpu1.syscfg" targetDirectory="" />
</project>
<project
name="nmi_ex2_sysconfig_cpu2"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_FLASH_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="FLASH" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_RAM_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="RAM" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../nmi_ex2_sysconfig_cpu2.c" targetDirectory="" />
<file action="copy" path="../nmi_ex2_sysconfig_cpu2.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,157 @@
//#############################################################################
//
// FILE: nmi_ex1_cpu1handling.c
//
// TITLE: NMI Handling between CPU cores
//
//! \addtogroup driver_dual_example_list
//! <h1> NMI handling</h1>
//!
//! This example demonstrates how to handle an NMI.
//!
//! The watchdog of CPU 2 is configured to reset the core once the watchdog
//! overflows and in the CPU 1 the NMI is triggered.
//! The NMI status is read and is verified to be due to CPU2 Watchdog reset.
//! \b Watch \b Variables
//! - \e pass Indicates that the CPU2 has been reset by its watchdog and an
//! -NMI was triggered at CPU1
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include <stdint.h>
#include <stdbool.h>
#include "sysctl.h"
#include "driverlib.h"
#include "device.h"
//
// Globals
//
volatile uint32_t nmistatus = 0,nmiflagstatus =0 ,nmisdflagstatus =0,nmiwdcnt =0;
volatile uint16_t nmi_isr_called = 0,pass = 0;
//
// Function Prototypes
//
interrupt void nmi_isr(void);
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
#ifdef _STANDALONE
#ifdef _FLASH
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
#else
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_RAM);
#endif // _FLASH
#endif // _STANDALONE
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR)
//
Interrupt_initVectorTable();
SysCtl_clearAllNMIFlags();
Interrupt_register(INT_NMI, &nmi_isr);
//
//Enabling the NMI global interrupt
//
EALLOW;
HWREGH(NMI_BASE + NMI_O_CFG) |= NMI_CFG_NMIE;
EDIS;
Interrupt_enable(INT_NMI);
//
// Enable Global Interrupt (INTM) and Real Time interrupt (DBGM)
//
EINT;
ERTM;
while(nmi_isr_called != 1)
{
pass=0;
}
if(SysCtl_isNMIShadowFlagSet(SYSCTL_NMI_CPU2WDRSN)==true)
pass = 1;
SysCtl_clearAllNMIFlags();
if(pass == 1)
{
Example_setResultPass();
}
else
{
Example_setResultFail();
}
Example_done();
}
interrupt void nmi_isr(void)
{
nmi_isr_called = 1;
nmiflagstatus = SysCtl_getNMIFlagStatus();
nmisdflagstatus = SysCtl_getNMIShadowFlagStatus();
}
//
// End of File
//
@@ -0,0 +1,126 @@
//#############################################################################
//
// FILE: nmi_ex1_cpu2wdreset.c
//
// TITLE: Servicing Watchdog reset nmi Example
//
//! \addtogroup driver_dual_example_list
//! <h1> Watchdog Reset</h1>
//!
//! This example shows how to service the watchdog to reset CPU2 which
//! will trigger an NMI in CPU1.
//! \b External \b Connections \n
//! - None.
//!
//! \b Watch \b Variables \n
//! - loopCount - The number of loops performed while not in ISR
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
//
// Globals
//
uint32_t loopCount;
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Clear the counters
//
loopCount = 0;
//
// Set the watchdog to generate an interrupt signal instead of a
// reset signal
//
if(SysCtl_isWatchdogInterruptActive()==false)
SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET);
else
{
SysCtl_serviceWatchdog();
SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET);
}
//
// Reset the watchdog counter
//
SysCtl_serviceWatchdog();
//
// Enable the watchdog
//
SysCtl_enableWatchdog();
//
// Loop Forever
//
for(;;)
{
loopCount++;
}
}
//
// End of File
//
@@ -0,0 +1,149 @@
//#############################################################################
//
// FILE: nmi_ex2_sysconfig_cpu1.c
//
// TITLE: SysConfig NMI Handling between CPU cores
//
//! \addtogroup driver_dual_example_list
//! <h1> NMI handling</h1>
//!
//! This example demonstrates how to handle an NMI.
//!
//! The watchdog of CPU 2 is configured to reset the core once the watchdog
//! overflows and in the CPU 1 the NMI is triggered.
//! The NMI status is read and is verified to be due to CPU2 Watchdog reset.
//! \b Watch \b Variables
//! - \e pass Indicates that the CPU2 has been reset by its watchdog and an
//! -NMI was triggered at CPU1
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include <stdint.h>
#include <stdbool.h>
#include "sysctl.h"
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Globals
//
volatile uint32_t nmistatus = 0,nmiflagstatus =0 ,nmisdflagstatus =0,nmiwdcnt =0;
volatile uint16_t nmi_isr_called = 0,pass = 0;
uint16_t int_count = 0;
//
// Function Prototypes
//
interrupt void nmi_isr(void);
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
#ifdef _STANDALONE
Device_bootCPU2(BOOT_MODE_CPU2);
#endif // _STANDALONE
//
// Initialize SysConfig Configuration
//
Board_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR)
//
Interrupt_initVectorTable();
SysCtl_clearAllNMIFlags();
Interrupt_register(INT_NMI, &nmi_isr);
Interrupt_enable(INT_NMI);
//
// Enable Global Interrupt (INTM) and Real Time interrupt (DBGM)
//
EINT;
ERTM;
while(nmi_isr_called != 1)
{
pass=0;
}
if(SysCtl_isNMIShadowFlagSet(SYSCTL_NMI_CPU2WDRSN)==true)
{
pass = 1;
}
int_count++;
SysCtl_clearAllNMIFlags();
if(pass == 1)
{
Example_setResultPass();
}
else
{
Example_setResultFail();
}
Example_done();
}
interrupt void nmi_isr(void)
{
nmi_isr_called = 1;
nmiflagstatus = SysCtl_getNMIFlagStatus();
nmisdflagstatus = SysCtl_getNMIShadowFlagStatus();
}
//
// End of File
//
@@ -0,0 +1,17 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_100PTP" --part "F2837xD_100PTP" --context "CPU1" --product "C2000WARE@4.02.00.00"
* @versions {"tool":"1.13.0+2553"}
*/
/**
* Import the modules used in this configuration.
*/
const ipc = scripting.addModule("/driverlib/ipc.js");
const sysctl = scripting.addModule("/driverlib/sysctl.js");
/**
* Write custom configuration values to the imported modules.
*/
sysctl.enableNMIGlobalInterrupt = true;
@@ -0,0 +1,132 @@
//#############################################################################
//
// FILE: nmi_ex2_sysconfig_cpu2.c
//
// TITLE: SysConfig Servicing Watchdog reset nmi Example
//
//! \addtogroup driver_dual_example_list
//! <h1> Watchdog Reset</h1>
//!
//! This example shows how to service the watchdog to reset CPU2 which
//! will trigger an NMI in CPU1.
//! \b External \b Connections \n
//! - None.
//!
//! \b Watch \b Variables \n
//! - loopCount - The number of loops performed while not in ISR
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Globals
//
uint32_t loopCount;
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize SysConfig Configuration
//
Board_init();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Clear the counters
//
loopCount = 0;
//
// Set the watchdog to generate an interrupt signal instead of a
// reset signal
//
if(SysCtl_isWatchdogInterruptActive()==false)
SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET);
else
{
SysCtl_serviceWatchdog();
SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET);
}
//
// Reset the watchdog counter
//
SysCtl_serviceWatchdog();
//
// Enable the watchdog
//
SysCtl_enableWatchdog();
//
// Loop Forever
//
for(;;)
{
loopCount++;
}
}
//
// End of File
//
@@ -0,0 +1,20 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_100PTP" --part "F2837xD_100PTP" --context "CPU2" --product "C2000WARE@4.02.00.00"
* @versions {"tool":"1.13.0+2553"}
*/
/**
* Import the modules used in this configuration.
*/
const ipc = scripting.addModule("/driverlib/ipc.js");
const watchdog = scripting.addModule("/driverlib/watchdog.js", {}, false);
const watchdog1 = watchdog.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
watchdog1.$name = "myWATCHDOG0";
watchdog1.enableModule = false;
watchdog1.wdMode = "SYSCTL_WD_MODE_INTERRUPT";
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<system>
<project configuration="@match" id="project_0" name="nmi_ex2_sysconfig_cpu1">
</project>
<core id="C28xx_CPU1" project="project_0"/>
<project configuration="@match" id="project_1" name="nmi_ex2_sysconfig_cpu2">
</project>
<core id="C28xx_CPU2" project="project_1"/>
<preBuildSteps>
</preBuildSteps>
<postBuildSteps>
</postBuildSteps>
</system>
@@ -0,0 +1,62 @@
<projectSpec>
<project
name="ram_ex1_management_cpu1"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_COMMON_INCLUDE} -I${C2000WARE_HEADERS_INCLUDE} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_COMMON_INCLUDE" path="../../../../../../device_support/f2837xd/common/include/" scope="project" />
<pathVariable name="C2000WARE_HEADERS_INCLUDE" path="../../../../../../device_support/f2837xd/headers/include/" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_Gpio.c" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_Ipc.c" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_Ipc_Driver_Util.c" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_SysCtrl.c" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_shared_cpu1.cmd" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/headers/cmd/F2837xD_Headers_nonBIOS_cpu1.cmd" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/headers/source/F2837xD_GlobalVariableDefs.c" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../ram_ex1_management_cpu1.c" targetDirectory="" />
<file action="copy" path="../ram_ex1_isr_cpu1.cmd" targetDirectory="" />
</project>
<project
name="ram_ex1_management_cpu2"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_COMMON_INCLUDE} -I${C2000WARE_HEADERS_INCLUDE} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_COMMON_INCLUDE" path="../../../../../../device_support/f2837xd/common/include/" scope="project" />
<pathVariable name="C2000WARE_HEADERS_INCLUDE" path="../../../../../../device_support/f2837xd/headers/include/" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_Gpio.c" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_Ipc.c" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_Ipc_Driver_Util.c" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_SysCtrl.c" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_shared_cpu2.cmd" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/headers/cmd/F2837xD_Headers_nonBIOS_cpu2.cmd" targetDirectory="" />
<file action="copy" path="../../../../../../device_support/f2837xd/headers/source/F2837xD_GlobalVariableDefs.c" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../ram_ex1_management_cpu2.c" targetDirectory="" />
<file action="copy" path="../ram_ex1_isr_cpu2.cmd" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,40 @@
MEMORY
{
PAGE 0 : /* Program Memory */
PAGE 1 : /* Data Memory */
}
/*
Allocate sections to memory blocks.
*/
SECTIONS
{
/* Allocate program areas: */
#if defined(__TI_EABI__)
isrfunc : LOAD = RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4,
RUN = RAMGS15,
LOAD_START(isrfuncLoadStart),
LOAD_END(isrfuncLoadEnd),
RUN_START(isrfuncRunStart),
LOAD_SIZE(isrfuncLoadSize),
PAGE = 0
#else
isrfunc : LOAD = RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4,
RUN = RAMGS15,
LOAD_START(_isrfuncLoadStart),
LOAD_END(_isrfuncLoadEnd),
RUN_START(_isrfuncRunStart),
LOAD_SIZE(_isrfuncLoadSize),
PAGE = 0
#endif
}
/*
//===========================================================================
// End of file.
//===========================================================================
*/
@@ -0,0 +1,40 @@
MEMORY
{
PAGE 0 : /* Program Memory */
PAGE 1 : /* Data Memory */
}
/*
Allocate sections to memory blocks.
*/
SECTIONS
{
/* Allocate program areas: */
#if defined(__TI_EABI__)
isrfunc : LOAD = RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4,
RUN = RAMGS14,
LOAD_START(isrfuncLoadStart),
LOAD_END(isrfuncLoadEnd),
RUN_START(isrfuncRunStart),
LOAD_SIZE(isrfuncLoadSize),
PAGE = 0
#else
isrfunc : LOAD = RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4,
RUN = RAMGS14,
LOAD_START(_isrfuncLoadStart),
LOAD_END(_isrfuncLoadEnd),
RUN_START(_isrfuncRunStart),
LOAD_SIZE(_isrfuncLoadSize),
PAGE = 0
#endif
}
/*
//===========================================================================
// End of file.
//===========================================================================
*/
@@ -0,0 +1,356 @@
//#############################################################################
//
// FILE: ram_ex1_management_cpu1.c
//
// TITLE: RAM Management Example
//
//! \addtogroup driver_dual_example_list
//! <h1> Shared RAM Management</h1>
//!
//! This example shows how to assign shared RAM for use by both the CPU2 and
//! CPU1 core. Shared RAM regions are defined in both the CPU2 and CPU1
//! linker files. In this example GS0 and GS14 are assigned to/owned by CPU2.
//! The remaining shared RAM regions are owned by CPU1.
//!
//! In this example, a pattern is written to cpu1RWArray and then an IPC flag
//! is sent to notify CPU2 that data is ready to be read. CPU2 then reads the
//! data from cpu2RArray and writes a modified pattern to cpu2RWArray. Once
//! CPU2 acknowledges the IPC flag, CPU1 reads the data from cpu1RArray and
//! compares with expected result.
//!
//! A timer ISR is also serviced in both CPUs. The ISRs are copied into the
//! shared RAM region owned by the respective CPUs. Each ISR toggles a GPIO.
//! Watch the GPIOs on an oscilloscope, or if using the controlCARD, watch
//! LED1 and LED2 blink at different rates.
//!
//! - cpu1RWArray[] is mapped to shared RAM GS1
//! - cpu1RArray[] is mapped to shared RAM GS0
//! - cpu2RArray[] is mapped to shared RAM GS1
//! - cpu2RWArray[] is mapped to shared RAM GS0
//! - cpuTimer0ISR in CPU2 is copied to shared RAM GS14, toggles LED1
//! - cpuTimer0ISR in CPU1 is copied to shared RAM GS15, toggles LED2
//!
//! \b Watch \b Variables
//! - \e error Indicates that the data written is not correctly received by
//! the other CPU.
//!
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "F2837xD_Ipc_drivers.h"
//
// Globals
//
uint16_t cpu1RArray[256]; // Mapped to GS0 of shared RAM owned by CPU2
uint16_t cpu1RWArray[256]; // Mapped to GS1 of shared RAM owned by CPU1
#pragma DATA_SECTION(cpu1RArray,"SHARERAMGS0");
#pragma DATA_SECTION(cpu1RWArray,"SHARERAMGS1");
uint16_t error;
uint16_t multiplier;
//auto check variable
uint16_t count=0;
extern uint16_t isrfuncLoadStart;
extern uint16_t isrfuncLoadEnd;
extern uint16_t isrfuncRunStart;
extern uint16_t isrfuncLoadSize;
//
// Function Prototypes
//
void initCPUTimer(uint32_t);
void configCPUTimer(uint32_t, float, float);
__interrupt void cpuTimer0ISR(void);
#pragma CODE_SECTION(cpuTimer0ISR, "isrfunc")
void readDataCPU1(void);
void writeDataCPU1(void);
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
Device_initGPIO();
GPIO_setPadConfig(DEVICE_GPIO_PIN_LED1, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED1, GPIO_DIR_MODE_OUT);
GPIO_setPadConfig(DEVICE_GPIO_PIN_LED2, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED2, GPIO_DIR_MODE_OUT);
//
// Configure CPU ownership of the GPIOs
//
GPIO_setMasterCore(DEVICE_GPIO_PIN_LED1, GPIO_CORE_CPU2);
GPIO_setMasterCore(DEVICE_GPIO_PIN_LED2, GPIO_CORE_CPU1);
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Give memory access to GS0 and GS14 RAM to CPU2
//
MemCfg_setGSRAMMasterSel((MEMCFG_SECT_GS0 | MEMCFG_SECT_GS14),
MEMCFG_GSRAMMASTER_CPU2);
//
// Copy the ISR to a specified RAM location
//
memcpy(&isrfuncRunStart, &isrfuncLoadStart, (uint32_t)&isrfuncLoadSize);
//
// Interrupts that are used in this example are re-mapped to ISR functions
// found within this file.
//
Interrupt_register(INT_TIMER0, &cpuTimer0ISR);
//
// Configure CPU Timer 0 to a 2 second period
//
initCPUTimer(CPUTIMER0_BASE);
configCPUTimer(CPUTIMER0_BASE, DEVICE_SYSCLK_FREQ, 2000000);
//
// Start CPU Timer 0
//
CPUTimer_startTimer(CPUTIMER0_BASE);
//
// Enable CPU Timer 0 interrupt
//
Interrupt_enable(INT_TIMER0);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
error = 0;
multiplier = 0;
writeDataCPU1();
IPCLtoRFlagSet(IPC_FLAG10);
//
// Loop indefinitely
//
while(count<255)
{
//
// If there is no pending flag
//
if(IPCLtoRFlagBusy(IPC_FLAG10) == 0)
{
readDataCPU1();
if(multiplier++ > 255)
{
multiplier = 0;
}
//
// Write an array to a memory location owned by CPU01
//
writeDataCPU1();
//
// Set a flag to notify CPU02 that data is available
//
IPCLtoRFlagSet(IPC_FLAG10);
count++;
}
}
if(error == 0)
{
Example_setResultPass();
}
else
{
Example_setResultFail();
}
Example_done();
}
//
// initCPUTimer - This function initializes a CPU Timer to a known state.
//
void
initCPUTimer(uint32_t cpuTimer)
{
//
// Initialize timer period to maximum
//
CPUTimer_setPeriod(cpuTimer, 0xFFFFFFFF);
//
// Initialize pre-scale counter to divide by 1 (SYSCLKOUT)
//
CPUTimer_setPreScaler(cpuTimer, 0);
//
// Make sure timer is stopped
//
CPUTimer_stopTimer(cpuTimer);
//
// Reload all counter registers with period value
//
CPUTimer_reloadTimerCounter(cpuTimer);
}
//
// configCPUTimer - This function initializes the selected timer to the
// period specified by the "freq" and "period" parameters. The "freq" is
// entered as Hz and the period in microseconds. The timer is held in the
// stopped state after configuration.
//
void
configCPUTimer(uint32_t cpuTimer, float freq, float period)
{
uint32_t temp;
//
// Initialize timer period:
//
temp = (uint32_t)(freq / 1000000 * period);
CPUTimer_setPeriod(cpuTimer, temp);
//
// Set pre-scale counter to divide by 1 (SYSCLKOUT):
//
CPUTimer_setPreScaler(cpuTimer, 0);
//
// Initializes timer control register. The timer is stopped, reloaded,
// free run disabled, and interrupt enabled.
//
CPUTimer_stopTimer(cpuTimer);
CPUTimer_reloadTimerCounter(cpuTimer);
CPUTimer_setEmulationMode(cpuTimer,
CPUTIMER_EMULATIONMODE_STOPAFTERNEXTDECREMENT);
CPUTimer_enableInterrupt(cpuTimer);
}
//
// cpuTimer0ISR - CPU Timer0 ISR
//
__interrupt void cpuTimer0ISR(void)
{
GPIO_togglePin(DEVICE_GPIO_PIN_LED2);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
//
// writeDataCPU1 - Write a pattern to an array in shared RAM
//
void writeDataCPU1(void)
{
uint16_t index;
//
// Use first location to write a multiplier.
//
cpu1RWArray[0] = multiplier;
for(index = 1; index < 256; index++)
{
cpu1RWArray[index] = index;
//
// The following code will attempt to write to a shared RAM assigned
// to CPU2 and as a result will cause an access violation.
//
cpu1RArray[index] = 257 + index;
}
}
//
// readDataCPU1 - Read and compare an array from shared RAM
//
void readDataCPU1(void)
{
uint16_t index;
if(cpu1RArray[0] == multiplier)
{
for(index = 1; index < 256; index++)
{
if(cpu1RArray[index] != multiplier * cpu1RWArray[index])
{
error = 1;
}
if(cpu1RArray[index] == 257+index)
{
error = 1;
}
}
}
else
{
error = 1;
}
}
//
// End of File
//
@@ -0,0 +1,249 @@
//#############################################################################
//
// FILE: ram_ex1_management_cpu2.c
//
// TITLE: RAM Management Example (CPU2)
//
// This example shows how to assign shared RAM for use by both the CPU2 and
// CPU1 core.
//
// Shared RAM regions are defined in both the CPU2 and CPU1 linker files.
//
// In this example GS0 and GS14 are assigned to/owned by CPU2.
// - cpu2RWArray[] is mapped to shared RAM GS0
// - cpu2RArray[] is mapped to shared RAM GS1
// - cpuTimer0ISR is copied to shared RAM GS14, toggles LED1
//
//#############################################################################
//
// $Release Date: $
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "F2837xD_Ipc_drivers.h"
//
// Globals
//
uint16_t cpu2RWArray[256]; // Mapped to GS1 of shared RAM owned by CPU02
uint16_t cpu2RArray[256]; // Mapped to GS0 of shared RAM owned by CPU01
#pragma DATA_SECTION(cpu2RArray,"SHARERAMGS1");
#pragma DATA_SECTION(cpu2RWArray,"SHARERAMGS0");
extern uint16_t isrfuncLoadStart;
extern uint16_t isrfuncLoadEnd;
extern uint16_t isrfuncRunStart;
extern uint16_t isrfuncLoadSize;
//
// Function Prototypes
//
void initCPUTimer(uint32_t);
void configCPUTimer(uint32_t, float, float);
__interrupt void cpuTimer0ISR(void);
#pragma CODE_SECTION(cpuTimer0ISR, "isrfunc")
void writeDataCPU2(void);
//
// Main
//
void main(void)
{
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Wait until shared RAM is available.
//
while((HWREGH(MEMCFG_BASE + MEMCFG_O_GSXMSEL) &
(MEMCFG_GSXMSEL_MSEL_GS14 | MEMCFG_GSXMSEL_MSEL_GS15)) == 0U)
{
}
//
// Copy the ISR to a specified RAM location
//
memcpy(&isrfuncRunStart, &isrfuncLoadStart, (uint32_t)&isrfuncLoadSize);
//
// Interrupts that are used in this example are re-mapped to ISR functions
// found within this file.
//
Interrupt_register(INT_TIMER0, &cpuTimer0ISR);
//
// Configure CPU Timer 0 to a 1 second period
//
initCPUTimer(CPUTIMER0_BASE);
configCPUTimer(CPUTIMER0_BASE, DEVICE_SYSCLK_FREQ, 1000000);
//
// Start CPU Timer 0
//
CPUTimer_startTimer(CPUTIMER0_BASE);
//
// Enable CPU Timer 0 interrupt
//
Interrupt_enable(INT_TIMER0);
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop indefinitely
//
while(1)
{
if(IPCRtoLFlagBusy(IPC_FLAG10) == 1)
{
//
// Read cpu2RArray and modify cpu2RWArray
//
writeDataCPU2();
IPCRtoLFlagAcknowledge(IPC_FLAG10);
}
}
}
//
// initCPUTimer - This function initializes a CPU Timer to a known state.
//
void
initCPUTimer(uint32_t cpuTimer)
{
//
// Initialize timer period to maximum
//
CPUTimer_setPeriod(cpuTimer, 0xFFFFFFFF);
//
// Initialize pre-scale counter to divide by 1 (SYSCLKOUT)
//
CPUTimer_setPreScaler(cpuTimer, 0);
//
// Make sure timer is stopped
//
CPUTimer_stopTimer(cpuTimer);
//
// Reload all counter registers with period value
//
CPUTimer_reloadTimerCounter(cpuTimer);
}
//
// configCPUTimer - This function initializes the selected timer to the
// period specified by the "freq" and "period" parameters. The "freq" is
// entered as Hz and the period in microseconds. The timer is held in the
// stopped state after configuration.
//
void
configCPUTimer(uint32_t cpuTimer, float freq, float period)
{
uint32_t temp;
//
// Initialize timer period:
//
temp = (uint32_t)(freq / 1000000 * period);
CPUTimer_setPeriod(cpuTimer, temp);
//
// Set pre-scale counter to divide by 1 (SYSCLKOUT):
//
CPUTimer_setPreScaler(cpuTimer, 0);
//
// Initializes timer control register. The timer is stopped, reloaded,
// free run disabled, and interrupt enabled.
//
CPUTimer_stopTimer(cpuTimer);
CPUTimer_reloadTimerCounter(cpuTimer);
CPUTimer_setEmulationMode(cpuTimer,
CPUTIMER_EMULATIONMODE_STOPAFTERNEXTDECREMENT);
CPUTimer_enableInterrupt(cpuTimer);
}
//
// cpuTimer0ISR - CPU Timer0 ISR
//
__interrupt void cpuTimer0ISR(void)
{
GPIO_togglePin(DEVICE_GPIO_PIN_LED1);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
//
// writeDataCPU2 - Read data from cpu2RArray written by CPU01 and modify and
// write into cpu2RWArray. cpu2RArray[0] is used to hold the
// multiplier value.
//
void writeDataCPU2(void)
{
uint16_t index;
uint16_t multiplier;
multiplier = cpu2RArray[0];
cpu2RWArray[0] = multiplier;
for(index = 1; index < 256; index ++)
{
cpu2RWArray[index] = multiplier * cpu2RArray[index];
}
}
//
// End of File
//
@@ -0,0 +1,48 @@
<projectSpec>
<project
name="sci_ex1_echoback_cpu1"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../sci_ex1_echoback_cpu1.c" targetDirectory="" />
</project>
<project
name="sci_ex1_echoback_cpu2"
device="TMS320F28377D"
cgtVersion="22.6.0.LTS"
products="C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
>
<configuration name="CPU2_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="CPU2_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_RAM_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU2_RAM" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/cmd/2837xD_FLASH_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU2_FLASH" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../sci_ex1_echoback_cpu2.c" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,79 @@
<projectSpec>
<project
name="sci_ex2_sysconfig_multi"
configurations="
FLASH,
RAM,
FLASH_LAUNCHPAD,
RAM_LAUNCHPAD
"
device="TMS320F28377D"
outputType="system"
cgtVersion="20.2.1.LTS"
>
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<file path="../system.xml" action="copy" openOnCreation="true"/>
<configuration name="FLASH"
></configuration>
<configuration name="FLASH_LAUNCHPAD"
></configuration>
<configuration name="RAM"
></configuration>
<configuration name="RAM_LAUNCHPAD"
></configuration>
</project>
<project
name="sci_ex2_sysconfig_cpu1"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="FLASH_LAUNCHPAD" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_LAUNCHXL_F28379D --define=_FLASH --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM_LAUNCHPAD" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_LAUNCHXL_F28379D --define=CPU1 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../sci_ex2_sysconfig_cpu1.c" targetDirectory="" />
<file action="copy" path="../sci_ex2_sysconfig_launchpad_cpu1.syscfg" targetDirectory="" applicableConfigurations="FLASH_LAUNCHPAD,RAM_LAUNCHPAD" />
<file action="copy" path="../sci_ex2_sysconfig_cpu1.syscfg" targetDirectory="" applicableConfigurations="FLASH,RAM" />
</project>
<project
name="sci_ex2_sysconfig_cpu2"
device="TMS320F28377D"
cgtVersion="20.2.1.LTS"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
>
<configuration name="FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="FLASH_LAUNCHPAD" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_LAUNCHXL_F28379D --define=_FLASH --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<configuration name="RAM_LAUNCHPAD" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_LAUNCHXL_F28379D --define=CPU2 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib" scope="project" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/F2837xD/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../sci_ex2_sysconfig_cpu2.c" targetDirectory="" />
<file action="copy" path="../sci_ex2_sysconfig_launchpad_cpu2.syscfg" targetDirectory="" applicableConfigurations="FLASH_LAUNCHPAD,RAM_LAUNCHPAD" />
<file action="copy" path="../sci_ex2_sysconfig_cpu2.syscfg" targetDirectory="" applicableConfigurations="FLASH,RAM" />
</project>
</projectSpec>
@@ -0,0 +1,152 @@
//#############################################################################
//
// FILE: sci_ex1_echoback_cpu1.c
//
// TITLE: SCI echoback example.
//
//! \addtogroup driver_example_list
//! <h1>SCI Echoback</h1>
//!
//! This test receives and echo-backs data through the SCI-A port.
//! The SCI-A module control is handed over to CPU2 by CPU1 in this example.
//!
//! A terminal such as 'putty' can be used to view the data from
//! the SCI and to send information to the SCI. Characters received
//! by the SCI port are sent back to the host.
//!
//! \b Running \b the \b Application
//! Open a COM port with the following settings using a terminal:
//! - Find correct COM port
//! - Bits per second = 9600
//! - Data Bits = 8
//! - Parity = None
//! - Stop Bits = 1
//! - Hardware Control = None
//!
//! The program will print out a greeting and then ask you to
//! enter a character which it will echo back to the terminal.
//!
//! \b Watch \b Variables \n
//! - loopCounter - the number of characters sent
//!
//! \b External \b Connections \n
//! Connect the SCI-A port to a PC via a USB cable.
//! Refer to the hardware user guide for the UART/USB connector information.
//
//#############################################################################
// $TI Release: $
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
//
// Defines
//
// Define AUTOBAUD to use the autobaud lock feature
//#define AUTOBAUD
//
// Main
//
void main(void)
{
uint16_t ipcFlag17 = 17U;
//
// Configure PLL, disable WD, enable peripheral clocks.
//
Device_init();
//
// Disable pin locks and enable internal pullups.
//
Device_initGPIO();
//
// Hand-over the SCIA module access to CPU2
//
SysCtl_selectCPUForPeripheral(SYSCTL_CPUSEL5_SCI, 1, SYSCTL_CPUSEL_CPU2);
//
// Configuration for STANDALONE and FLASH mode
//
#ifdef _STANDALONE
#ifdef _FLASH
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
#else
//
// Send boot command to allow the CPU2 application to begin execution
//
Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_RAM);
#endif // _FLASH
#endif // _STANDALONE
//
// Configuration for the SCI Rx pin.
//
GPIO_setPinConfig(DEVICE_GPIO_CFG_SCIRXDA);
//
// Configuration for the SCI Tx pin.
//
GPIO_setPinConfig(DEVICE_GPIO_CFG_SCITXDA);
//
// Sync CPU1 and CPU2. Send IPC flag 17 to CPU2.
//
HWREG(IPC_BASE + IPC_O_SET) = 1UL << ipcFlag17;
//
// Initialize interrupt controller and vector table.
//
Interrupt_initModule();
Interrupt_initVectorTable();
}
//
// End of File
//
@@ -0,0 +1,192 @@
//#############################################################################
//
// FILE: sci_ex1_echoback_cpu2.c
//
// TITLE: SCI echoback example.
//
// This test receives and echo-backs data through the SCI-A port.
// The SCI-A module control is handed over to CPU2 by CPU1 in this example.
//
// A terminal such as 'putty' can be used to view the data from
// the SCI and to send information to the SCI. Characters received
// by the SCI port are sent back to the host.
//
// \b Running \b the \b Application
// Open a COM port with the following settings using a terminal:
// - Find correct COM port
// - Bits per second = 9600
// - Data Bits = 8
// - Parity = None
// - Stop Bits = 1
// - Hardware Control = None
//
// The program will print out a greeting and then ask you to
// enter a character which it will echo back to the terminal.
//
// \b Watch \b Variables \n
// - loopCounter - the number of characters sent
//
// \b External \b Connections \n
// Connect the SCI-A port to a PC via a USB cable.
// Refer to the hardware user guide for the UART/USB connector information.
//
//#############################################################################
// $TI Release: $
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
//
// Defines
//
// Define AUTOBAUD to use the autobaud lock feature
//#define AUTOBAUD
//
// Globals
//
uint16_t loopCounter = 0;
//
// Main
//
void main(void)
{
uint16_t receivedChar;
unsigned char *msg;
uint16_t rxStatus = 0U;
uint16_t ipcFlag17 = 17U;
//
// Configure PLL, disable WD, enable peripheral clocks.
//
Device_init();
//
// Initialize interrupt controller and vector table.
//
Interrupt_initModule();
Interrupt_initVectorTable();
//
// Wait until CPU01 is ready and IPC flag 17 is set
//
while(!(HWREG(IPC_BASE + IPC_O_STS) & (1UL << ipcFlag17)))
{
}
//
// ACK IPC flag 17 for CPU1
//
HWREG(IPC_BASE + IPC_O_ACK) = 1UL << ipcFlag17;
//
// Initialize SCIA and its FIFO.
//
SCI_performSoftwareReset(SCIA_BASE);
//
// Configure SCIA for echoback.
//
SCI_setConfig(SCIA_BASE, DEVICE_LSPCLK_FREQ, 9600, (SCI_CONFIG_WLEN_8 |
SCI_CONFIG_STOP_ONE |
SCI_CONFIG_PAR_NONE));
SCI_resetChannels(SCIA_BASE);
SCI_resetRxFIFO(SCIA_BASE);
SCI_resetTxFIFO(SCIA_BASE);
SCI_clearInterruptStatus(SCIA_BASE, SCI_INT_TXFF | SCI_INT_RXFF);
SCI_enableFIFO(SCIA_BASE);
SCI_enableModule(SCIA_BASE);
SCI_performSoftwareReset(SCIA_BASE);
#ifdef AUTOBAUD
//
// Perform an autobaud lock.
// SCI expects an 'a' or 'A' to lock the baud rate.
//
SCI_lockAutobaud(SCIA_BASE);
#endif
//
// Send starting message.
//
msg = "\r\n\n\nHello World!\0";
SCI_writeCharArray(SCIA_BASE, (uint16_t*)msg, 17);
msg = "\r\nYou will enter a character, and the DSP will echo it back!\n\0";
SCI_writeCharArray(SCIA_BASE, (uint16_t*)msg, 62);
for(;;)
{
msg = "\r\nEnter a character: \0";
SCI_writeCharArray(SCIA_BASE, (uint16_t*)msg, 22);
//
// Read a character from the FIFO.
//
receivedChar = SCI_readCharBlockingFIFO(SCIA_BASE);
rxStatus = SCI_getRxStatus(SCIA_BASE);
if((rxStatus & SCI_RXSTATUS_ERROR) != 0)
{
//
//If Execution stops here there is some error
//Analyze SCI_getRxStatus() API return value
//
ESTOP0;
}
//
// Echo back the character.
//
msg = " You sent: \0";
SCI_writeCharArray(SCIA_BASE, (uint16_t*)msg, 13);
SCI_writeCharBlockingFIFO(SCIA_BASE, receivedChar);
//
// Increment the loop count variable.
//
loopCounter++;
}
}
//
// End of File
//
@@ -0,0 +1,127 @@
//#############################################################################
//
// FILE: sci_ex2_sysconfig_cpu1.c
//
// TITLE: SysConfig SCI echoback example.
//
//! \addtogroup driver_example_list
//! <h1>SCI Echoback</h1>
//!
//! This test receives and echo-backs data through the SCI-A port.
//! The SCI-A module control is handed over to CPU2 by CPU1 in this example.
//!
//! A terminal such as 'putty' can be used to view the data from
//! the SCI and to send information to the SCI. Characters received
//! by the SCI port are sent back to the host.
//!
//! \b Running \b the \b Application
//!
//! If you are using a Launchpad, right-click on each of the multicore projects and select:
//! - Build Configurations > Set Active > [memory_type]_LAUNCHPAD
//!
//! Open a COM port with the following settings using a terminal:
//! - Find correct COM port
//! - Bits per second = 9600
//! - Data Bits = 8
//! - Parity = None
//! - Stop Bits = 1
//! - Hardware Control = None
//!
//! The program will print out a greeting and then ask you to
//! enter a character which it will echo back to the terminal.
//!
//! \b Watch \b Variables \n
//! - loopCounter - the number of characters sent
//!
//! \b External \b Connections \n
//! Connect the SCI-A port to a PC via a USB cable.
//! Refer to the hardware user guide for the UART/USB connector information.
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
#include "board.h"
//
// Defines
//
// Define AUTOBAUD to use the autobaud lock feature
//#define AUTOBAUD
//
// Main
//
void main(void)
{
//
// Configure PLL, disable WD, enable peripheral clocks.
//
Device_init();
//
// Disable pin locks and enable internal pullups.
//
Device_initGPIO();
//
// Initialize SysConfig Settings
//
Board_init();
//
// Sync CPU1 and CPU2. Send IPC flag 17 to CPU2.
//
IPC_sync(IPC_CPU1_L_CPU2_R, IPC_FLAG17);
//
// Initialize interrupt controller and vector table.
//
Interrupt_initModule();
Interrupt_initVectorTable();
}
//
// End of File
//
@@ -0,0 +1,44 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU1" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const sysctl = scripting.addModule("/driverlib/sysctl.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
sysctl.cpuSel_SCIA = "SYSCTL_CPUSEL_CPU2";
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionMemory_binit = ["FLASHA"];
CMD1.sectionAlignEnable_binit = true;
@@ -0,0 +1,175 @@
//#############################################################################
//
// FILE: sci_ex2_sysconfig_cpu2.c
//
// TITLE: SysConfig SCI echoback example.
//
// This test receives and echo-backs data through the SCI-A port.
// The SCI-A module control is handed over to CPU2 by CPU1 in this example.
//
// A terminal such as 'putty' can be used to view the data from
// the SCI and to send information to the SCI. Characters received
// by the SCI port are sent back to the host.
//
// \b Running \b the \b Application
//
// If you are using a Launchpad, right-click on each of the multicore projects and select:
// - Build Configurations > Set Active > [memory_type]_LAUNCHPAD
//
// Open a COM port with the following settings using a terminal:
// - Find correct COM port
// - Bits per second = 9600
// - Data Bits = 8
// - Parity = None
// - Stop Bits = 1
// - Hardware Control = None
//
// The program will print out a greeting and then ask you to
// enter a character which it will echo back to the terminal.
//
// \b Watch \b Variables \n
// - loopCounter - the number of characters sent
//
// \b External \b Connections \n
// Connect the SCI-A port to a PC via a USB cable.
// Refer to the hardware user guide for the UART/USB connector information.
//
//#############################################################################
//
//
// $Copyright:
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
//
// 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.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "inc/hw_ipc.h"
#include "board.h"
//
// Defines
//
// Define AUTOBAUD to use the autobaud lock feature
//#define AUTOBAUD
//
// Globals
//
uint16_t loopCounter = 0;
//
// Main
//
void main(void)
{
uint16_t receivedChar;
unsigned char *msg;
uint16_t rxStatus = 0U;
//
// Configure PLL, disable WD, enable peripheral clocks.
//
Device_init();
//
// Initialize interrupt controller and vector table.
//
Interrupt_initModule();
Interrupt_initVectorTable();
//
// Wait until CPU01 is ready and syncs with IPC flag 17
//
IPC_sync(IPC_CPU2_L_CPU1_R, IPC_FLAG17);
//
// Initialize SysConfig Settings
//
Board_init();
#ifdef AUTOBAUD
//
// Perform an autobaud lock.
// SCI expects an 'a' or 'A' to lock the baud rate.
//
SCI_lockAutobaud(SCIA_BASE);
#endif
//
// Send starting message.
//
msg = "\r\n\n\nHello World!\0";
SCI_writeCharArray(SCIA_BASE, (uint16_t*)msg, 17);
msg = "\r\nYou will enter a character, and the DSP will echo it back!\n\0";
SCI_writeCharArray(SCIA_BASE, (uint16_t*)msg, 62);
for(;;)
{
msg = "\r\nEnter a character: \0";
SCI_writeCharArray(SCIA_BASE, (uint16_t*)msg, 22);
//
// Read a character from the FIFO.
//
receivedChar = SCI_readCharBlockingFIFO(SCIA_BASE);
rxStatus = SCI_getRxStatus(SCIA_BASE);
if((rxStatus & SCI_RXSTATUS_ERROR) != 0)
{
//
//If Execution stops here there is some error
//Analyze SCI_getRxStatus() API return value
//
ESTOP0;
}
//
// Echo back the character.
//
msg = " You sent: \0";
SCI_writeCharArray(SCIA_BASE, (uint16_t*)msg, 13);
SCI_writeCharBlockingFIFO(SCIA_BASE, receivedChar);
//
// Increment the loop count variable.
//
loopCounter++;
}
}
//
// End of File
//
@@ -0,0 +1,50 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU2" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const sci = scripting.addModule("/driverlib/sci.js", {}, false);
const sci1 = sci.addInstance();
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
sci1.$name = "mySCI0";
sci1.baudRates = 9600;
sci1.useInterrupts = false;
sci1.sci.$assign = "SCIA";
sci1.sci.scirxdPin.$assign = "GPIO28";
sci1.sci.scitxdPin.$assign = "GPIO29";
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionMemory_binit = ["FLASHA"];
CMD1.sectionAlignEnable_binit = true;
@@ -0,0 +1,44 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU1" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const sysctl = scripting.addModule("/driverlib/sysctl.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
sysctl.cpuSel_SCIA = "SYSCTL_CPUSEL_CPU2";
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionMemory_binit = ["FLASHA"];
CMD1.sectionAlignEnable_binit = true;
@@ -0,0 +1,56 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2837xD" --package "F2837xD_337ZWT" --part "F2837xD_337ZWT" --context "CPU2" --product "C2000WARE@4.03.00.00"
* @versions {"tool":"1.15.999+71"}
*/
/**
* Import the modules used in this configuration.
*/
const sci = scripting.addModule("/driverlib/sci.js", {}, false);
const sci1 = sci.addInstance();
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
sci1.$name = "mySCI0";
sci1.baudRates = 9600;
sci1.useInterrupts = false;
sci1.sci.$assign = "SCIA";
CMD.activateCMD = true;
CMD1.$name = "CMD0";
CMD1.sectionMemory_text = ["FLASHB","FLASHC","FLASHD","FLASHE"];
CMD1.sectionAlignEnable_text = true;
CMD1.sectionMemory_ramfunc = ["FLASHD"];
CMD1.sectionRunFromDifferentAddr_ramfunc = true;
CMD1.sectionRun_ramfunc = ["RAMLS0"];
CMD1.sectionAlignEnable_ramfunc = true;
CMD1.sectionMemory_ovly = ["FLASHA"];
CMD1.sectionAlignEnable_ovly = true;
CMD1.sectionMemory_cinit = ["FLASHA"];
CMD1.sectionAlignEnable_cinit = true;
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["FLASHB"];
CMD1.sectionAlignEnable_init_array = true;
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["FLASHF"];
CMD1.sectionAlignEnable_const = true;
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["FLASHA"];
CMD1.sectionAlignEnable_switch = true;
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD1.sectionMemory_binit = ["FLASHA"];
CMD1.sectionAlignEnable_binit = true;
/**
* Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
* re-solve from scratch.
*/
sci1.sci.scirxdPin.$suggestSolution = "GPIO43";
sci1.sci.scitxdPin.$suggestSolution = "GPIO42";
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<system>
<project configuration="@match" id="project_0" name="sci_ex2_sysconfig_cpu1">
</project>
<core id="C28xx_CPU1" project="project_0"/>
<project configuration="@match" id="project_1" name="sci_ex2_sysconfig_cpu2">
</project>
<core id="C28xx_CPU2" project="project_1"/>
<preBuildSteps>
</preBuildSteps>
<postBuildSteps>
</postBuildSteps>
</system>