Update repo
This commit is contained in:
1 parent
749dab5721
commit
ce65a0f59a
14950 files changed
+4408250
-1
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="cm_common_config_c28x"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.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 --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --define RAM --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200" />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../c28x/cm_common_config_c28x/cm_common_config_c28x.c" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,25 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="udma_ex1_software_trigger"
|
||||
device="Cortex M.TMS320F28388D"
|
||||
cgtVersion="20.2.7.LTS"
|
||||
products="C2000WARE"
|
||||
endianness="little"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
>
|
||||
<configuration name="CM_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -mv7M4 --define=DEBUG --float_support=none --diag_warning=225" linkerBuildOptions="--stack_size=512 --heap_size=1024 --library=libc.a" />
|
||||
<configuration name="CM_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -mv7M4 --define=DEBUG --float_support=none --diag_warning=225" linkerBuildOptions="--stack_size=512 --heap_size=1024 --library=libc.a" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib_cm/" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib_cm.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/cm.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/cm.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cm.cmd" targetDirectory="" applicableConfigurations="CM_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cm.cmd" targetDirectory="" applicableConfigurations="CM_FLASH" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib_cm/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib_cm/ccs/Debug/driverlib_cm.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/startup_cm.c" targetDirectory="" />
|
||||
<file action="copy" path="../udma_ex1_software_trigger.c" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="udma_ex2_scatter_gather_mode"
|
||||
device="Cortex M.TMS320F28388D"
|
||||
cgtVersion="20.2.7.LTS"
|
||||
products="C2000WARE"
|
||||
endianness="little"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
>
|
||||
<configuration name="CM_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -mv7M4 --define=DEBUG --float_support=none --diag_warning=225" linkerBuildOptions="--stack_size=512 --heap_size=1024 --library=libc.a" />
|
||||
<configuration name="CM_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -mv7M4 --define=DEBUG --float_support=none --diag_warning=225" linkerBuildOptions="--stack_size=512 --heap_size=1024 --library=libc.a" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib_cm/" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib_cm.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/cm.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/cm.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cm.cmd" targetDirectory="" applicableConfigurations="CM_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cm.cmd" targetDirectory="" applicableConfigurations="CM_FLASH" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib_cm/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib_cm/ccs/Debug/driverlib_cm.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/startup_cm.c" targetDirectory="" />
|
||||
<file action="copy" path="../udma_ex2_scatter_gather_mode.c" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,131 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: udma_ex1_software_trigger.c
|
||||
//
|
||||
// TITLE: uDMA RAM to RAM transfer using software trigger
|
||||
//
|
||||
//! \addtogroup driver_example_cm_list
|
||||
//! <h1>uDMA RAM to RAM transfer</h1>
|
||||
//!
|
||||
//! This example showcases how to use uDMA to transfer data from one RAM
|
||||
//! location to another using software trigger.
|
||||
//!
|
||||
//! This configures the UDMA in AUTO mode and transfers 32-bit words from
|
||||
//! one location to another using Channel 30. Software trigger is being used
|
||||
//! here. Once the transfer is completed, a check of the validity of the data
|
||||
//! will be performed in the uDMA ISR.
|
||||
//!
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - None
|
||||
//!
|
||||
//! \b Watch \b Variables \n
|
||||
//! - \b srcData - Source
|
||||
//! - \b destData - Destination
|
||||
//! - \b errCount - Error count
|
||||
//!
|
||||
//
|
||||
//#############################################################################
|
||||
|
||||
#include "cm.h"
|
||||
|
||||
#define TRANSFER_SIZE 20
|
||||
|
||||
|
||||
void udmaISR(void);
|
||||
|
||||
uint32_t srcData[TRANSFER_SIZE], destData[TRANSFER_SIZE];
|
||||
uint8_t errCount = 0xFF;
|
||||
|
||||
#pragma DATA_ALIGN(ucControlTable, 1024)
|
||||
UDMA_ControlTable ucControlTable[64];
|
||||
|
||||
//
|
||||
// Main
|
||||
//
|
||||
void main(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
//
|
||||
// Enable peripheral clocks
|
||||
//
|
||||
CM_init();
|
||||
|
||||
//
|
||||
// Initialize the source and destination arrays
|
||||
//
|
||||
for(i = 0; i < TRANSFER_SIZE; i++)
|
||||
{
|
||||
srcData[i] = i;
|
||||
destData[i] = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Enable the uDMA controller.
|
||||
//
|
||||
UDMA_enable(UDMA_BASE);
|
||||
|
||||
//
|
||||
// Point at the control table to use for channel control structures.
|
||||
//
|
||||
UDMA_setControlBase(UDMA_BASE, ucControlTable);
|
||||
|
||||
//
|
||||
// Enable interrupts from the uDMA software channel.
|
||||
//
|
||||
UDMA_registerInterrupt(UDMA_SW_INT, udmaISR);
|
||||
|
||||
//
|
||||
// Put the attributes in a known state for the uDMA software channel.
|
||||
// These should already be disabled by default.
|
||||
//
|
||||
UDMA_disableChannelAttribute(UDMA_BASE, UDMA_CHANNEL_SW_CH30, UDMA_CH_ATTR_ALL);
|
||||
|
||||
//
|
||||
// Configure the control parameters for the SW channel. The SW channel
|
||||
// will be used to transfer between two memory buffers, 32 bits at a time.
|
||||
// Therefore the data size is 32 bits, and the address increment is 32 bits
|
||||
// for both source and destination. The arbitration size will be set to 4,
|
||||
// which causes the uDMA controller to rearbitrate after 8 items are
|
||||
// transferred. This keeps this channel from hogging the uDMA controller
|
||||
// once the transfer is started, and allows other channels cycles if they
|
||||
// are higher priority.
|
||||
//
|
||||
UDMA_setChannelControlParams(UDMA_BASE, UDMA_CHANNEL_SW_CH30,
|
||||
UDMA_SIZE_32 | UDMA_SRC_INC_32 | UDMA_DST_INC_32
|
||||
| UDMA_ARB_4);
|
||||
|
||||
//
|
||||
// Set up the transfer parameters for the software channel. This will
|
||||
// configure the transfer buffers and the transfer size. Auto mode must be
|
||||
// used for software transfers.
|
||||
//
|
||||
UDMA_setChannelTransferParams(UDMA_BASE, UDMA_CHANNEL_SW_CH30,
|
||||
srcData, destData, UDMA_MODE_AUTO, TRANSFER_SIZE);
|
||||
|
||||
//
|
||||
// Now the software channel is primed to start a transfer. The channel
|
||||
// must be enabled. For software based transfers, a request must be
|
||||
// issued. After this, the uDMA memory transfer begins.
|
||||
//
|
||||
UDMA_enableChannel(UDMA_BASE, UDMA_CHANNEL_SW_CH30);
|
||||
UDMA_requestSoftwareTransfer(UDMA_BASE, UDMA_CHANNEL_SW_CH30);
|
||||
|
||||
while(1);
|
||||
}
|
||||
|
||||
__interrupt void udmaISR(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
errCount = 0;
|
||||
|
||||
for(i = 0; i < TRANSFER_SIZE; i++)
|
||||
{
|
||||
if(srcData[i] != destData[i])
|
||||
{
|
||||
errCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: udma_ex2_scatter_gather_mode.c
|
||||
//
|
||||
// TITLE: uDMA RAM to RAM transfer using scatter gather mode
|
||||
//
|
||||
//! \addtogroup driver_example_cm_list
|
||||
//! <h1>uDMA RAM to RAM transfer</h1>
|
||||
//!
|
||||
//! This example showcases how to configure uDMA in memory scatter-gather mode
|
||||
//! and transfer data from varied locations in memory rather than a set of
|
||||
//! contiguous locations in a memory buffer.
|
||||
//!
|
||||
//! This example creates an array of structs of length 20. The struct includes
|
||||
//! a header element and a data element, each of length 10. The UDMA is
|
||||
//! configured to tranfer only the data element from all the 20 data packets.
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - None
|
||||
//!
|
||||
//! \b Watch \b Variables \n
|
||||
//! - \b packets - 'data' element contains the actual data to be transferred
|
||||
//! - \b consolidatedData - Destination buffer where the data is transferred to
|
||||
//! - \b errCount - Error count
|
||||
//!
|
||||
//
|
||||
//#############################################################################
|
||||
|
||||
#include "cm.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
#pragma DATA_ALIGN(ucControlTable, 1024)
|
||||
UDMA_ControlTable ucControlTable[64];
|
||||
|
||||
#define DATA_LENGTH 10
|
||||
#define HEADER_LENGTH 10
|
||||
#define TOTAL_NO_OF_PACKETS 20
|
||||
|
||||
//
|
||||
// Define a data packet struct that includes a header and data.
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
uint32_t header[HEADER_LENGTH];
|
||||
uint32_t data[DATA_LENGTH];
|
||||
}DataPacket_t;
|
||||
|
||||
//
|
||||
// Create an array of data packet struct of length 5
|
||||
//
|
||||
DataPacket_t packets[TOTAL_NO_OF_PACKETS];
|
||||
|
||||
//
|
||||
// Memory buffer where the uDMA copies the data
|
||||
//
|
||||
uint32_t consolidatedData[TOTAL_NO_OF_PACKETS * DATA_LENGTH];
|
||||
|
||||
//
|
||||
// uDMA task list used for scatter gather mode
|
||||
//
|
||||
UDMA_ControlTable tasklist[TOTAL_NO_OF_PACKETS];
|
||||
|
||||
uint32_t errCount;
|
||||
|
||||
//
|
||||
// Main
|
||||
//
|
||||
void main(void)
|
||||
{
|
||||
uint32_t i,j;
|
||||
|
||||
//
|
||||
// Enable peripheral clocks
|
||||
//
|
||||
CM_init();
|
||||
|
||||
//
|
||||
// Initialize the data package with dummy data
|
||||
//
|
||||
for(i = 0; i < TOTAL_NO_OF_PACKETS; i++)
|
||||
{
|
||||
//
|
||||
// Header is filled with random integers and the data is filled
|
||||
// with integers in sequence to check at the end.
|
||||
//
|
||||
for(j = 0; j < HEADER_LENGTH; j++)
|
||||
{
|
||||
packets[i].header[j] = rand();
|
||||
}
|
||||
for(j = 0; j < DATA_LENGTH; j++)
|
||||
{
|
||||
packets[i].data[j] = (i * DATA_LENGTH) + j;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Enable the uDMA controller.
|
||||
//
|
||||
UDMA_enable(UDMA_BASE);
|
||||
|
||||
//
|
||||
// Point at the control table to use for channel control structures.
|
||||
//
|
||||
UDMA_setControlBase(UDMA_BASE, ucControlTable);
|
||||
|
||||
//
|
||||
// Configure the task list
|
||||
// Each task is configured for transferring the data element of a single
|
||||
// data packet.
|
||||
// Item size, source address increment, destination address increment is
|
||||
// set as 32 and the data is collected in the memory buffer consolidatedData
|
||||
// in a continuous manner
|
||||
//
|
||||
for(i = 0; i < TOTAL_NO_OF_PACKETS; i++)
|
||||
{
|
||||
UDMA_ControlTable task =
|
||||
UDMA_TASK_STRUCT_ENTRY(DATA_LENGTH, // Transfer count
|
||||
UDMA_SIZE_32, // Item size
|
||||
UDMA_SRC_INC_32, // Src Increment
|
||||
packets[i].data, // Src Address
|
||||
UDMA_DST_INC_32, // Dst Increment
|
||||
&consolidatedData[i * DATA_LENGTH], // Dst Address
|
||||
UDMA_ARB_8, // Arbitration
|
||||
UDMA_MODE_MEM_SCATTER_GATHER); // Transfer Mode
|
||||
|
||||
memcpy(&tasklist[i], &task, sizeof(task));
|
||||
}
|
||||
|
||||
//
|
||||
// Configure channel 0 for memory scatter gather mode.
|
||||
//
|
||||
UDMA_setChannelScatterGatherMode(UDMA_BASE, UDMA_CHANNEL_30,
|
||||
TOTAL_NO_OF_PACKETS, tasklist, false);
|
||||
|
||||
//
|
||||
// Now the software channel is primed to start a transfer. The channel
|
||||
// must be enabled. For software based transfers, a request must be
|
||||
// issued. After this, the uDMA memory transfer begins.
|
||||
//
|
||||
UDMA_enableChannel(UDMA_BASE, UDMA_CHANNEL_30);
|
||||
UDMA_requestSoftwareTransfer(UDMA_BASE, UDMA_CHANNEL_30);
|
||||
|
||||
//
|
||||
// Wait until the transfer is complete
|
||||
//
|
||||
while(UDMA_isChannelEnabled(UDMA_BASE, UDMA_CHANNEL_30));
|
||||
|
||||
//
|
||||
// Check the transferred data
|
||||
//
|
||||
for(i = 0; i < TOTAL_NO_OF_PACKETS * DATA_LENGTH; i++)
|
||||
{
|
||||
if(consolidatedData[i] != i)
|
||||
{
|
||||
errCount++;
|
||||
}
|
||||
}
|
||||
while(1);
|
||||
}
|
||||
Reference in new issue
Block a user