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.

Question about Importing 10sec wav data into the External SDRAM memory(starting from 0x80000000)

Hello:

    I am the student who is currently doing the audio signal processing project with C6713 floating point DSK and CCSv5.4 tool.

    Since I am the novice of software development using DSP processor, I encountered numerous problems when writing C code.

    My question is the software-level programming and debugging:

    First, I want to use wire and mp3 to import the 10sec whale voice wav signal into the DSK.  I use the Interrupt-based approach of reading in signal. (Namely, if signal comes into the Codec & McBSP, the interrupt event starts to work and CPU executes the ISR. I use API function of McBSP to read in sample-by-sample.  If I suspend the mp3, no signal comes in and CPU executes the main function).

 

        Here is my snapshot of ISR:

Remark: I create the temp variable which is used to receive the instantaneous sample from API function McBSP_read.  Then I create the vector with only length of 1 to store this sample.

The key problem that I got stuck is that I need to use memory copy function to copy each instantaneous sample from the vector to the consecutive space of External SDRAM CE0 (start from 0x80000000).  This memcpy function requires me to input the source and destination address of the value I want to copy from and to.  "sample" is the source address.  But for "exmaddr", I need to start from 0x80000000, but how can I increment it by 2 (each sample is 2bytes) to update the destination address? Since I am doing within the ISR, it is impossible to write "int exmaddr=0x80000000 at the beginning of the ISR.  The samples would never be stored into succeeding memory space of CE0.  

 

When I build, the error is:

how could I deal with the input parameter data type?

 

Another question is that do I have to add:

void *memcpy(void *dest, void *src, size_t count) in the front of main()?

 

Could you give me some suggestions (example code is better) about how to successfully import the voice signal into the CE0 from 0x80000000?

 

(10second Voice signal has 965499 samples. 2byte for each sample.  Total byte is about 2000000)

I need ox1E8480 length space declared in cmd file to store this signal.

 

If you need supplemental code I wrote for reference, please tell me and I would update on time.

 

Thank you very much!

 

Yu

 

 

 

 

 

 

 

  

  • Hi,

    Thanks for your post.

    I think, the syntax of memcpy funtion used in the code is appropriate but you are facing argument datatype conflict error. For this, you have to typecast the desired size argument to the compatible datatype, sothat, you could avoid the datatype incompatibility errors as mentioned above.

    If you need to increment the source and destination pointers mentioned in memcpy function by size of 2 bytes, the third argument which you have mentioned "size_t count" should be 2 which is fine in your code, which means 2 byte size of data would copy from the source address to destination address and appropriately both the pointer would increment the address based on the 32/64 bit compiler which would take care automatically. This shouldn't be an issue in your case.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------

  • Is my this code correct?


    interrupt void serialPortRcvISR()
    {
    Uint32 temp;

    short *point;
    point = (short *) 0x80000000;

    short sample[1]={0};

    temp = MCBSP_read(DSK6713_AIC23_DATAHANDLE);

    sample[0]=temp;
    memcpy(point,sample,2);

    }


    I want to import the frame of data from mp3 to the CE0.
    Since I was baffled by the type inconsistency, here I defined a pointer type variable which is okey for the memcpy input.
    But how could I view whether I have successfully imported the frame or not?

    I need the memory browser?
    I checked the browser and nothing was in there!

    I checked temp in expression but nothing was in there!

    Could you please give me some suggestions about how to check whether the samples have been imported into CE0 or not?

    Thanks a lot

    Yu