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.

Accessing memory in c5535



hello

i'm using a c5535 ezdsp kit,and ccsv4,

i wanted to know how do i manipulate the contents of the memory in my device,like comparing to data,storing the data ,and other basic arithmatic operations .

im writing the codes in c,not c++ language, i wanted to know the functions for these operations.

thanking you,

srivatsa 

  • Hi Srivatsa,

    Below is a simple program I wrote for eZdsp5535 that shows how to store data into specific memory/register locations with some simple compare and arithmetic operations:

    #include "stdio.h"
    
    #define REG *((unsigned int *)(0x20100))
    
    void main(void) {
    
    	unsigned int v = 0;
    
    	printf("Hello World!\n");
    
    	REG = 0x0000;
    	REG = 0xBEEF;
    	v = *((unsigned int *)(0x20100));  // Arbitrary memory location in SARAM
    	if (v == 0xBEEF) {
    		printf("EQUAL\n");
    	} else {
    		printf("NOT EQUAL\n");
    	}
    	
    	REG += 0x1FBE; // REG = 0xDEAD
    	REG -= 0x1FBE; // REG = 0xBEEF
    
    	REG = 0x0000;  // Clear memory
    
    }
    

    In CCS, you can view the memory location 0x20100 in the Memory Browser. I picked an arbitrary memory location in SARAM. Please let me know if this helps or you have other questions.

    Regards,

    -Jon

  • Hi Jon,

    thanks for the reply.

    It answers most of my question, but will this code run on the ezdsp kit and i'm getting an error while building the target, when i use the DMA/USB Controller Byte Address, how do i solve this??

    i have no problem while using the CPU BYTE ADDRESS.

    Thank you,

    Srivatsa