This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

need vcp2 with edma3 config details for 6638 K2k

Other Parts Discussed in Thread: SYSBIOS, TEST2

Hi,


My application need vcp2 support on 6638 platfrom. I am building an application based on 6657 example.  The code configures edma channels and vcp2.. I had hard time aligning the csl definition for 6638. I have create a version that buids with my project. But when trying on the 6638 platform i dont get vcp2 result. 

Please have a look at the attached and help me,


Regards

anilVCP.7z

  • Hi,

    Thanks for your post.

    We do not have reference VCP2 example project to use "as-is" for 6638 platform. There are pointers available for CSL API source to instantiate EDMA device as below:

    ~\pdk_k2hk_4_0_0\packages\ti\csl\src\ip\edma\V0
    ~\pdk_k2hk_4_0_0\packages\ti\csl\src\ip\edma\V1\priv\edma.c

    Likewise, there are CSL API available for VCP2 implementation for 6638 platform as below:
    ~\pdk_k2hk_4_0_0\packages\ti\csl\src\ip\vcp2\V0\csl_vcp2
    ~\pdk_k2hk_4_0_0\packages\ti\csl\src\ip\vcp2\V1\csl_vcp2

    I think, you could use the above API reference source for EDMA and VCP2 IP device in orderto validate the configuration for the same in your custom project on 6638 platform.

    Thanks & regards,
    Sivaraj K
  • Hi Shivaraj,

    Thanks for support.

    Currently I am using “pdk_keystone2_3_01_04_07” package,
    VCP2 sample code taken from ti folder. “C:\ti\pdk_keystone2_3_01_04_07\packages\ti\instrumentation\fault_mgmt\test\src\tci6614\cleanup_test\vcp2_src”
    VCP2 test project is created and able to build the code and testing on TCI6638 K2K board, VPC2 output results are getting incorrect we are getting zeros.
    Questions:
    1. VCP2 output results at “decisions” are zero and out “outParams” also zero. Please let me now any steps am missing .
    2. In the vcp2_test.c file Setup_Interrupt() function commented not using, do I need to enable the “Setup_Interrupt()” function ? code given below.
    // Setup_Interrupt();
    //Enable INterrupts and Channels
    edma3MultChnlEnable(coreNum);
    return;
    Reference code is attached. Please provide input on this. I tried on multiple setups behavior is same.
  • Hi Anil,

    Please look at the C6670 VCP2 example provided in the following thread. While the example is not ported to 6638, you should be able to do so easily as both C6670 and 6638 are Keystone family devices. You should be able to run the example on C6670 (or TCI6618) device EVM if you happen to have one.

    e2e.ti.com/.../225502

    Regards
    -Nitin
  • Hi Nitin,

    Thanks a lot for support,

    I am not able to open given link “e2e.ti.com/.../225502” I don’t have access getting error message “Access Denied” “You do not have permission to view/download this item.” Please provide the access to following link.

    I am looking at C6670 VCP2 example code, trying to run on TCI6638K2K processor.

    Thanks & regards,
    Anil Kumar
  • Hi Nitin,

    I am trying to build VCP2 code on TCI6638 processor, Example code taken from the link gforge.ti.com/.../BER.zip, Some of the macros are not found in the “cslr_device.h” files. TCI6638K2K packages “pdk_keystone2_3_01_04_07”

    These macros are un defined in “cslr_device.h” files.
    1. CSL_INTC0_CPU_3_2_TPCCINT0
    2. CSL_INTC0_VCP0INT
    3. CSL_PSC_LPSC_VCP2_A
    4. CSL_PSC_LPSC_VCP2_B
    5. .CSL_TPCC2_VCP0REVT
    6. CSL_TPCC2_VCP0XEVT

    For the these macros what equivalent I need use for TCI6638K2K processor. Please help on this.

    Thanks & regards,
    Anil Kumar
  • Hi Nitin,

    I am trying to build VCP2 code on TCI6638 processor, Example code taken from the link gforge.ti.com/.../BER.zip, Some of the macros are not found in the “cslr_device.h” files. TCI6638K2K packages “pdk_keystone2_3_01_04_07”

    These macros are un defined in “cslr_device.h” files.
    1. CSL_INTC0_CPU_3_2_TPCCINT0
    2. CSL_INTC0_VCP0INT
    3. CSL_PSC_LPSC_VCP2_A
    4. CSL_PSC_LPSC_VCP2_B
    5. .CSL_TPCC2_VCP0REVT
    6. CSL_TPCC2_VCP0XEVT

    For the these macros what equivalent I need use for TCI6638K2K processor. Please help on this.

    Thanks & regards,
    Anil Kumar
  • Hi Anil,

    I've attached the example from the aforementioned thread here.

    Regards

    -Nitin

    4010.vcp2example.zip

  • Hi Nitin,

    Thanks a lot,

    I am able to download the code and it is building when I am using “SOC_C6657” in the soc.h file,

    It is not building when I am trying to use SOC_K2K in the soc.h file. some of the macros are undefined, those macros are not defined in the “cslr_device.h”  for K2K device.

    Following macros are shown below, please help on this what equivalent macros i need use for K2K Device to build and run the code. I am waiting for your reply.

    identifier "CSL_EDMA3_TPCC2_NUM_DMACH"

    identifier "CSL_INTC0_CPU_3_2_TPCCINT0"

    identifier "CSL_INTC0_CPU_3_2_TPCCINT0"

    identifier "CSL_INTC0_CPU_3_2_TPCCINT1"

    identifier "CSL_INTC0_CPU_3_2_TPCCINT2"

    identifier "CSL_INTC0_CPU_3_2_TPCCINT3"

    identifier "CSL_INTC0_VCP0INT"

    identifier "CSL_INTC0_VCP0INT"

    identifier "CSL_INTC0_VCP1INT"

    identifier "CSL_TPCC_2"

    identifier "CSL_TPCC_2"

    identifier "CSL_TPCC_2"

    identifier "CSL_TPCC_2"

    identifier "CSL_TPCC_2"

    identifier "CSL_TPCC_2"

    identifier "CSL_TPCC_2"

    identifier "CSL_TPCC_2"

    identifier "CSL_TPCC2_VCP0REVT"

    identifier "CSL_TPCC2_VCP0REVT"

    identifier "CSL_TPCC2_VCP0REVT"

    identifier "CSL_TPCC2_VCP0REVT"

    identifier "CSL_TPCC2_VCP0REVT"

    identifier "CSL_TPCC2_VCP0REVT"

    identifier "CSL_TPCC2_VCP0REVT"

    identifier "CSL_TPCC2_VCP0REVT"

    identifier "CSL_TPCC2_VCP0REVT"

    identifier "CSL_TPCC2_VCP0XEVT"

    identifier "CSL_TPCC2_VCP0XEVT"

    identifier "CSL_TPCC2_VCP0XEVT"

    identifier "CSL_TPCC2_VCP0XEVT"

    identifier "CSL_TPCC2_VCP0XEVT"

    identifier "CSL_TPCC2_VCP0XEVT"

    identifier "CSL_TPCC2_VCP0XEVT"

    identifier "CSL_TPCC2_VCP0XEVT"

    identifier "CSL_TPCC2_VCP0XEVT"

    identifier "CSL_VCP2_A_DATA_REGS"

    identifier "CSL_VCP2_A_DATA_REGS"

    identifier "CSL_VCP2_A_DATA_REGS"

    identifier "CSL_VCP2_A"

    FILE.7z

    Thanks & regards

    Anil Kumar

  • Hi Anil,

    The corresponding K2K csl definitions from pdk_keystone2_3_01_04_07 are given below:

    CSL_EDMA3_TPCC2_NUM_DMACH : CSL_EDMACC_2_NUM_DMACH (device\k2k\src\cslr_device.h)
    CSL_INTC0_CPU_3_2_TPCCINT0 : CSL_CIC0_EDMACC_2_TC_0_INT (device\k2k\src\csl_device_interrupt.h)
    CSL_INTC0_CPU_3_2_TPCCINT1 : CSL_CIC0_EDMACC_2_TC_1_INT (device\k2k\src\csl_device_interrupt.h)
    CSL_INTC0_CPU_3_2_TPCCINT2 : CSL_CIC0_EDMACC_2_TC_2_INT (device\k2k\src\csl_device_interrupt.h)
    CSL_INTC0_CPU_3_2_TPCCINT3 : CSL_CIC0_EDMACC_2_TC_3_INT (device\k2k\src\csl_device_interrupt.h)
    CSL_INTC0_VCP0INT : CSL_CIC0_VCP_0_INT0 (device\k2k\src\csl_device_interrupt.h)
    CSL_INTC0_VCP1INT : CSL_CIC0_VCP_1_INT0 (device\k2k\src\csl_device_interrupt.h)
    CSL_TPCC_2 : CSL_EDMA3CC_2 (device\k2k\src\cslr_device.h)
    CSL_TPCC2_VCP0REVT : CSL_EDMACC_2_VCP_0_REVT0 (device\k2k\src\csl_device_interrupt.h)
    CSL_TPCC2_VCP0XEVT : CSL_EDMACC_2_VCP_0_XEVT0 (device\k2k\src\csl_device_interrupt.h)
    CSL_VCP2_A_DATA_REGS : CSL_VCP_0_DATA_REGS (device\k2k\src\cslr_device.h)
    CSL_VCP2_A : CSL_VCP_0 (device\k2k\src\cslr_device.h)
    CSL_PSC_LPSC_VCP2_A : CSL_PSC_LPSC_VCP_0 (device\k2k\src\cslr_device.h)
    CSL_PSC_LPSC_VCP2_B : CSL_PSC_LPSC_VCP_1 (device\k2k\src\cslr_device.h)

    -Nitin

  • Hi Nitin,

    Thanks a lot for reply,

    I am able to get some of the macros from K2K csl definitions pdk_keystone2_3_01_04_07 package, still some of the macros are missing I am not able to build the code,

     Macro “CSL_TPCC_2” which equivalent for K2K is “CSL_EDMA3CC_2“  which you given CSL_TPCC_2: CSL_EDMA3CC_2 (device\k2k\src\cslr_device.h), “CSL_EDMA3CC_2” undefined in the “cslr_device.h” file.

     Macros are shown below, please help on this what equivalent macros i need use for K2K Device to build and run the code. I am waiting for your reply.

     identifier "CSL_CP_INTC_0" is undefined 

    identifier "CSL_TPCC_2" is undefined           

    identifier "CSL_GEM_INTC0_OUT_8_PLUS_16_MUL_N" is undefined

    identifier "CSL_GEM_INTC0_OUT_9_PLUS_16_MUL_N" is undefined

    identifier "CSL_INTC0_VCP2INT" is undefined    

    identifier "CSL_INTC0_VCP3INT" is undefined    

    identifier "CSL_PSC_PD_PD_VCP_BCD" is undefined    

    identifier "CSL_TPCC_2" is undefined        

    identifier "CSL_TPCC_2" is undefined        

    identifier "CSL_TPCC_2" is undefined        

    identifier "CSL_TPCC_2" is undefined        

    identifier "CSL_TPCC_2" is undefined        

    identifier "CSL_TPCC_2" is undefined        

    identifier "CSL_TPCC_2" is undefined        

    identifier "CSL_TPCC_2" is undefined        

    identifier "CSL_VCP2_D" is undefined

    File_June_10.7z

    Thanks & regards,

    Anil Kumar

  • CSL_EDMA3CC_2 was a typo. It's CSL_EDMACC_2 (line 541).

    CSL_CP_INTC_0 -> CSL_CIC_0 (CP_INTC was renamed to CIC in K2K)
    CSL_TPCC_2 -> CSL_EDMACC_2 (note the typo listed above)
    CSL_GEM_INTC0_OUT_8_PLUS_16_MUL_N -> CSL_C66X_COREPAC_CIC_OUT8_PLUS_16_MUL_N
    CSL_GEM_INTC0_OUT_9_PLUS_16_MUL_N -> CSL_C66X_COREPAC_CIC_OUT9_PLUS_16_MUL_N
    CSL_INTC0_VCP2INT -> CSL_CIC0_VCP_0_INT2
    CSL_INTC0_VCP3INT -> CSL_CIC0_VCP_0_INT3
    CSL_PSC_PD_PD_VCP_BCD -> CSL_PSC_PD_VCP_0123 (and/or CSL_PSC_PD_VCP_4567 for VCPs 4, 5, 6, & 7 as there are 8 VCPs on K2K)
    CSL_TPCC_2 -> Already defined above
    CSL_TPCC_2 -> Already defined above
    CSL_TPCC_2 -> Already defined above
    CSL_TPCC_2 -> Already defined above
    CSL_TPCC_2 -> Already defined above
    CSL_TPCC_2 -> Already defined above
    CSL_TPCC_2 -> Already defined above
    CSL_TPCC_2 -> Already defined above
    CSL_VCP2_D -> CSL_VCP_3 (A->0, B->1, C->2, D->3 and 4, 5, 6, 7 for the other 4 VCPs on K2K)

    I would again suggest you to use the example code I provided in this thread (rather than using the BER example) as porting the C6670 example to C6638K2K should be easier.

    -Nitin

  • Hi Nitin, 

    Thanks a lot for your support,

    I am using example code which you provided in this thread, I got all the macros for K2K csl definitions from pdk_keystone2_3_01_04_07 package, able to build the code and running on hardware TCI6638 K2K.

    Following observation found while running on hardware, 

    1. Enabling VCP2 is done successfully.
    2. VCP2_init called and we got handle for VCP2 instance.
    3. EDMA3 Initialization done success fully.
    4. VCP2_genIc function called and updated input parameters.
    5. EDMA Channels setup done for VCP Processing.
    6. Enabling the DMA & VCP Interrupts done.
    7. We are running “VCP2_start” function, in the CSL_Vcp2EdmaRegs structure values are not updated in the fields all values are seen zero for “VCPIC0” and “VCPIC1”, “VCPIC2”, “VCPIC3”, “VCPIC4”, “VCPIC5”, and in the CSL_Vcp2ConfigRegs structure variable “VCPSTAT0” set to “0x00000018 (Hex) from the VCP2 architecture document it indicates “IFEMP :1 -> Input FIFO buffer is empty”. And “WIC :1-> “Waiting for input configuration words.”

    * Please help on this to resolve the issue might be having some configuration issue. I am waiting for your reply.

     

     Thanks & regards,

    Anil Kumar

  • Hi Nitin,

    I am waiting for your reply,

    We are stuck here not able to proceed further on VCP2 testing, please provide input.

    Thanks & regards,
    Anil Kumar
  • Anil,

    I have ported the C6670 example provided earlier to 6638 K2K as attached. It uses 4 of the 8 VCP2 instances available on K2K. The build instructions are available in the included ReadMe.txt.

    I have tested it on single core (core-0) as well as simultaneously on 4 cores  and it passed. When run on Core-0, it produces the following output:

    [Core0][doVCP2Test]: Enabling VCP2-0

    [Core0][doVCP2Test]: Enabling VCP2-1

    [Core0][doVCP2Test]: Enabling VCP2-2

    [Core0][doVCP2Test]: Enabling VCP2-3

    Test Result : Passed

    -Nitin

    vcp2example_K2K.zip

  • Hi Nitin,

    Thanks a lot for your support,

    I am able to run the VCP2 example code on 6638K2K hardware, which you given in the thread, results are passed for 4VCP2 instances. 

    [Core0][doVCP2Test]: Enabling VCP2-0

    [Core0][doVCP2Test]: Enabling VCP2-1

    [Core0][doVCP2Test]: Enabling VCP2-2

    [Core0][doVCP2Test]: Enabling VCP2-3

    Test Result : Passed

     

    In my application am using 8 VCP2 instances, I made changes for power on 8 VPC2, power done success full, power code changes attached.

    Please help me still what are the changes required to run 8VCP2 instances. please provide the inputs, I am waiting for your reply.

    vcp2_test.7z

    Thanks & regards,

    Anil Kumar 

  • Anil,

    Besides enabling power for VCPs 4 to 7, you'll also need to extend the EDMA interrupt setup in SetupInterrupt.c and need to modify the various arrays defined in vcpTest.c (e.g. Output decisions and parameters arrays) to 8 VCPs as these are currently setup for 4 VCPs. This is a working example with 4 VCPs already being used and extending it to use 8 VCPs is trivial so I would suggest you to understand the example code to make these changes.

    -Nitin  

  • Hi Nitin,

    Thanks a lot,

    According to my understanding  following changes are done for running 8VCP2 instances, 

    Still I am not able to run the 8vcp2 instances please need your help, following files are changed. 

    1. In “vcp2_testInit.h” file before we are using “CSL_EDMACC_2” for 4 vcp2 Data Configuration and 4 for register configuration, Now I am using “CSL_EDMACC_3” for 8 vcp2 Data Configuration and 8 for register configuration.
    2. In “vcp2_edma.c” file for the 4vcp2 instances we are using “CSL_EDMACC_2” now I am using CSL_EDMACC_3” for 8vcp2 instances.
    3. In “vcp2_interrupt.c” file mapping of EDMA completion and VCP error system interrupts (channels) done for 8vcp2 instances.
    4. In the “vcp2_test.c” file vcp2 power enabling changes are done for 8 vcp2 instances.

     After doing the above changes we seen following observations. 

    1. For 8vcp2 instances power on done success fully,
    2. First four 4vcp2 are running fine, results are passed.
    3. Next four 4vcp2 are running able to configure Data and Register configuration done success fully, It is waiting in while loop to get the out data, screen picture shown below and modification code shared, 

    Please help me still what are changes required to run 8vcp2 instances, please do the need full waiting for your reply. 

    vcp2example_K2K.7z

    Thanks & regards,

    Anilkumar 

  • Hi Nitin,

    Waiting for you reply, I am not able to proceed further for running 8VCP2 instances.   Please provide inputs.

    Thanks & regards,

    Anil Kumar 

  • Anil,

    Here's what you need to do to use VCPs 4 to 7:

    1. If you look at the interrupt mapping defined in 6638_K2K data sheet and correspondingly the k2k csl_device_interrupt.h, you'll see that the transmit and receive events for VCP IDs 4-7 are mapped to EDMACC_3 while we are using EDMACC_2 for VCPs 0-3. However, the good news is that VCPs 0-3 are also mapped to EDMACC_3 as shown in the relevant section below from cslr_device_interrupt.h. (I have pasted the definitions for both EDMACC2 and 3 to show the difference pointed here. The currently used ones are in RED and striken out to emphasize that you need to replace these). So you need to move the EDMA setup code to use EDMACC_3.

    cslr_device_interrupt.h
    ------------------------
    #define CSL_EDMACC_2_VCP_0_REVT0 (0x00000033)
    #define CSL_EDMACC_2_VCP_0_XEVT0 (0x00000034)
    #define CSL_EDMACC_2_VCP_0_REVT1 (0x00000035)
    #define CSL_EDMACC_2_VCP_0_XEVT1 (0x00000036)
    #define CSL_EDMACC_2_VCP_0_REVT2 (0x00000037)
    #define CSL_EDMACC_2_VCP_0_XEVT2 (0x00000038)
    #define CSL_EDMACC_2_VCP_0_REVT3 (0x00000039)
    #define CSL_EDMACC_2_VCP_0_XEVT3 (0x0000003A)
    ..............
    ..............
    #define CSL_EDMACC_3_VCP_0_REVT0 (0x00000028)
    #define CSL_EDMACC_3_VCP_0_XEVT0 (0x00000029)
    #define CSL_EDMACC_3_VCP_0_REVT1 (0x0000002A)
    #define CSL_EDMACC_3_VCP_0_XEVT1 (0x0000002B)
    #define CSL_EDMACC_3_VCP_0_REVT2 (0x0000002C)
    #define CSL_EDMACC_3_VCP_0_XEVT2 (0x0000002D)
    #define CSL_EDMACC_3_VCP_0_REVT3 (0x0000002E)
    #define CSL_EDMACC_3_VCP_0_XEVT3 (0x0000002F)
    #define CSL_EDMACC_3_VCP_1_REVT0 (0x00000030)
    #define CSL_EDMACC_3_VCP_1_XEVT0 (0x00000031)
    #define CSL_EDMACC_3_VCP_1_REVT1 (0x00000032)
    #define CSL_EDMACC_3_VCP_1_XEVT1 (0x00000033)
    #define CSL_EDMACC_3_VCP_1_REVT2 (0x00000034)
    #define CSL_EDMACC_3_VCP_1_XEVT2 (0x00000035)
    #define CSL_EDMACC_3_VCP_1_REVT3 (0x00000036)
    #define CSL_EDMACC_3_VCP_1_XEVT3 (0x00000037)

    2. Now, if you look at cslr_device_interrupt.h some more, you'll find that the completion events for EDMACC_3 are mapped to CIC_1 (we are currently using CIC_0). So change the interrupt setup code in vcp2_interrupt.h to CIC1. I have pasted the relevant definitions below. (You can find any other required definitions by searching cslr_device_interrupt.h and cslr_device.h).

    #define CSL_CIC1_EDMACC_3_TC_0_INT (0x000000E1)
    #define CSL_CIC1_EDMACC_3_TC_1_INT (0x000000E2)
    #define CSL_CIC1_EDMACC_3_TC_2_INT (0x000000E3)
    #define CSL_CIC1_EDMACC_3_TC_3_INT (0x000000E4)
    #define CSL_CIC1_EDMACC_3_TC_4_INT (0x000000E5)
    #define CSL_CIC1_EDMACC_3_TC_5_INT (0x000000E6)
    #define CSL_CIC1_EDMACC_3_TC_6_INT (0x000000E7)
    #define CSL_CIC1_EDMACC_3_TC_7_INT (0x000000E8)

    3. Corresponding to the changes mentioned in item#2, you'll need to use the C66x_COREPAC events for event outputs coming from CIC1. You'll need to change the code listed below (vcp2_interrupt.h).

    // Map GEM input interrupt used for EDMA completion to vectId1
    hIntcEdma = CSL_intcOpen(&intcObjEdma,
    CSL_C66X_COREPAC_CIC_OUT8_PLUS_16_MUL_N, <======= Change these to use CIC_1 outputs
    &vectId1,
    NULL);

    // Map GEM input interrupt used for VCP error to vectId2 
    hIntcVcp = CSL_intcOpen(&intcObjVcp,
    CSL_C66X_COREPAC_CIC_OUT9_PLUS_16_MUL_N, <=======
    &vectId2,
    NULL);

    hCpintc = CSL_CPINTC_open(CSL_CIC_0); <====== Change this to use CSL_CIC_1

    4. Change the interrupt mappings to use the EDMA completion events listed in item#1 accordingly. Also change the VCP events to use the corresponding events on CIC1. Basically modify all the mapping code given below. 

    // Map EDMA completion and VCP error system interrupts to proper output interrupts (channels) and enable
    if (coreNum == 0) {
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_EDMACC_2_TC_0_INT, (16 * coreNum) + 8);
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_VCP_0_INT0, (16 * coreNum) + 9);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_EDMACC_2_TC_0_INT);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_VCP_0_INT0);
    } else if (coreNum == 1) {
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_EDMACC_2_TC_1_INT, (16 * coreNum) + 8);
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_VCP_0_INT1, (16 * coreNum) + 9);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_EDMACC_2_TC_1_INT);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_VCP_0_INT1);
    } else if (coreNum == 2) {
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_EDMACC_2_TC_2_INT, (16 * coreNum) + 8);
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_VCP_0_INT2, (16 * coreNum) + 9);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_EDMACC_2_TC_2_INT);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_VCP_0_INT2);
    } else if (coreNum == 3) {
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_EDMACC_2_TC_3_INT, (16 * coreNum) + 8);
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_VCP_0_INT3, (16 * coreNum) + 9);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_EDMACC_2_TC_3_INT);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_VCP_0_INT3);
    } else if (coreNum == 4) {
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_EDMACC_2_TC_4_INT, (16 * coreNum) + 8);
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_VCP_1_INT0, (16 * coreNum) + 9);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_EDMACC_2_TC_4_INT);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_VCP_1_INT0);
    } else if (coreNum == 5) {
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_EDMACC_2_TC_5_INT, (16 * coreNum) + 8);
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_VCP_1_INT1, (16 * coreNum) + 9);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_EDMACC_2_TC_5_INT);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_VCP_1_INT1);
    } else if (coreNum == 6) {
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_EDMACC_2_TC_6_INT, (16 * coreNum) + 8);
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_VCP_1_INT2, (16 * coreNum) + 9);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_EDMACC_2_TC_6_INT);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_VCP_1_INT2);
    } else {
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_EDMACC_2_TC_7_INT, (16 * coreNum) + 8);
    CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_VCP_1_INT3, (16 * coreNum) + 9);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_EDMACC_2_TC_7_INT);
    CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_VCP_1_INT3);
    }

    5. Finally, the CFG address macros defined in vcp_testInit.h will not work for VCPs 4 to 7 as shown below from cslr_device.h. So you need to define new macros for VCPs 4 to 7 and use them accordingly in the EDMA setup. 

    cslr_device.h
    -------------
    #define CSL_VCP_0_CFG_REGS (0x021D0000)
    #define CSL_VCP_1_CFG_REGS (0x021D4000)
    #define CSL_VCP_2_CFG_REGS (0x021D8000)
    #define CSL_VCP_3_CFG_REGS (0x021DC000)
    ....
    ....
    #define CSL_VCP_4_CFG_REGS (0x02340000)
    #define CSL_VCP_5_CFG_REGS (0x02344000)
    #define CSL_VCP_6_CFG_REGS (0x02348000)
    #define CSL_VCP_7_CFG_REGS (0x0234C000)

    Basically, you'll need to define new macros for VCPs 4-7 here and use them accordingly during EDMA setup in cp2_edma.c. 

    // Select instance of VCP2 (0-3)

    #define VCP2_CONTROL_BASE(vcp2Inst) (CSL_VCP_0_CFG_REGS + (vcp2Inst * 0x4000))
    #define VCP2_DATA_BASE(vcp2Inst) (CSL_VCP_0_DATA_REGS + (vcp2Inst * 0x100000))
    //#define hVcp2 hVcp2_0

    #define VCP2_ICMEM_ADDR(vcp2Inst) (VCP2_DATA_BASE(vcp2Inst) + 0x000000u)
    #define VCP2_OPMEM_ADDR(vcp2Inst) (VCP2_DATA_BASE(vcp2Inst) + 0x000048u)
    #define VCP2_BMMEM_ADDR(vcp2Inst) (VCP2_DATA_BASE(vcp2Inst) + 0x000080u)
    #define VCP2_HDMEM_ADDR(vcp2Inst) (VCP2_DATA_BASE(vcp2Inst) + 0x0000C0u)
    #define VCP2_END_ADDR(vcp2Inst) (VCP2_CONTROL_BASE(vcp2Inst) + 0x000020)
    #define VCP2_EXE_ADDR(vcp2Inst) (VCP2_CONTROL_BASE(vcp2Inst) + 0x000018)
    #define VCP2_STATUS0_ADDR(vcp2Inst) (VCP2_CONTROL_BASE(vcp2Inst) + 0x000040)
    #define VCP2_STATUS1_ADDR(vcp2Inst) (VCP2_CONTROL_BASE(vcp2Inst) + 0x000044)
    #define VCP2_ERROR_ADDR(vcp2Inst) (VCP2_CONTROL_BASE(vcp2Inst) + 0x000050)
    #define VCP2_EMU_ADDR(vcp2Inst) (VCP2_CONTROL_BASE(vcp2Inst) + 0x000060)


    The current DATA address macros should work fine since the DATA addresses for VCPs 0-7 are contiguous as shown below (from cslr_device.h).

    #define CSL_VCP_0_DATA_REGS (0x22A00000)
    #define CSL_VCP_1_DATA_REGS (0x22B00000)
    #define CSL_VCP_2_DATA_REGS (0x22C00000)
    #define CSL_VCP_3_DATA_REGS (0x22D00000)
    #define CSL_VCP_4_DATA_REGS (0x22E00000)
    #define CSL_VCP_5_DATA_REGS (0x22F00000)
    #define CSL_VCP_6_DATA_REGS (0x23000000)
    #define CSL_VCP_7_DATA_REGS (0x23100000)

    -Nitin

     

  • Hi Nitin,

    Thanks a lot for your support,

    I did the following modification which are mentioned in the thread step 1, 2, 3, and 4 and 5. After the modification I am not able to run the 8VCP2 instances. Please need your input.

    For the step 3:  what changes I need to use for the C66x_COREPAC events outputs coming from CIC1,

    // Map GEM input interrupt used for EDMA completion to vectId1

    hIntcEdma = CSL_intcOpen(&intcObjEdma,

    CSL_C66X_COREPAC_CIC_OUT8_PLUS_16_MUL_N, <======= what are the changes required to use CIC_1 outputs

    &vectId1,

    NULL);

    // Map GEM input interrupt used for VCP error to vectId2

    hIntcVcp = CSL_intcOpen(&intcObjVcp,

    CSL_C66X_COREPAC_CIC_OUT9_PLUS_16_MUL_N, <======= what are the changes required to use CIC_1 outputs

    &vectId2,

    NULL);

    After modifying the all steps which are mentioned except step 3, following observation.

    1. For 8VCP2 instances power initialization done successfully.  

    2. For all the 8vcp2 instances it waiting at while loop to get the EDMA3 transfer complete, for all 8vcp2 in the same state .

    3. Modified code is shared, please need your input to proceed further to run the 8vcp2, waiting for your reply.

    8vcp2example_K2K.zip

    Thanks & regards,

    Anil Kumar

  • Hi Nitin,

    Waiting for you reply, I am not able proceed further please provide inputs.

     

    Thanks & regards,

    Anil Kumar 

  • Hi Nitin,

    My application need 8VCP2 instances I am not able to proceed further, please need your inputs, waiting for reply.

    Thanks & regards,

    Anil Kumar 

  • Anil,

    I would strongly recommend you to understand the Kepler-2 interrupt architecture defined in section 6.3 of the TCI6638K2K datasheet. Figure 6-5 (Interrupt Topology) shows that CIC-0 events are routed to C66x cores 0 to 4 and CIC-1 events are mapped to C66x cores 4-7. This is also mentioned in the footnote 1 to table 6-22 (System Event Mapping - C66x CorePac primary interrupts):

    "1 For C66x CorePac[0-3], this generic primary interrupt comes from CIC0 and for C66x CorePac[4-7], this generic primary interrupt comes from CIC1."

    This means that the general purpose interrupt outputs listed in table 6-22 (e.g. CIC_OUT8_PLUS_16_MUL_N, CIC_OUT9_PLUS_16_MUL_N etc) are provided to cores 0-3 by CIC0 while the same outputs for cores 4-7 are provided by CIC1.

    So you need to use CIC1 (which in turn means EDMACC_3 as it's event outputs are mapped to CIC1) for VCPs 4-7 and CIC0 (i.e. the existing setup for the first 4 VCPs) for VCPs 0-3.

    1. You need to instantiate CIC1 also in Setup_Interrupt() i.e.

    If(DNUM <=3)
    {
    //----------------------------------------------------------
    // Setup CP_INTC0
    //----------------------------------------------------------
    // Open a handle to CP_INTC instance 0
    hCpintc = CSL_CPINTC_open(CSL_CIC_0);
    if (hCpintc_0 == 0)
    {
    printf ("Error: Unable to open CPINT instance 0\n");
    return;
    }
    }
    else
    {
    //----------------------------------------------------------
    // Setup CP_INTC1
    //----------------------------------------------------------

    // Open a handle to CP_INTC instance 1
    hCpintc_1 = CSL_CPINTC_open(CSL_CIC_1);
    if (hCpintc_1 == 0)
    {
    printf ("Error: Unable to open CPINT instance 1\n");
    return;
    }
    }

    2. Enable host interrupts for CIC1 (again, conditionally for cores 4-7):

    // Enable output (host) interrupts to GEM
    CSL_CPINTC_enableHostInterrupt (hCpintc_1, (16 * coreNum) + 8);
    CSL_CPINTC_enableHostInterrupt (hCpintc_1, (16 * coreNum) + 9);

    // Enable global host interrupt enable
    CSL_CPINTC_enableAllHostInterrupt(hCpintc_1);


    3. Corresponding to this, extend the EDMA interrupt mapping in the same function. Keep the setup for VCPs 0-3 as-is but use the definitions for EDMACC_3 provided earlier, for VCPs 4-7.

    4. You'll need to add conditional code or a parameter (for EDMACC 2 or 3) to the EDMA setup function setupVcpMultEdma3 to use EDMACC_3 for cores 4-7.

    5. The code for mapping CIC interrupts to C66x core interrupt vectors should work as-is since the corresponding events (CSL_C66X_COREPAC_CIC_OUT8_PLUS_16_MUL_N and CSL_C66X_COREPAC_CIC_OUT9_PLUS_16_MUL_N) for cores 4-7 are provided by CIC1 automatically.

    -Nitin

  • Hi Nitin, 

    Thanks a lot for your support,

    I am able to run 8vcp2 instances with you support, results shown below.

     [C66xx_0]

    [Core0][doVCP2Test]: Enabling VCP2-0

    [Core0][doVCP2Test]: Enabling VCP2-1

    [Core0][doVCP2Test]: Enabling VCP2-2

    [Core0][doVCP2Test]: Enabling VCP2-3

    [Core0][doVCP2Test]: Enabling VCP2-4

    [Core0][doVCP2Test]: Enabling VCP2-5

    [Core0][doVCP2Test]: Enabling VCP2-6

    [Core0][doVCP2Test]: Enabling VCP2-7

    Test Result : Passed[C66xx_1]

    [Core1][doVCP2Test]: Power enable complete.

    Test Result : Passed[C66xx_2]

    [Core2][doVCP2Test]: Power enable complete.

    Test Result : Passed[C66xx_3]

    [Core3][doVCP2Test]: Power enable complete.

    Test Result : Passed[C66xx_4]

    [Core4][doVCP2Test]: Power enable complete.

    Test Result : Passed[C66xx_5]

    [Core5][doVCP2Test]: Power enable complete.

    Test Result : Passed[C66xx_6]

    [Core6][doVCP2Test]: Power enable complete.

    Test Result : Passed[C66xx_7]

    [Core7][doVCP2Test]: Power enable complete.

    Test Result : Passed

    Thanks & regards,

    Anilkumar

  • Hi Nitin,

    Thanks lot for your support,

    I am able to run 8VCP2 instance with you support.

    I am using vcp2 instances in my application, my applications are running in the tasks and vcp2 code also running inside the task. VPC2 is not running in the tasks it is hanged/struck at the interrupts file “csl_intcIsrDispatch” not moving further.

    In the VCP2 example code task created, VPC2 instance not running inside the tasks it hanged/struck at the interrupt “csl_intcIsrDispatch” file shown below.

    I need to run the VCP2 instance inside the tasks, please need your support to proceed further, waiting for reply.

    Example code is shared below.

     

    VCP2_GenericC66xxDevice.7z

    Thanks & regards,

    Anil Kumar

      

  • Hi Nitin,

    Thanks a lot,

    I am able to run the (0-3) VCP2 instances inside the tasks, Interrupts function “Setup_Interrupt()” is disabled, with disabling the interrupts function able to run the (0-3) VCP2 inside the tasks, Code is shared.

    I my application interrupts required to be enabled inside the tasks, please provide inputs how to  enable/handle the interrupts inside the task,

    Please provide inputs i am waiting for your reply.

    Using_task_Vcp2_GenericC66xxDevice.7z

    Thanks & regards,

    Anil Kumar

  • Hi Anil,

    Thank you so much for the update. I hope you are able to work with VCP example provided by Nitin on K2K platform. We have of plenty of interrupt related issues discussed on e2e and few examples part of our SDK. We request you to search on e2e and spend some in reading those links and debug your application.

    If you have issues and queries on using the SYS-BIOS, please post your queries on TI-RTOS forum for appropriate response. This is the device forum in which we may support only the device/peripheral related queries.

    Thank you for your understanding.
  • Hi Nitin/Rajasekaran,
    Thanks a lot,

    If any inputs on interrupts handling inside the tasks it will help me lot, meantime i am creating new thread for Interrupts handling on e2e.

    Thanks & regards,
    Anil Kumar
  • Hi Anil,

    As Raja suggested, there are plenty of resources within TI E2E and in TI documentation itself. I would start with understanding the SYSBIOS programming model (SYS BIOS users guide). It's logical that you have to separate the interrupt setup and handling outside the task.

    Interrupts need to be setup before calling BIOS_start. As far as handling is concerned, interrupts are never serviced inside a task as they occur asynchronously and are serviced in the corresponding ISR. The task usually is a while(1) loop waiting on a semaphore which is posted by the ISR and you handle the task specific runtime functions (e.g. sending the input packets to the VCP in this case) in the task which need to happen every time the task is woken up by the ISR. You simply cannot move your whole program inside the task function.

    Just like any other interrupt driven system, a Hardware Interrupt (HWI) causes the program flow to jump to the ISR asynchronously. I would recommend you to go through some of the examples provided with the Keystone PDK and read the SYSBIOS users guide to understand these concepts.

    Regards

    -Nitin

    need vcp2 with edma3 config details for 6638 K2k

  • Hi Nitin,

    Thanks a lot for your support,

    In my application VCP2 are running on core (4-7), we are using VCP2 instance [0, and 1] to core 4 and VCP2 instance [2, and 3] to core 5. VCP2 instance [4, and 5] to core 6 and VCP2 instance [6, and 7] to core 7.

    I configured VCP2 instance [0, 1], core 4, VCP2 instance 0 running fine, VPC2 instance 1 hanged at while loop for transferring TX EDMA3 data,

    Please help me what are the configuration required to run two VCP2 instance at single core, Need your inputs.

    Thanks & regards,

    Anil Kumar

  • Hi Nitin,

    Thanks a lot,

    Waiting for your reply for running two VCP2 instances on single core, please provide inputs.

    Thanks & regards,

    Anil Kumar  

  • Anil,

    We don't have plans to port the example to use 2 VCPs per core. But the behavior you indicated seems logical for the current example as all the EDMA and interrupt configuration and ISR functions operate a core basis.

    1. EDMA TCC interrupts (and VCP error interrupts): Each core registers and gets the EDMA TC events meant for itself. You cannot get an interrupt means for one core on the other. An alternative would be to not use completion events and wait for a given time after submitting the input configuration and soft decisions and poll the events currently being handled in the EDMA_ISR, in software synchronously instead of using the ISR. That way you can monitor any/all events on any given core.   

    2. EDMA Region Access setup: The current EDMA setup function (edma3ModuleInit, setupVcpTputEdma3 and edma3MultChnlEnable) restrict each core to be able to access only the DMA regions allowed to it. You'll need to understand and modify these function to remove these restrictions as per your application needs and provide access to multiple DMA regions to each core to allow it to program and use the EDMA regions for other VCPs.

    -Nitin 

  • Hi Nitin,

    Thanks lot for your support,

    Regarding:  To run the 2VCP2 instances on single core,

    I am running VCP2 code with disabling interrupt function, step 1 modification not required.

    Step2 modifications:   In following function modification is done to use 8 cores “CSL_EDMACC_3 “functions are void edma3ModuleInit(), setupVcpTputEdma3() void edma3MultChnlEnable (), After modifying still I am not able to use the 2 vcp2 instance on single core. One VCP2 instance running fine results are passing, for 2nd VPC2 instance it struck at while loop waiting for “decisions” data.

    Please need you input to run  two VCP2 instance on single core. Waiting for your reply.

    Thanks & regards,

    Anil Kumar  

  • Hi Nitin,

    Waiting for you reply, I am not able proceed further please provide inputs.

    Thanks & regards,

    Anil Kumar 

  • Hi Nitin,

    Thanks lot for your support,

    I am not getting expected output from VCP2 please let me know if am missing some input configuration parameter or input bit alignment.

    Test 1: working

    Input to the convolution encoder in packed 32-bit format data:  0x00001452 from the output of encoder feeding to the  VCP2 input:  VCP2 output result is :0x00001452

    With the above input DATA, it working fine we are getting expected output from VCP2.

    In put data in lower 16 bit it working fine, Input data in both lower 16 bit and higher 16 bit is filled i am not getting expected output from VCP2.

    Test 2: Not working

    Input to the convolution encoder in the packed 32-bit format data:  0x05231452 from the output of encoder feeding to the VCP2 input:  VCP2 output result :0x29231452,

    With the above input DATA for test 2 it not working, expected out from VCP2 is 0x05231452   but we are getting output from VCP2 is 0x29231452, VCP2 output is not matching with input of convolution encoder,

    Please need your input to proceed further waiting for your reply, if any parameter configuration is missing,

     Configuration parameter

                              vcpParameters.constLen                    = 9;

                             vcpParameters.rate                 = VCP2_RATE_1_2;

                             vcpParameters.poly0             = 0xEB;

                             vcpParameters.poly1             = 0x71;

                             vcpParameters.poly2             = 0x00;

                             vcpParameters.poly3             = 0x00;

                             vcpParameters.yamTh                       = 0;

                             vcpParameters.frameLen                   = 288;

                             vcpParameters.relLen                        = 72;

                             vcpParameters.convDist                    = 52;

                             vcpParameters.traceBackIndex         = 0;

                             vcpParameters.traceBackEn              = 0;

                             vcpParameters.outOrder                    = 0;

                             vcpParameters.maxSm                      = 1024;

                             vcpParameters.minSm                       = 0;

                             vcpParameters.stateNum                   = 0;

                             vcpParameters.bmBuffLen                = 15;

                             vcpParameters.decBuffLen               = 4;

                             vcpParameters.traceBack                  = 3;

                             vcpParameters.readFlag                    = 0;

                             vcpParameters.decision                     = 0;

                             vcpParameters.numBmFrames          = 0;

                             vcpParameters.numDecFrames          = 0;

    Test_1_inputdata.txt
    Input data to the VCP2: test1 data
    0xC9C93737	0xC9C9C937	0xC9C93737	0x37C9C937	0xC9373737	0xC937C937	0xC9C9C9C9	0x37C937C9	0x373737C9
    0xC937C9C9	0x3737C9C9	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737
    0x37373737	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737
    0x37373737	0x37373737	0x37373737	0x00000037	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    
    
    
    Out put from VCP2 :
    
    0x29231452	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    Test_2_inputdata.txt
    Input data to the VCP2: test2
    0xC9C93737	0xC9C9C937	0xC9C93737	0x37C9C937	0xC9373737	0xC937C937	0xC9C9C9C9
    0x37C937C9	0x37C9C937	0xC937C937	0x373737C9	0x37C93737	0x37373737	0x37373737
    0x37373737	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737
    0x37373737	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737	0x37373737
    0x37373737	0x37373737	0x00000037	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000	0x00000000
    
    Out put from VCP2 :
    
    0x29231452	0x0DE36BDB	0x00000000	0x00000000	0x00000000	

     Thanks & regards,

    Anil Kumar 

  • Anil,

    I'm out of office this week and shall be able to look into your query when I'm back next week.

    Thanks

    -Nitin

  • Hi Nitin,

    Thanks a lot,
    Once you back from vacation please provide inputs I am not able to proceed further, Waiting for your reply.

    Thanks & regards,
    Anil Kumar
  • Hi Nitin,

    Thanks a lot,
    After modifying the input test vector data to the VCP2, I am able to run the test1 and test2 successfully, I am getting expected results,

    My application running inside the tasks and also VCP2 running inside the task, please can you help my what are the configuration or changes required for interrupt setup inside the task.

    Please provide inputs waiting for your reply.

    Thanks & regards,
    Anil Kumar
  • Anil,

    I'm not sure I understand your requirement so you'll need to clarify it in some detail. You should be able to refer to the PDK exmaples to understand interrupt setup on the TCI6638 device.

    -Nitin

  • Hi Nitin,

    Thank a lot,

    Which you shared VCP2 example code in the thread, same code I am running inside the task code is in hag state not able to proceed further, please can you help what are the configuration or changes required for interrupt setup inside the task,

    Code is shared and screen picture is attached.

     

    hello_GenericC66xxDevice.7z

    Thanks & regards,

    Anil Kumar

  • Hi Nitin,

    I am not able to proceed further waiting for your reply, please provide inputs.

    Thanks & regards,
    Anil Kumar
  • Anil,

    As mentioned in my previous post, your requirement is not clear to me. What do you mean by Interrupt setup inside the task? As already indicated in an earlier post, interrupt functions are not invoked inside a task as they are called asynchronously when the specified event occurs, and the interrupt functions posts a semaphore on which the task function pends (usually). This has already been discussed and there are examples in the PDK which can be used to understand this along with understanding the basics of tasks and interrupts as given in the SYSBIOS user's guide.

    -Nitin 

  • Hi Nitin,

    Thanks a lot,

    I modified the interrupt setting to run the code inside task, first run it is running fine results are getting, at 2nd run getting an error message interrupt already used,

    Code running inside the task under while one loop first run it is working fine interrupts are generating getting the expected data out, at the 2nd run we are seen an error message “ti.sysbios.family.c64p.Hwi: line 192: E_alreadyDefined: Hwi already defined: intr# 6 xdc.runtime.Error.raise: terminating execution”

    For the reference code is attached.

    Please need your inputs to run continues in while loop, let me know if am missing any configurations, waiting for your reply,  

    vcp2_interrupt.c
    /*****************************************************************************\
    *           TEXAS INSTRUMENTS INCORPORATED PROPRIETARY INFORMATION           
    *                                                                            
    *  Property of Texas Instruments 
    *  For  Unrestricted  Internal  Use  Only 
    *  Unauthorized reproduction and/or distribution is strictly prohibited.  
    *  This product is protected under copyright law and trade secret law 
    *  as an unpublished work.  
    *  (C) Copyright 2009 Texas Instruments.  All rights reserved.
    *------------------------------------------------------------------------------
    *  Filename       : vcp2_interrupt.c
    *  Description    : Interrupt setup and handling functions for the VCP2 test
    \*****************************************************************************/
    
    #include <ti/sysbios/family/c64p/Hwi.h>
    //#include <xdc/runtime/Error.h>
    //#include <xdc/runtime/knl/Semaphore.h>
    //#include <xdc/cfg/global.h>
    //#include <ti/sysbios/knl/Semaphore.h>
    
    
    #include <stdio.h>
    #include <ti/csl/csl.h>
    #include <ti/csl/csl_tsc.h>
    #include <ti/csl/csl_types.h>
    #include <ti/csl/csl_error.h>
    #include <csl_intc.h>
    #include <ti/csl/csl_edma3.h>
    #include <ti/csl/csl_vcp2.h>
    #include <ti/csl/csl_vcp2Aux.h>
    #include <ti/csl/soc.h>
    #include <ti/csl/csl_cpIntcAux.h>
    #include <ti/csl/csl_device_interrupt.h>
    
    #include <ti/sysbios/knl/Semaphore.h>
    #include <ti/sysbios/BIOS.h>
    
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/BIOS.h>
    #include <xdc/cfg/global.h>
    
    #include "val_util.h"
    #include "vcp2_edma3.h"
    #include "vcp2_testInit.h"
    
    // Global variable declaration
    CSL_IntcHandle              hIntcEdma;
    CSL_IntcHandle              hIntcVcp;
    CSL_IntcObj                 intcObjEdma;
    CSL_IntcObj                 intcObjVcp;
    CSL_CPINTC_Handle           hCpintc;
    CSL_IntcEventHandlerRecord  eventHandler[2];
    CSL_IntcGlobalEnableState   state;  //dummy var since not used to restore state later
    CSL_Edma3CmdIntr            regionIntrQuerry;
    
    
    CSL_CPINTCSystemInterrupt	sysIntr;
    
    // External global variables
    
    extern CSL_Edma3Handle hModule;
    extern Semaphore_Handle SEM;
    
    extern Uint32 decisions[4][1024];
    extern VCP2_Params vcpParameters[20];
    
    extern volatile Uint32 VcpError;
    extern volatile Uint32 RxCount;
    
    extern volatile Uint32 VCP_IPTX_TimeStamp_Start_Count;
    extern volatile Uint32 VCP_IPTX_TimeStamp_Stop_Count;
    extern volatile Uint32 VCP_OPRX_TimeStamp_Stop_Count;
    
    extern volatile Uint32 TxEdmaChannelBCount;
    extern volatile Uint32 ChannelTXCount;
    extern volatile Uint32 ChannelRXCount;
    
    extern CSL_Uint64 profileIPXmtStartLow64[8];
    extern CSL_Uint64 profileIPXmtStopLow64[8];
    extern CSL_Uint64 profileOPRcvStopLow64[8];
    
    extern volatile unsigned long long int Profile64;
    extern VCP2Handle hVcp2;
    extern Uint32 coreNum1;
    
    
    Hwi_Handle myHwi;
    
    
    // Function declarations
    interrupt void EDMA_ISR(void);
    interrupt void VCP2_ISR(void);
    
    //-------------------------------------------------------------
    // Setup_Interrupt() - Performs setup for GEM INTC and CP_INTC
    //-------------------------------------------------------------
    void Setup_Interrupt()
    {
        //---------------------------------
        // Setup GEM internal INTC
        //---------------------------------
    	// printf("Star of Setup_Interrupt \n");
        // Declare variables
         /* Routing Iqn2 exception event thru INTC0 */
    
            /* Routing Iqn2 exception event thru INTC0 */
    #if 1
    
    
    		hCpintc = CSL_CPINTC_open(1); // handle for INTC0
            CSL_CPINTC_disableAllHostInterrupt(hCpintc);
            CSL_CPINTC_setNestingMode(hCpintc, CPINTC_NO_NESTING);
            CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC0_I2C_1_INT , 8); // assuming core0
            CSL_CPINTC_clearSysInterrupt (hCpintc, CSL_CIC0_I2C_1_INT );
            CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC0_I2C_1_INT );
    
            Hwi_Params hwiParams;
            Hwi_disable();
    
            Hwi_disableInterrupt(CSL_INTC_VECTID_6);
          //  Hwi_disableInterrupt(CSL_INTC_VECTID_10);
    
            Hwi_Params_init(&hwiParams);
            hwiParams.enableInt = FALSE;
            hwiParams.eventId =   CSL_C66X_COREPAC_CIC_OUT8_PLUS_16_MUL_N ;
         //   hwiParams.priority = 5;
    
    
            Hwi_create (CSL_INTC_VECTID_6, (ti_sysbios_interfaces_IHwi_FuncPtr) EDMA_ISR, &hwiParams, NULL);
          //  Hwi_create (CSL_INTC_VECTID_10, (ti_sysbios_interfaces_IHwi_FuncPtr) VCP2_ISR, &hwiParams, NULL);
    
            Hwi_clearInterrupt (CSL_INTC_VECTID_6);
          //  Hwi_clearInterrupt (CSL_INTC_VECTID_10);
    
        //    CSL_CPINTC_enableAllHostInterrupt(hCpintc);
    
        //    Hwi_enableInterrupt (CSL_INTC_VECTID_5);
          //  Hwi_enableInterrupt (CSL_INTC_VECTID_10);
          //  Hwi_enable ();
    
    #endif
    
    #if 0
    
        CSL_IntcParam vectId1;
        CSL_IntcParam vectId2;
        CSL_IntcGlobalEnableState state;
        CSL_IntcContext intContext; 
    
        // Setup the global Interrupt
        intContext.numEvtEntries = 2;
        intContext.eventhandlerRecord = eventHandler; 
    
        CSL_intcInit(&intContext);
    
        // Enable NMIs
        CSL_intcGlobalNmiEnable();
    
    
        // Enable Global Interrupts
        CSL_intcGlobalEnable(&state);
    
        // Select interrupt vector IDs to use on DSP core
        vectId1 = CSL_INTC_VECTID_9;
        vectId2 = CSL_INTC_VECTID_10;
    
        // Map GEM input interrupt used for EDMA completion to vectId1  
        hIntcEdma = CSL_intcOpen(&intcObjEdma,
        		CSL_C66X_COREPAC_CIC_OUT8_PLUS_16_MUL_N,
                &vectId1,
                NULL);
    
        // Map GEM input interrupt used for VCP error to vectId2  
        hIntcVcp = CSL_intcOpen(&intcObjVcp,
        		CSL_C66X_COREPAC_CIC_OUT9_PLUS_16_MUL_N,
                &vectId2,
                NULL);
    
        // Hook the ISR's
        CSL_intcHookIsr(vectId1,&EDMA_ISR);
        CSL_intcHookIsr(vectId2,&VCP2_ISR);
    
        // Clear any pending interrupts
        CSL_intcHwControl(hIntcEdma,CSL_INTC_CMD_EVTCLEAR,NULL);
        CSL_intcHwControl(hIntcVcp,CSL_INTC_CMD_EVTCLEAR,NULL);
    
        // Enable the event and interrupt
         CSL_intcHwControl(hIntcEdma,CSL_INTC_CMD_EVTENABLE,NULL);
         CSL_intcHwControl(hIntcVcp,CSL_INTC_CMD_EVTENABLE,NULL);
    
    #endif
        //----------------------------------------------------------
        // Setup CP_INTC0
        //----------------------------------------------------------
        if(coreNum1 <= 3)
        {
        // Open a handle to CP_INTC instance 0
        hCpintc = CSL_CPINTC_open(CSL_CIC_0);
        if (hCpintc == 0)
    		{
    			printf ("Error: Unable to open CPINT instance 0\n");
    			return;
    		}
        }
        else
        {
        	hCpintc = CSL_CPINTC_open(CSL_CIC_1);
        	if (hCpintc == 0)
        	{
            printf ("Error: Unable to open CPINT instance 0\n");
            return;       
        	}
        }
    
        // Map EDMA completion and VCP error system interrupts to proper output interrupts (channels) and enable
        if (coreNum1 == 0) {
            CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_EDMACC_3_TC_0_INT, (16 * coreNum1) + 8);
            CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_VCP_0_INT0,          (16 * coreNum1) + 9);
            CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_EDMACC_3_TC_0_INT);
            CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_VCP_0_INT0);
        } else if (coreNum1 == 1) {
            CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_EDMACC_3_TC_1_INT, (16 * coreNum1) + 8);
            CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_VCP_0_INT1,          (16 * coreNum1) + 9);
            CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_EDMACC_3_TC_1_INT);
            CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_VCP_0_INT1);
        } else if (coreNum1 == 2) {
            CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_EDMACC_3_TC_2_INT, (16 * coreNum1) + 8);
            CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_VCP_0_INT2,          (16 * coreNum1) + 9);
            CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_EDMACC_3_TC_2_INT);
            CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_VCP_0_INT2);
        } else if(coreNum1 == 3) {
            CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_EDMACC_3_TC_3_INT, (16 * coreNum1) + 8);
            CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_VCP_0_INT3,          (16 * coreNum1) + 9);
            CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_EDMACC_3_TC_3_INT);
            CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_VCP_0_INT3);
        }else if (coreNum1 == 4) {
               CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_EDMACC_3_TC_4_INT, (16 * (coreNum1-4)) + 8);
               CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_VCP_1_INT0,          (16 * (coreNum1-4)) + 9);
               CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_EDMACC_3_TC_4_INT);
               CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_VCP_1_INT0 );
        } else if (coreNum1 == 5) {
               CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_EDMACC_3_TC_5_INT, (16 * (coreNum1-4)) + 8);
               CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_VCP_1_INT1,          (16 * (coreNum1-4)) + 9);
               CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_EDMACC_3_TC_5_INT);
               CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_VCP_1_INT1);
        } else if (coreNum1 == 6) {
               CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_EDMACC_3_TC_6_INT, (16 * (coreNum1-4)) + 8);
               CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_VCP_1_INT2,          (16 * (coreNum1-4)) + 9);
               CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_EDMACC_3_TC_6_INT);
               CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_VCP_1_INT2);
        } else { // coreNum11 == 3
               CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_EDMACC_3_TC_7_INT, (16 * (coreNum1-4)) + 8);
               CSL_CPINTC_mapSystemIntrToChannel (hCpintc, CSL_CIC1_VCP_1_INT3,          (16 * (coreNum1-4)) + 9);
               CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_EDMACC_3_TC_7_INT);
               CSL_CPINTC_enableSysInterrupt (hCpintc, CSL_CIC1_VCP_1_INT3);
        }
    
        // Clear pending system interrupts
        if (CSL_CPINTC_isInterruptPending(hCpintc) == TRUE)
        {
        // Get the source of the interrupt
        sysIntr = CSL_CPINTC_getPendingInterrupt(hCpintc);
    
        // Clear the interrupt
        CSL_CPINTC_clearSysInterrupt(hCpintc, sysIntr);
        }
    
    
        if(coreNum1 <= 3)
        {
    
        	// Enable output (host) interrupts to GEM
        	CSL_CPINTC_enableHostInterrupt (hCpintc, (16 * coreNum1) + 8);
        	CSL_CPINTC_enableHostInterrupt (hCpintc, (16 * coreNum1) + 9);
        	// Enable global host interrupt enable
        	CSL_CPINTC_enableAllHostInterrupt(hCpintc);
    
        }
        else
        {
    		CSL_CPINTC_enableHostInterrupt (hCpintc, (16 * (coreNum1 -4)) + 8);
    		CSL_CPINTC_enableHostInterrupt (hCpintc, (16 * (coreNum1 - 4)) + 9);
    		// Enable global host interrupt enable
    		CSL_CPINTC_enableAllHostInterrupt(hCpintc);
    
       	 }
    #if 1
    
    //	CSL_CPINTC_enableAllHostInterrupt(hCpintc);
    
    	Hwi_enableInterrupt (CSL_INTC_VECTID_6);
    	//  Hwi_enableInterrupt (CSL_INTC_VECTID_10);
    	Hwi_enable ();
    
    #endif
    }
    
    
    /*************************************************************************\
     *                    EDMA ISR
     \*************************************************************************/
    interrupt void EDMA_ISR(void)
    {
    
    //	printf("Start of the EDMA_ISR \n");
    
        CSL_CPINTC_clearSysInterrupt(hCpintc, CSL_CIC1_EDMACC_3_TC_0_INT+coreNum1);
        CSL_intcHwControl(hIntcEdma,CSL_INTC_CMD_EVTCLEAR,NULL);
    
        regionIntrQuerry.region = coreNum1; // CSL_EDMA3_REGION_1;
        regionIntrQuerry.intrh = 0xffffffff;
       // regionIntrQuerry.intrh=0xffffffff;
       // regionIntrQuerry.intr =0x0;
    
        /* Read EDMA IPR */
        CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,&regionIntrQuerry); 
        /* Clear EDMA IPR */
        CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTRPEND_CLEAR,&regionIntrQuerry);
    
    
        VAL_TRACE(0xAAAA0000);
        do
        {
            /* Sample Timer Value after O/P Parameter Transfer is over */
            if(regionIntrQuerry.intr & (1 << VCP2_RCV_OPPARAM_TCC(coreNum1)))
            {
                /* Populate the Time for RCV completion of Channel "i" */
                profileIPXmtStartLow64[VCP_IPTX_TimeStamp_Start_Count]=CSL_tscRead();
                VCP_IPTX_TimeStamp_Start_Count++;
                /* Populate the Time for RCV completion of Channel "i" */
                profileOPRcvStopLow64[VCP_OPRX_TimeStamp_Stop_Count]=CSL_tscRead();
                VCP_OPRX_TimeStamp_Stop_Count++;
                ChannelRXCount++;
                VAL_TRACE(0xA0000003);
            }
    
            /* Sample Timer Value after I/P Parameter configuration is over */
    
            if(regionIntrQuerry.intr & (1 << VCP2_XMT_IPCONFIG_TCC(coreNum1)))
            {
                /* Populate the Time for Input Parameter XMT completion of Channel"i"*/
                profileIPXmtStopLow64[VCP_IPTX_TimeStamp_Stop_Count]=CSL_tscRead();
                VCP_IPTX_TimeStamp_Stop_Count++;
                VAL_TRACE(0xA0000004);
            }
    
            /* Start VCP BM Transfer */
            if(regionIntrQuerry.intrh & (1 << VCP2_XMT_TCC(coreNum1)-0x20))
            {
                /* Populate the Time for XMT completion of Channel "i" */
                //profileXmtStartLow64[VCP_TX_TimeStamp_Start_Count]=CSL_tscRead();
                //profileXmtStartLow[VCP_TX_TimeStamp_Start_Count] = Profile64; 
                //profileXmtStartHigh[VCP_TX_TimeStamp_Start_Count] = (Profile64 >> 32); 
                //VCP_TX_TimeStamp_Start_Count++;
                //if (TxEdmaChannelBCount == 0) 
                {
                    VAL_TRACE(0xCCCC3333); 
                    ChannelTXCount++;
                }
                VAL_TRACE(ChannelTXCount);   
                VAL_TRACE(0xA0000005);
                /*status = DoTXEdma3Access(DataAddress,VCP2_BMMEM_ADDR, Acnt, 1, 1, Acnt, 0, TRUE);*/
                /*profileXmtStartLow64[VCP_TX_TimeStamp_Start_Count]=CSL_tscRead(); 
                VCP_TX_TimeStamp_Start_Count++;        */
            }
    
            /* Start VCP Read for decisions */
            if(regionIntrQuerry.intr & (1 << VCP2_RCV_TCC(coreNum1)-0x20))
            {
                /* Populate the Time for RCV completion of Channel "i" */
                /*profileRcvStartLow64[VCP_RX_TimeStamp_Start_Count]=CSL_tscRead();
                VCP_RX_TimeStamp_Start_Count++;*/
                VAL_TRACE(0xA0000007);
                VAL_TRACE(ChannelRXCount);   
    
            }
    
            CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,&regionIntrQuerry); 
            CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTRPEND_CLEAR,&regionIntrQuerry);
        }while ((regionIntrQuerry.intr !=0) & (regionIntrQuerry.intrh !=0));
    
    
        /* Set Interrupt EVAL */
    
      //  regionIntrQuerry.region = coreNum1;
       // CSL_edma3HwControl(hModule, CSL_EDMA3_CMD_INTR_EVAL,&regionIntrQuerry.region);
    
         //  printf("End of the EDMA_ISR \n");
        Hwi_clearInterrupt (CSL_INTC_VECTID_6);
    
        //SEM_post(&SEM);
    
       // Semaphore_post(SEM);
        Semaphore_post(SEM_VCP2Complete);
    
      //  Hwi_disableInterrupt(CSL_INTC_VECTID_6);
    }
    
    
    /*************************************************************************\
     *                    VCP2 ISR
     \*************************************************************************/
    interrupt void VCP2_ISR(void)
    {
        //printf("Star of the VCP2_ISR \n");
    
        CSL_CPINTC_clearSysInterrupt(hCpintc, /*CSL_CIC0_VCP_0_INT0 */CSL_CIC1_VCP_0_INT0+coreNum1);
        CSL_intcHwControl(hIntcVcp,CSL_INTC_CMD_EVTCLEAR,NULL);
        VAL_TRACE(0xAAAA1100);
    
        // Read the Status Register
        VAL_TRACE(hVcp2->cfgregs->VCPSTAT0);
        VAL_TRACE(hVcp2->cfgregs->VCPSTAT1);
    
        // Read the VCP2 Error Register and set the status accordingly
        VAL_TRACE(hVcp2->cfgregs->VCPERR);
        hVcp2->cfgregs->VCPERR = 0;
    
        // Increment VCP error counter
        VAL_TRACE(0xAAAA11FF);
        VcpError++;
      //  printf("Star of the VCP2_ISR \n");
    }
    
    
    /******************************************************************************\
     * End of vcp2_interrupt.c
    \******************************************************************************/
    
    

    Thanks & regards,

    Anil Kumar 

  •  Hi Nitin,

    I am not able to proceed further waiting for your reply, please provide inputs.

    Thanks & regards,

    Anil Kumar  

  • Hi Nitin,

    I am waiting for your reply, Please provide the inputs.

    Thanks & regards,

    Anil Kumar 

  • Hi Nitin,

    I am not able to proceed further, waiting for your reply please provide inputs.

    Thanks & regards
    Anilkumar