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.

TMS570LC43x for HALCoGen

Other Parts Discussed in Thread: HALCOGEN, TMS570LC4357

Hi, dear TI engineer

I met a problem in TMS570LC43x. I do not know how to set HALCoGen for my project. My project is focus on using USB port to connect PC and TMS570LC43x for runing my program on the board and outputing a txt result. All input data and output data would be located in my PC. I need to know how to set MCU, Flash, RAM and USB port. Could you help me?the attachment is my main codes.2364.test1.zip

  • Are you using an TMDS57x HDK and want to use the virtual serial port that connects to the PC via USB, or do you have a custom board? If using the HDK, configure the SCI1 (which is also LIN1) for the data rate you desire.

  • You might want to look at a HALCoGen SCI example. In HALCoGen select Help->Help Topics, then expand "Examples" and selec "example_sci_uart_9600.c. This example will  walk you through setting up HALCoGen to use the SCI to talk to a PC.

  • yeah, it is HDK. I want to use USB as input and output ports. And should I set Flash and RAM in HALCoGen? Can you help me?
  • Hello Bob

    I just have set as your figure. But the follwoing error still happen.
    CortexR5: File Loader: Memory write failed: Flash verification failed
    CortexR5: GEL: File: D:\study\Master project\570LC43x\Debug\570LC43x.out: Load failed.
    How to fix this problem.

    thanks!

    Regards!
    Xinyu
  • You should be able to use the default configurations from HALCoGen for Flash and RAM. Were you able to follow the example above and successfully compile the code? On the TMS570LC4357 ECC is always enabled for the flash and RAM so make sure you still have "Auto ECC Generation" still enabled in your On-Chip Flash settings.

  • Hello Bob,

    I have set HALCoGen as the same as the example. However, errors happened. the errors are that the files in the source can not be open.

    thank you!

    regards!

  • Hello Bob,

    I have fixed my above error. but when I finished debug. I still can not find a out.txt file in my project. there is no error in compiling and debug.

    Thanks!

    Regards!
    Xinyu
  • The executable file will be in a subdirectory named by the project\configuration. For example my project name was "example_sci_uart_9600". I used the default configuration "Debug". My out file is located in my workspace at:
    "example_sci_uart_9600\Debug\example_sci_uart_9600.out".

    Check out this tutorial to see if it helps:
    processors.wiki.ti.com/.../Creating_new_CCS_v5_Project_with_HALCoGen
  • Hello Bob

    I hope this project could read a txt file as input data and write a txt file as output. My data was stored in a txt file. And my out file in Debug is messy code.

    Thanks!

    Regards!
    Xinyu
  • Code Composer Studio supports a C I/O that can print to the CCS console. It actually uses a breakpoint so does not run real-time. If you need this to be more standalone, you can read and write to the serial port and use a terminal emulator on the PC to send the file and capture the response.
  • Hello Bob,

    after setting, following codes are generated. However, txt.file still can not be used.

    /*this main program part for loading the matrix data*/
    float a[1][8281];
    int lines=0,r1=1,r2=8281;
    FILE *fp1;
    int i;
    fp1 = fopen("D:\study\Master project\Msc_project\c.txt", "r");
    while(lines < r1)
    {
    for(i = 0; i < r2; i ++)
    {
    if(fscanf(fp1, "%f", &a[lines][i]) == EOF)
    {
    break;
    }
    if(feof(fp1))
    {
    break;
    }
    lines++;
    }
    }
    fclose(fp1);

    /*this main program part for loading statistics algorithm*/
    int j,n,t,q[r1][r2];
    int m=0;
    for(j=0;j<r1;j++)
    {
    for(n=0;n<r2;n++)
    {
    m=0;
    for(t=0;t<r2;t++)
    {
    if(t!=n)
    {
    if(a[j][n]-a[j][t]==0)
    {
    m++;
    q[j][n]=m;
    }
    }
    }
    }
    }

    int r,k,max;
    float b[r1][1];
    for(r=0;r<r1;r++)
    {
    max=q[0][0];
    for(k=0;k<r2;k++)
    {
    if(q[r][k]>max)
    {
    max=q[r][k];
    b[r][1]=a[r][k];
    }
    }
    }

    r=0,k=0;
    float c[r1][r2];
    float d[r1][r2];
    for(r=0;r<r1;r++)
    {
    for(k=0;k<r2;k++)
    {
    d[r][k]=c[r][k];
    c[r][k]=fabs(a[r][k]-b[r][1])/401;
    c[r][k]=c[r][k]+d[r][k];
    }
    }

    r=0,k=0;
    int ecol,erow;
    float e[91][91];
    for(r=0;r<r1;r++)
    {
    for(k=0;r<r2;k++)
    {
    ecol=k%91;
    erow=k/91;
    e[ecol][erow]=c[r][k];
    }

    }

    FILE *fp2;
    int ec,er;
    fp2 = fopen("D:\study\Master project\Msc_project\out.txt","w");
    for (ec = 0; ec < 91; ec++)
    {
    for (er = 0; er < 91; er++)
    {
    fprintf(fp2, "%f ", e[ec][er]);
    }
    fputc('\n', fp2);
    }
    fclose(fp2);

    I do not understand why my processor can not run this?

    Thanks!
    Regards!
    Xinyu
  • Hi, Bob

    For that tutorial, it can not work on my board. I can not use the spectrum digital XDSPRO emulator

    Regards!
    Xinyu