• 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.

Parth Modi

  • In reply to Prasad Konnur:

    Hi Prasad,

    Thanks for the reply,

    As of now, Our TDA2x Soc is working on the Slave mode.On slave side, we receive the data perfectly from the master (MOSI).But when we send the data from Slave to Master the First bit is missing on master side(MISO line).We used the SPI mode 3(CPOL = 1and CPHA = 1) for communication.

    if we send the data 129((binary)1000 0001) from the salve then we receive the master side 3 (0000 0011).

    I have attached CRO screenshot for your information.Inside screenshot yellow line is for SCLK and the blue channel is for the MISO line.

    My query  is,

    1) How to resolve this data going wrong on the master side?

    Please suggest us some solution to resolve this issue.

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


    Parth Modi

  • In reply to parth Modi:

    Hi Parth,

    The TDA2 SOC when configured in McSPI slave mode, does not control the clock. It will only responds to the clock sent from the external master. So it cont send the bit before master initiates the clock.

    How have you connected the slave on the board? Are the track lengths of MOSI, MISO and clock same?


  • In reply to Prasad Konnur:

    Hi Prasad,

    Our track length is as per below

    MOSI 312.61 + 4476.41 = 4789.02 mils

    MISO 306.11 + 3208.36 = 3514.47 mils

    CS# 211.32 + 3103.34 = 3314.66 mils

    CLK 248.9 + 3117.13 = 3366.03 mils

    We connected the Master device to the level shifter.

    Tad2x( slave) <-> levelshifter<->MCU(Master)

    We are getting GIO_reclaim stuck after calling GIO_issue for one time.if we call this function for 2 times than it works well(i.e one every time we need to call issues the 2 times data and reclaim claim the 2 times data).

    I have attached my code for your information.

    What is region to behind the struck the GIO_Reclaim?

    We want to take the SPI data on every instance of receive interrupt from the master.Can please share me some example code to implement it.


    Parth Modi2744.mcspiSample_io.c

  • In reply to parth Modi:


    Only for the first time you need 2 GIO_issue, This is to prime the data to be sent as default response from slave.

    The driver internally maintains the queue for the response to be sent in case of slave mode.

    After this you can do GIO_reclaim followed by a GIO_issue.

    In the attached code I see that the issue is called only during priming.

    You can refer the example itself, which does multiple GIO_issue and reclaims.