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.

Writing to 6678 over PCIexpress

Hello all,


I tried to write data from the Linux Host-computer to MDSEVM6678L
and read data drom EVM to Host using modified
project "Hello world" from1234.pcie_test_v0_3_13_w_local_reset.zip
mcsdk_2_01_02_06\tools\boot_loader\examples\pcie\

I used these functions:
writeDSPMemory(9, 0x8000FB80, inputArray, 4);
writeDSPMemory(9, 0x8000FB80, &inputTMP, 4);
writeDSPMemory(9, 0x8000FBC0, &inputArrayFull, 4);
to wtite data into DSP's DDR with the phisical addresses.
And I used the function
readDSPMemory(9, 0x8000FBC4, &outputArrayFull, 4);
to read data from DSP's DDR. Programm indicates that this function
read data from DSP's DDR.
Functions
writeDSPMemory(9, 0x8000FB80, inputArray, 4);
writeDSPMemory(9, 0x8000FB80, &inputTMP, 4);
don't write data into DSP's DDR (tested from CCS with the emulator).
The function
writeDSPMemory(9, 0x8000FBC0, &inputArrayFull, 4);
don't writes data to DSP's DDR when it was set before cycle While.
But the same function succesfully writes data to the DDR's address "0x8000FBC0"
when one was set whithin cycle While.

Apparently it is not correct using of these funtions.

Please help me to revise the code for writing data from Linux Host into DSP's DDR/MSM/L2 correctly.


I used:
Code Composer Studio 5.2.1.00018
mcsdk_2_01_02_06
OS - Debian7

Sourse codes of the modified example is in the attachment.
Sourse code for pcieDdrInit_6678 and pcieLocalReset_6678 was not modified.


Best regards,

  • Hi Viktor,

    I have reviewed your code. Hello world demo running on DDR memory region, Please uncommand the hello world demo load code part and try to write/read the data to DDR memory region with the help of writeDSPMemory().

    In your code you have modified the corenum 0 to 9. But this is no effect. Please take a look at pushData() function.

      /* Load "Hello World" demo into DSP */
      pushData(bootCode, 9, &bootEntryAddr);

    Thanks, 

  • Hi Ganapathi,

    Thank you for your answer.

    Function pushData() based on function writeDSPMemory(newCoreNum, startAddr, tempArray, BLOCK_TRANSFER_SIZE);

    Using function

     writeDSPMemory(9, 0x8000FB80, inputArray, 4);

    or 

    writeDSPMemory(9, 0x8000FA00, inputArray, BLOCK_TRANSFER_SIZE);

    after  

    /* Load "Hello World" demo into DSP */

    pushData(bootCode, 0, &bootEntryAddr);

    /* Write boot entry address into MAGIC_ADDR */
    writeDSPMemory(0, MAGIC_ADDR, &bootEntryAddr, 4);

    takes no effect in my code.

    Best regards,

    Viktor.

    8883.pcie_test_v0_3_15_w_local_reset.zip

    6201.pcie_custom_v3_15.zip

  • Hi Viktor,

    If you want to read/write DSP DDR memory means, please take a look at EDMA_INIT_DEMO part in pciedemo.c file.

    EDMA init demo code read/write the date to DSP DDR memory. It is used for testing PCIe throughput.

    Thanks, 

  • Hi Ganapathi,

    Thank you for your suggest.

    As I understood your previous suggest,

    I used function 

    pushData(writeCode, 9, &bootEntryAddr);

    instead of

    writeDSPMemory(9, 0x8000FA00, inputArray, BLOCK_TRANSFER_SIZE);

    for writing data into DSP's DDR.
    And it does'n work again.

    Could you explain me why did this function worked  incorrectly after calling of the functions

    /* Load "Hello World" demo into DSP */

    pushData(bootCode, 0, &bootEntryAddr);

    /* Write boot entry address into MAGIC_ADDR */
    writeDSPMemory(0, MAGIC_ADDR, &bootEntryAddr, 4);

    ?

    What I did wrongly?

    Thank you.


    Best regards,

    Viktor.

    P.S.

    Last code are attached.

    4377.pcie_test_v0_3_17_w_local_reset.zip

    Sourse code for pcieBootCode_6678.h  was used the same - pcie_custom_v3_15

    (attached in the previous letter)

  • Hi Ganapathi,

    Experiment indicate that after calling of the functions

    /* Load "Hello World" demo into DSP */

    pushData(bootCode, 0, &bootEntryAddr);

    /* Write boot entry address into MAGIC_ADDR */
    writeDSPMemory(0, MAGIC_ADDR, &bootEntryAddr, 4);

    DSP any time doesn't write data from PCIe to DDR.

    I do not know what DSP do during this time, but after this interval DSP

    begin to write received data into DDR properly.

    Can you explain what DSP does during this  interval and what necessary to check

    from the Host to start writing exactly in time?

    Thank you,


    Best regards,

    Viktor.

  • Hi Viktor,

    Hello world demo running on DDR memory. First we need to Load DDR init code into DSP and initialize the DDR and then load the Hello World demo to DSP. Without DDR init code user not able to access DSP DDR memory.

    #if HELLO_WORLD_DEMO
    		/* Load DDR init code into DSP */
    		pushData(ddrInitCode, 0, &bootEntryAddr);
    
    		/* Write boot entry address into MAGIC_ADDR */
    		writeDSPMemory(0, MAGIC_ADDR, &bootEntryAddr, 4);       
    
    		while (1) {
    			readDSPMemory(0, MAGIC_ADDR, buffer, 4);
    			if (buffer[0] == 0)  break;
    			for (i = 0; i < 1000; i++) i++;
    		} 
    
    		/* Load "Hello World" demo into DSP */
    		pushData(bootCode, 9, &bootEntryAddr);
    
    		/* Write boot entry address into MAGIC_ADDR */
    		writeDSPMemory(0, MAGIC_ADDR, &bootEntryAddr, 4);
    #endif

    In your project you have modified the corenum 0 to 9 and try to load bootcode. But this is no effect, pushData() function load the code to DSP DDR memory based on first four bytes(start address) of bootcode.h. Please take a look at pushData() function.

    Thanks,

  • Hi Ganapathi,


    Program loads ddrInitCode into DSP, then write bootEntryAddr of ddrInitCode into MAGIC_ADDR,
    then check condition MAGIC_ADDR==0.
    Then function pushData(bootCode, 0, &bootEntryAddr) writes my bootCode into DSP's DDR
    which is necessary to receive data from Linux-host over PCIe.
    Then function writeDSPMemory(0, MAGIC_ADDR, &bootEntryAddr, 4) writes bootEntryAddr
    into MAGIC_ADDR to start custom programm within DSP.
    There is not necessary to use function pushData(bootCode, 9, &bootEntryAddr),
    because one themselves defines newCoreNum = 9 based on startAddr (9-12th bytes of bootCode),
    so I use function pushData(bootCode, 0, &bootEntryAddr).
    Then programm writes bootEntryAddr of bootCode into MAGIC_ADDR.
    Now DSP busy and will not receive data some time.
    After this interval we can use function writeDSPMemory to write payload data into DSP's DDR.
    I have written it to check myselves, because I was not sure that I exactly undestood you.

    Thank you for your suggests. Really, I think there are necessary to use EDMA_INIT_DEMO
    to build valid data exchange.


    Best regards,

    Viktor.

  • Hi Viktor,

    Thanks for your update.