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.

  • Resolved

RTOS/TDA2HV: Need example code to run in the use case mode

Part Number: TDA2HV

Tool/software: TI-RTOS

Hi All,

We are working on the ADAS's TDA2x platform.We designed our custom board using a TDA2HV processor.We use using the vision SDK for development.We are using the lvds_vip_multicam_view use case. We want to use SPI's data to in our use case.For SPI interfacing TI provided the utils_Mcspi.c and utils_MCspi.h file, This file only contains SPI initialization function.So, how we can write and read into the SPI transmit and receive buffer.

My query is,
1) Can you please share SPI'slave example code in which we can run in the use case?

Please let me know if you need the more information from our side.

Thanks,
Parth Modi

  • Hi Parth,

    Drivers folder has mcspi master slave app that you can refer.
    I can help you with exact path if you specify the VSDK version you are using.
    Thanks.

    Regards,
    Rishabh
  • In reply to Rishabh Garg:

    Hi Rishabh,

    Thanks for the quick support.

    We are using the Vision_SDK 3.0. We want to use this data in the lvds use case.So, Can you please provide as function call for spi init,spi read and writeI?

    Thanks,
    Parth
  • In reply to parth Modi:

    Hi Parth,

    The mcspi example that caters to you requirement is present here: ti_components\drivers\pdk_01_07_00_16\packages\ti\drv\bsp_lld\mcspi\examples\mcspi_spi1tospi2.
    Sysbios mcspi driver is based on GIO model. For init you can use GIO_create API.
    API GIO_issue is used to submit the buffer to the driver and GIO_reclaim is used to get the buffer from the driver.

    Regards,
    Rishabh
  • In reply to Rishabh Garg:

    Hi Rishabh,

    As per your suggestion, I explored the MCSPI example code and I made demo code to test the MCSPI1 on our side. I run this code and I get all the initializing function going pass and but the code is stuck at the GIO_reclaim(mcspiHandle, (Ptr *) &dataparam, NULL, NULL);. I measured the SPI clock and SPI_cs0 line for confirmation to SPI initialization is worked or not.But it not works. I cant get any SPI clock and cs0 line low.

    I called start_spi_sample_new(Void) for all the operation. I attached my code for your information.

    I have some below queries for that,

    1) Is there any mistake in flow?

    2) Can you please share your suggestion to work this code?

    Please let me know if you need more information on our side.

    Thanks,

    Parth Modi

    mcspiSample_io.c

  • In reply to parth Modi:

    Hi Parth,

    You should use GIO_create to first create MCSPI handle.
    Then issue empty buffers using GIO_issue.
    Then only buffers can be reclaimed.
    Can you please modify the start_spi_sample_new and try.

    Regards,
    Rishabh
  • In reply to Rishabh Garg:

    Hi Rishabh,

    According to your suggestion, i check in the code and below is my observation,

    GIO_Create() function is already called by the creat steam function.

    then, We are calling GIO_issue,

    We also checked the return value of MCSPI Handler and it is not null.

    During debugging, i observe that in prime function, GIO_issue is getting fail with below error.

    "Failed to issue empty buffer to stream"

    I am attaching my debug logs and sample application for your reference.

    Please provide your inputs for resolving this.

    Thanks,

    Parth Modi

      3146.mcspiSample_io.c

  • In reply to parth Modi:

    Hi Parth,

    I have asked MCSPI expert to help you further.

    Regards,

    Rishabh

  • In reply to Rishabh Garg:

    Hi Rishabh,

    Thanks for the quick response.

    I am seriously struggling with this issues.
    I very appreciate if you can help us ASAP.

    Let us know if you need any information from our side.

    Thanks,

    Parth Modi
  • In reply to parth Modi:

    Hi Parth,

    You should not do the edma3_init when calling from the vision sdk code, use the sdk utility function to get the edma handle and use it.

    Can you check the return value of the GIO_Issue function and let me know for further analysis?

    Regards,
    Prasad
  • In reply to Prasad Konnur:

    Hi Prasad,

    We have used utility fuction as per your suggession,but Utils_dmaInit() is failing with error "UTILS: DMA: Utils_dmaInit() for instance 0 ... FAILED (-128)".

    We find out  the reson for the failure and it is happening due to we have commented out below two function.

    /*retVal += BspUtils_memInit();

       if (BSP_SOK != retVal)

       {

           GT_0trace(BspAppTrace, GT_ERR, "Error: App MEM Utils Init failed!!\r\n");

       }

       retVal += BspUtils_prfInit();

       if (BSP_SOK != retVal)

       {

           GT_0trace(BspAppTrace, GT_ERR, "Error: App PRF Utils Init failed!!\r\n");

       }*/

    If we tried to uncommented this fuction then during code compilation we are getting below error

     program will not fit into available memory.  run placement with alignment

      fails for section "GROUP_1" size 0xf816696 .  Available memory ranges:

      IPU1_0_DATA_MEM   size: 0xb00000     unused: 0x70ceaa     max hole: 0x70cea8

    So, please suggest us the possible solution to resolve this compilation error.

    We have attached the source code and debug log and comiplation error snapshot for your referance.

    Thanks,

    Parth Modi

    4885.mcspiSample_io.c

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.