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.

6678 Notify project

<ipc_install_dir>/packages/ti/sdo/ipc/examples/multicore/ <platform_name>

the Notify project,is it just can use eight cores,when i relaunch the ccxml,i use core0 and core1 to Group cores,then connect and load out file,exec,but it can not exec correctly

if i use eight cores,it work correctly。

another question:

when i add get the time api in the code like below:  //need to add <c6x.h>

timeStamp0 = TSCL;
processing。。。。。
timeStamp1 = TSCL;

System_printf("covert time is %d\n",timeStamp1-timeStamp0); 

but it is 0,why?

thanks.best regards.

  • Cherish,

    How to run this example:

    • Load and run the same image on all the cores. For example load the image: ti_sdo_ipc_examples_platforms_[DEVICENAME]_core0\debug\notify_multicore.xe66 on CORE0, CORE1 ... COREn
    • Communication starts to go around in a loop Where running the notify example, communication adopts the form of notify events.


    Yes, You will need the header file that defines the function. If you are using CLS_tscrRead() function, it requires csl_tsc.h

  • thanks for your reply.

    my meaning is,the notify project as above can load in just two cores. if i use just two cores,it can not exec correctly.

    then if i use eight cores,it can exec correctly.

     

    i use TSCL,the time between before and end is 0.i want to know why.

  • Cherish,

    That project may be created and tested for Eight cores. You need to customize the project for run the two cores only if you need.

    TSCL: You may missing the proper configuration or setting for time measurement. Refer the some example code for time measurement at MCSDK or PDK.
    The below E2E discussion threads are refered for TSCL, this will help you to find the issue on your code
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/303532/1058240.aspx#1058240
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/229852/807157.aspx#807157
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/258984/905961.aspx#905961

    Example code:

    uint32_t startTime, endTime;

    /* Reset timer */
    TSCL = 0;

    /* Start the clock */
    startTime = TSCL;

    //Code

    endTime = TSCL;

  • thanks for your help.

    and the second question as saied above:

    my meaning is,the notify project as above can load in just two cores. if i use just two cores,it can not exec correctly.

    then if i use eight cores,it can exec correctly.it must use eight cores,is it?

    third:

    if i commend the System_printf ,it will error:core1 sendEvent failed . why?

    then i use platform_delay() API,but i found that,the API does not be enabled,the diff time between platform_delay is very little,the API is just valid. why? i have add head file and lib.

    the code:

    while (seq < NUMLOOPS) {
    /* wait forever on a semaphore, semaphore is posted in callback */
    Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);//开始是1,等待接受到Notify之后才为2的

    // System_printf("tsk1_func: Received request #%d from %s\n", seq,
    // MultiProc_getName(recvProcId));

    /* Send an event to the next processor */
    status = Notify_sendEvent(dstProc, INTERRUPT_LINE, EVENTID, seq,
    TRUE);
    if (status < 0) {
    System_abort("sendEvent failed\n");
    }

  • no,the question has be solved,i have saied above.

    my another is second and third as above saied.

    thanks.best regards. 

  • Cherish,

    1. Yes, your understanding is correct. You should be test the eight cores, if your using C6678 device.
    2. Please do the code walkthrough and understand the flow.
    Here, cbFxn() - This function was registered with Notify. It is called when any event is sent to this processor.
    And also the semaphore is posted by the callback function.

  • i know the meaning about cbFxn.

    i want to know about my question.

    thanks.

  • my question is:

    third:

    if i commend the System_printf ,it will error:core1 sendEvent failed . why?

    then i use platform_delay() API,but i found that,the API does not be enabled,the diff time between platform_delay is very little,the API is just valid. why? i have add head file and lib.

    the code:

    while (seq < NUMLOOPS) {
    /* wait forever on a semaphore, semaphore is posted in callback */
    Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);//开始是1,等待接受到Notify之后才为2的

    // System_printf("tsk1_func: Received request #%d from %s\n", seq,
    // MultiProc_getName(recvProcId));

    /* Send an event to the next processor */
    status = Notify_sendEvent(dstProc, INTERRUPT_LINE, EVENTID, seq, 
    TRUE);
    if (status < 0) {
    System_abort("sendEvent failed\n");
    }

  • Cherish,

    System_printf call is similar to normal printf call. This should be working whenerver using or not.
    You may try once clean the project, make build and run this. I do not why you are getting issue.

  • thanks for reply.

    no,i have clean the project,if i commend the System_printf, after run ,it will error;

    then if i uncommend the System_printf,it will correctly.

    i have try a lot times.

    best regards.

  • Cherish,

    I do not know why it happens. But why you like to commend-out System_printf, you can use as it is.

    Anyway you are getting working environment with System_printf. So you go forward with this on your implementation. 

  • thanks for your help

    but i do not want print,it will need time,in my process,i need to try my best to declease time needed.

    can you take a try,with this project.

    best regards.

  • Hi cherish,

    It seems to need some time delay. The program works well when I commented the system_printf() and made for(i=0;i<1000000;i++) instead. However,it just completed 90% when I try to for(i=0;i<10000;i++).When was for(i=0;i<1000;i++),it didn't work.

    I don't know why it would be so.I look forward to someone who can explain it.

    Best regards.

  • Hi,

    After this delay experiment, It may be required some delay before execute next call. If it is a CCS project, please try with release mode as well as optimization enable through build properties.

     

  • thanks for your reply.

    but if i use platform_delay()this API,but it do not be useful,it just do not valid,the time between the API front and end;the time is just very small.

    so i want to know how to use the delay.

    i just add header file and lib. 

  • Cherish,

    If you do not like to use platform_delay API call, try to write the code for delay function like "for loop".

  • thanks

    i want to use that API.i want to know how to use it ,if i use it uncorrectly.

  • Cherish,

    Oh, You can use that API. Yes, it required suitable lib as well as header file.

  • timeStamp0 = TSCL;

    platform_delay(1000);


    timeStamp1 = TSCL;

     

    but the diff time=timeStamp1 -timeStamp0  is vert little,it looks like invalid with time delay.

    i have add lib and head file,the project build correctly.

  • Hi,

    You can look the platform_delay() source code in C:\Program Files\Texas Instruments\pdk_C6678_1_1_2_6\packages\ti\platform\evmc6678l\platform_lib\src\platform.c

    Platform_STATUS platform_delay(uint32_t usecs)
    {
    int32_t delayCount = (int32_t) usecs * platform_mcb.frequency;
    int32_t start_val = (int32_t) CSL_chipReadTSCL();

    while (((int32_t)CSL_chipReadTSCL() - start_val) < delayCount);

    return Platform_EOK;
    }

    The global struct platform_mcb is initialized in platform_init(). So I think you can just call the platform_delay() correctly after calling platform_init() or initializing it manually.

  • Cherish,

    Yes, please refer the platform_delay() function in the platform test project. It may be cause of not proper initialization.

    Did you get any luck to solve your issue?