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.

AM5748: DSP Programming

Part Number: AM5748

Hi,

I am working on DSP programming using an AM57x based SoM. Following the sdk documentation, I was able to establish the IPC communication between the DSP & ARM_15.

In the RTOS_template_app,
  1. How can I turn ON/turn OFF a GPIO.
      How to set up a GPIO pin and how to turn ON and OFF it.
      Do we need to make changes to the device tree?
  1. How can make the same application to run on DSP2? Is setting the platform to "ti.platforms.evmDRA7XX:dsp2" is enough? Do we need to make any changes in the XDC Script?

     3. I am trying to add SPI to the RTOS_template_app, I have made pinmux changes,  the necessary code modifications to add McSPI4, compiled and created the symbolic link to the dsp1_firmware.
But while trying to enable the DSP from the user space (via unbind/bind),  the DSP status is showing as offline.
Also, I have observed McSPI library and SPI library in /ti-processor-sdk-rtos-am57xx-evm-06.03.00.106/pdk_am57xx_1_0_17/packages/ti/drv/spi. What is the difference between theses to libraries?
Is there anything to do like modifying the XDC scripts (.cfg file) or any register changes in the board config?
My SPI task is given below:
void spi_test_task(UArg arg0, UArg arg1)
{
    SPI_Params   spiParams;              /* SPI params structure */
    SPI_Handle spiHandle = NULL;
    SPI_Transaction spiTransaction;
    bool status;
    char txBuf[3] = {0x00, 0x00};
    char rxBuf[2] = {0x00, 0x00};

    appPrint("\n spi_test task started");
    /* Default SPI configuration parameters */
    SPI_Params_init(&spiParams);
    spiParams.transferMode = SPI_MODE_BLOCKING;
    spiParams.transferTimeout = SPI_WAIT_FOREVER;
    spiParams.mode = SPI_MASTER;
    spiParams.frameFormat = SPI_POL1_PHA0;
    spiParams.bitRate = 500000;
    spiParams.dataSize = 8;
    spiParams.transferCallbackFxn = NULL;

    /* Open SPI instance */
    spiHandle = SPI_open(BOARD_SPI_INSTANCE, &spiParams);
    if (spiHandle)
    {
        appPrint("\n SPI Handle created");
    }

    /* Configure common parameters with SPI transaction */
    spiTransaction.count = 3;
    spiTransaction.txBuf = (uint8_t *)&txBuf[0];
    spiTransaction.rxBuf = (uint8_t *)&rxBuf[0];


    /* Execute SPI Transaction */
    txBuf[0] = 0x50; // 0x50 = 01010000 = WREG;
    txBuf[1] = 0x00;                   //2nd (empty) command byte
    txBuf[2] = 0x00;          //pass the value to the register
  

    while (spiHandle)
    {
        status = SPI_transfer(spiHandle, &spiTransaction);
        Task_sleep(100);
        if (status == false)
        {
            SPI_close(spiHandle);
            appPrint("\n ERROR: SPI_transfer failed");
            goto SPI_TEST_EXIT;
        }
    }
    Task_sleep(10);
    appPrint("\n spi_test task ended");

SPI_TEST_EXIT:
    appPrint("\nSPI task ended");
    Task_exit();

}

Thanks in Advance.

Regards,

Arun