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,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>