Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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.

Using C file to write values to variables defined in ASM file

Dear everybody,

I have made a project with CCSv4 and ezUSB C5515. I made an ASM file defining 2 variables like this 

....

.global _tv_outbuf

.global _tv_inbuf 

.sect ".data"
_tv_outbuf
 .space 16*500
_tv_inbuf
 .word 0
 .word 2531
 .word 4848
 .word 6699

.....

In file main.c file: i can read the values of tv_inbuf using way shown in SPRU281A, section 6.5. However, i can not write values to tv_outbuf, data in this section remains zeros all the time. I would like to write using C file

This is my C file:

#ifdef FILE_INPUT
extern Int16 tv_inbuf[];//This is the object
Int16  *tv_inbuf_p = tv_inbuf; //See p138.SPRU 381 - Pointer to file input array
extern Int16 tv_count;//Total number of input samples
Int16 sample_index=0;//Pointer to input samples
extern Int16 tv_outbuf[];//This is the object
Int16  *tv_outbuf_p= tv_outbuf;//This is the pointer to file output array
#endif

...


input[0]=tv_inbuf_p[sample_index];//This works nicely

filter();//Perform filter

tv_outbuf[0]=5;//This doesn't work

...

I do not know how to slove the problem. Please help me. I really appreciate your help.

  • There may be special information on the .data section in the Assembly Language Tools User's Guide that you will need to understand. And the compiler model you use (-c or -cr) may affect the way the .data section is treated.

    .data is normally used for initialized memory space that may reside in a ROM or Flash memory. As such, the compiler will not expect this memory to be writeable by the program code.

    You may need to place the assembly initialized values in a different location or in a different memory section.

  • Dear RandyP,

    Thanks for your extremely fast response.

    Following your instruction, i put the _in_buf in ".data" section and the uninitialized _out_buf in ".bss" section. I also used the command linker file provided with the kit. But it still doesn't work. I can not write the filtered signal to _out_buff. Please tell me how can i fix the problem. CCS4 is new to me and i don't know how to correctly set the compiler model.  Attached with this response is my project. Looking forward to hearing from you.

    Thanks so much RandyP

    lab0_problem.rar