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.

warning: creating output section ".cio" without a SECTIONS specification

Other Parts Discussed in Thread: TMS320F2808, TMS320F28335

Hi,

I'm starting with CCS.  I use CCS 4.1.3 with the micro TMS320F2808

I ran the hello world code and it worked.

The warning happens when I add the two files "DSP280x_Headers_nonBIOS.cmd" and "F2808.cmd" (for both it is $TI Release: DSP280x C/C++ Header Files V1.70 $ $Realease Date: July 27, 2009 $). 

I would like to know how to remove the warning: "warning: creating output section ".cio" without a SECTIONS specification"

Thank you

Maxime

  • C-I/O library functions, such as printf(), pull in a support function from the RTS library that create a section called .cio.  This is normal.

     

    Getting rid of the warning is easy.  Just add a link for .cio in your linker .cmd file.  Something like this:

     

    SECTIONS

    {

       .cio              : > L1SARAM,        PAGE = 1

    }

     

    Link the .cio to whatever RAM you want on whatever PAGE (e.g., PAGE 0 or 1).  The above link to L1SARAM is just an example.

    Regards,

    David

  • Thanks David !

    It worked !

  • I am also facing the same problem.I am using TMS320F28335 with CCS 3.3. As, I am a beginner I am doing this with the help of emulator.

    I am using fopen command. then it is giving me warnings with erroneous results on hyperterminal.

    if ((in = fopen("C:\\TCC\\amrut3.txt", "rt"))
        == NULL)
    {
       printf("file can't be open ");

    }
    else
    {

    while (!feof(in))
    {
     ch=fgetc(in);
     k[m]=ch;
     m++;
    }
    }

    I have tried adding .cio in 28335_RAM_ink.cmd file as stated by you. But, I am getting following errors.

              warning: creating .sysmem section with default size of 400 (hex) words.
     
                Use -heap option to change the default size.

            warning: can't find a memory area named 'L0003SARAM' on page 0 for allocation
                of '.cio'
            error: can't find any memory areas for allocation of '.cio'
            error: can't allocate '.cio' into 'L0003SARAM' (page 0)
            error: errors in input - ./Debug/DSP28335_Diag.out not built

  • Hello Amrut,

    Just a suggestion, it is better to start a new thread than append to an old one (and paste a link to the old, relevant thread into your new post if it is helpful).  Once a thread is answered, it is much less likely that you will get a response.

    OK, so to your problem.  The error messages are telling you exactly what the problems are.  First, you do not have the size of the .sysmem section specified in your project properties.  .sysmem is for the heap, which is used by cio functions (such as fopen()).  So, the linker is telling you it is using the default size of 0x400 words, and if you want to change that you should enter something in the -heap box in your project properties (look in the linker propreties, it is there someplace).

    Second, the linker is telling you that it cannot find a memory named L0003SARAM on PAGE=0 in the MEMORY section of your linker command file, but you have allocated one or more sections to that memory in the SECTIONS section.  Do you have a memory named L0003SARAM defined in your linker command file?  I suspect not.  The name of that memory looks suspicious anyway.  Why so many zeros in the name?

    Regards,

    David

  • Hello David,

    I am really thankful to you for your reply. The memory location is just the representative. I am a beginner. I don't have much knowledge about assigning sections. Do you have any material that can help me do that? I have the learning modules given by TI for TMS320F28335. But, there is not much help in those for reading a file. Is there any other better way to read a file in CCS 3.3.

  • Amrut,

    You are welcome.  I am not sure what you mean by "I have the learning modules given by TI for TMS320F28335."  I assume some training material or slides or something.  Anyway, what I'd do is download the code that comes with appnote SPRA958 and use this as a starting template:

    http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=spra958l&docCategoryId=1&familyId=1414

    You can still run in to some build errors though, for instance the appnote examples are not using an heap and therefore do not have a heap size specified in the project options (which is the problem you posted on this forum about).  All you need to do is carefully read the build error or warning, and it usually gives you a decent idea of what you need to do to correct the problem.  One word of advice: never ignor a warning.  It usually means something is wrong.

    Good luck,

    David

  • Hello Deren,

    Can you suggest me some material for working on cmd files. How can I alter them? What care should I take? Whether any changes in them could damage my IC?

  • Amrut,

    Linker command files are documented in the C2000 Assembly Language Tools User's Guide, SPRU513.  I don't see anything you could do that would damage your IC.  The code may not run (for example, you link an initialized section to RAM), but it's not going to damage the device.

    - David

  • Thanks David. Now, my program is working. But, when I am trying to open a bigger file, it is giving me problems. Whether I would have to increase size of my stack?

    Can I  read a single line from a file at a time continuously and display it on hyperterminal. I don't want to store it in an array, as it is taking too much memory. The size of the file I am reading is around 15 KB.

    I am including my program below:

    #include "DSP2833x_Device.h"
    #include <stdio.h>
    #define LSPCLK 37500000
    #define BR115200 115200
    // External Function prototypes
    extern void InitSysCtrl(void);
    extern void InitPieCtrl(void);
    extern void InitPieVectTable(void);
    extern void InitCpuTimers(void);
    extern void ConfigCpuTimer(struct CPUTIMER_VARS *, float, float);

    // Prototype statements for functions found within this file.
    void Gpio_select(void);
    void SCIA_init(void);
    interrupt void cpu_timer0_isr(void); // Prototype for Timer 0 Interrupt Service Routine

    //###########################################################################
    // main code
    //###########################################################################
    void main(void)
    {
    int index =0,m=0; // pointer into string
    char ch;
    char message[10];
    FILE *f;


    f=fopen("G:\\Solution_09\\san.txt","r");

    while (!feof(f))
    {
    ch=fgetc(f);
    message[m]=ch;
    m++;
    }
    fclose (f);


    InitSysCtrl(); // Basic Core Initialization
    // SYSCLK=150MHz, HISPCLK= 75MHz, LSPCLK=37.5MHz
    EALLOW;
    SysCtrlRegs.WDCR= 0x00AF; // Re-enable the watchdog
    EDIS; // 0x00E8 to disable the Watchdog , Prescaler = 1
    // 0x00AF to NOT disable the Watchdog, Prescaler = 64

    Gpio_select(); // GPIO9, GPIO11, GPIO34 and GPIO49 as output
    // to 4 LEDs at Peripheral Explorer

    InitPieCtrl(); // default status of PIE; in DSP2833x_PieCtrl.c

    InitPieVectTable(); // init PIE vector table; in DSP2833x_PieVect.c

    // re-map PIE - entry for Timer 0 Interrupt
    EALLOW;
    PieVectTable.TINT0 = &cpu_timer0_isr;
    EDIS;

    InitCpuTimers(); // Function in: DSP2833x_CpuTimers.c

    // Configure CPU-Timer 0 to interrupt every 50 ms:
    // 150MHz CPU Freq, 50000 µseconds interrupt period
    //ConfigCpuTimer(&CpuTimer0, 150, 50000); // DSP2833x_CpuTimers.c
    ConfigCpuTimer(&CpuTimer0, 150, 50000); // DSP2833x_CpuTimers.c ketan

    SCIA_init(); // Initalize SCI

    // Enable TINT0 in the PIE: Group 1 interrupt 7
    PieCtrlRegs.PIEIER1.bit.INTx7 = 1;

    // Enable CPU INT1 which is connected to CPU-Timer 0:
    IER = 1;

    // Enable global Interrupts and higher priority real-time debug events:
    EINT; // Enable Global interrupt INTM
    ERTM; // Enable Global realtime interrupt DBGM

    CpuTimer0Regs.TCR.bit.TSS = 0; // Start T0

    while(1)
    {
    SciaRegs.SCITXBUF=message[index++]; // send single character
    while ( SciaRegs.SCICTL2.bit.TXEMPTY == 0); //wait for TX -empty

    if (message[index]== '\0') // test '\0' end of string
    {
    index =0;
    while(CpuTimer0.InterruptCount < 2) // 40 * 50ms = 2 sec
    {
    EALLOW;
    SysCtrlRegs.WDKEY = 0xAA; // Service watchdog #2
    EDIS;
    }
    CpuTimer0.InterruptCount = 0;
    }
    }
    }

    void Gpio_select(void)
    {
    EALLOW;
    GpioCtrlRegs.GPAMUX1.all = 0; // GPIO15 ... GPIO0 = General Puropse I/O
    GpioCtrlRegs.GPAMUX2.all = 0; // GPIO31 ... GPIO16 = General Purpose I/O

    GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 1; // SCIRXDA
    GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 1; // SCITXDA

    GpioCtrlRegs.GPBMUX1.all = 0; // GPIO47 ... GPIO32 = General Purpose I/O
    GpioCtrlRegs.GPBMUX2.all = 0; // GPIO63 ... GPIO48 = General Purpose I/O
    GpioCtrlRegs.GPCMUX1.all = 0; // GPIO79 ... GPIO64 = General Purpose I/O
    GpioCtrlRegs.GPCMUX2.all = 0; // GPIO87 ... GPIO80 = General Purpose I/O

    GpioCtrlRegs.GPADIR.all = 0;
    GpioCtrlRegs.GPADIR.bit.GPIO9 = 1; // peripheral explorer: LED LD1 at GPIO9
    GpioCtrlRegs.GPADIR.bit.GPIO11 = 1; // peripheral explorer: LED LD2 at GPIO11

    GpioCtrlRegs.GPBDIR.all = 0; // GPIO63-32 as inputs
    GpioCtrlRegs.GPBDIR.bit.GPIO34 = 1; // peripheral explorer: LED LD3 at GPIO34
    GpioCtrlRegs.GPBDIR.bit.GPIO49 = 1; // peripheral explorer: LED LD4 at GPIO49

    GpioCtrlRegs.GPCDIR.all = 0; // GPIO87-64 as inputs
    EDIS;
    }

    void SCIA_init()
    { Uint16 CountVal;
    SciaRegs.SCICCR.all =0x0007; // 1 stop bit, No loopback
    // ODD parity,8 char bits,
    // async mode, idle-line protocol
    SciaRegs.SCICTL1.all =0x0003; // enable TX, RX, internal SCICLK,
    // Disable RX ERR, SLEEP, TXWAKE

    // SYSCLOCKOUT = 150MHz; LSPCLK = 1/4 = 37.5 MHz
    // BRR = (LSPCLK / (9600 x 8)) -1
    // BRR = 487 gives 9605 Baud

    CountVal = (((LSPCLK/(BR115200)/8)) - 1); //shows error.. solve it
    SciaRegs.SCIHBAUD = CountVal >> 8; // Highbyte
    SciaRegs.SCILBAUD = CountVal & 0x00FF; // Lowbyte

    //SciaRegs.SCIHBAUD = 487 >> 8; // Highbyte
    //SciaRegs.SCILBAUD = 487 & 0x00FF; // Lowbyte
    // SciaRegs.SCIHBAUD = 162 >> 8; // Highbyte
    // SciaRegs.SCILBAUD = 162 & 0x00FF; // Lowbyte
    SciaRegs.SCICTL1.all = 0x0023; // Relinquish SCI from Reset
    }

    interrupt void cpu_timer0_isr(void)
    {
    CpuTimer0.InterruptCount++; // increment time counter
    GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1; // toggle LED at GPIO34
    // Service the watchdog every Timer 0 interrupt
    EALLOW;
    SysCtrlRegs.WDKEY = 0x55; // Service watchdog #1
    EDIS;
    // Acknowledge this interrupt to receive more interrupts from group 1
    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
    }

    //

  • You can perform whatever file I/O manipulation you want, just like a regular C program.  To read a line at a time from a file, you'd need to parse the input characters and look for a new-line or carriage return character.  Then you'd know you read the entire line.  Something like like.

    Realize that you cannot maintain realtime operation when using file I/O.  File I/O operations cause the processor to momentarily stop code execution while the data transfer takes place over JTAG.

    - David

  • Hello David,

    When I use fopen, where does my file get stored? Can I send the contents of file one by one using fopen. I want to take the contents of file one by one. Check it with predetermined values. But, the memory of F28335 is not sufficient to do it as a whole. Can you suggest me any way to do this? Only, this part of project is not working and it is the most crucial part.

    Thanking you,

    Regards,

    Amrut Deshmukh

  • Amrut,

    fopen() just opens a conduit to the file.  The file stays wherever it is on your PC.  When you do fread() or fgetc(), it reads the word of character into the F28335 memory at whatever destination symbol you specified in the function.

    Frankly, I'm not sure what you are trying to do here.  The file I/O in the rts library only works with the emulator connected.  It is intended for debug only, and even then it is pretty intrusive to your application.  When I hear that the file I/O is the "most crucial part" of your application it makes me wonder.  What is your application, and why are you doing file I/O?

    - David

  • David,

    I need to process the data generated by other software into my DSP. That data is currently into a file. I am taking samples of a sine wave of 50Hz (20 ms cycle), every ms. That makes about 1000 samples. How can I process such a large data if memory would fall short. So, can I process a single sample at a time from the file? (that is why I am using fopen to read a file). As all the further processing is dependent on this part, it is the most crucial part of my project.

    Thanking you,

    Amrut

  • Amrut,

    I still don't see how you're going to read the PC file in an real application.  Are you planning to keep the JTAG emulator connected?  Sounds like more of a research project than an actual product.

    Anyway, as I indicated in my previous email, fopen() just creates a link between the F28335 and the file on the PC, with the emulator as the conduit.  It doesn't load anything into the C28x memory.  When you do a read (e.g., fread(), or fgetc) the number of data words you read are loading into whatever destination variable you have specified by the read function.  How you manage that is up to you.  I don't know what algorithm you are applying to the data.  If the algorithm can be done single-sample, then that is a good way to do it.  But if it is something like a FFT where you need all the data available before you can start the algorithm, it will be very very difficult to do.

    - David

  • Hello David,

    I am really thankful to you for helping me. It is a research project. I am storing the data from file (fopen) into an array. Then where will it get stored? I think it would be on DSP. Correct me if I am wrong. 

    You are right about emulator. It is for the first time that we are using DSP in our college. So instead of flashing the program we are using emulator.

    When we use ADC, it can take 12.5 MSPS. Where do these samples get stored? How can I process them in real time?

    -Amrut

  • Amrut,

    When you do a fread() or fgetc() for example, the data is read from the PC file across the JTAG link, and placed in the C28x processor memory at the location of the variable to which you assign it with fread() or fgetc().

    >> When we use ADC, it can take 12.5 MSPS. Where do these samples get stored? How can I process them in real time?

    The ADC results are placed into the results registers of the ADC peripheral.  Your code needs to read these results into a data variable (array) located in memory.  You can then process them.

    - David

  • David,

    My aim is to take entries from one file, process them and then store them in another file. I am storing it in another file to check whether every thing has worked correctly.

    When I use fscanf() for taking floating point number from a file, it is working but when I try to print it using fprintf() function it is giving me error. I want to read the following entries from file. Whether I should use fscanf() or gets() and after that atof()? But, with second option I am again getting an error while using ftoa().

    My text file looks like this:

         .0000000000000          .0000000000000    
        .10000000000000E-02     .71603386860445E-06
        .20000000000000E-02     .69420467142686E-06
        .30000000000000E-02    -.57832807168558E-05
        .40000000000000E-02    -.20406369295612E-04
        .50000000000000E-02    -.40548526990502E-04
        .60000000000000E-02    -.60976867673720E-04
        .70000000000000E-02    -.75539555946393E-04
        .80000000000000E-02    -.78668981056866E-04
    The first column represents time where as second one represents corresponding voltage value.
    Thanking you  for your constant support,
    Amrut