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.

RTOS/TMS320C6657: Problems with SPI driver

Part Number: TMS320C6657

Tool/software: TI-RTOS

Hello, Dear Friends!

I am trying to start a transaction for my command, but SPI_transfer() hangs (file in the attachment: knNorDriver.c | line: 67).

I am using next components:

pdk_c665x_2_0_8

bios_6_52_00_12

xdctools_3_50_04_43_core

My project is in the attachment.

My board: TDMSEVM6657

Debug probe: XDS200

What am I doing wrong?

https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/tmsBootFirstPart.7z

  • Hi,

    Let me test this on my TMDSEVM6678. It should be similar with regards to the SPI.

    Best Regards,
    Yordan
  • Zagor,

    Is this test being performed on a custom board or TI EVM platform. What are you trying to achieve with this example code. HAve you run the default SPI LLD examples that we provide for the C6657 EVM and confirm that it is working. I don`t recognize the code kNorDriver.c . Is this TI provided code?

    It appears that you are trying to program a SPI flash n25q256a. If that is the case, I would recommend you to refer to the implementation in the Board flash package in the pdk_c665x_2_0_8\packages\src\flash for programming this NOR flash.

    The best way to debug SPI code functionally is to hook up the scope on the CLK and data lines and ensure that the clock and data and timing matches with the command data sequence in the flash data sheet for read command.

    Please provide responses to above question so we can help provide additional guidance.

    Regards,
    Rahul
  • Rahul,

    I am testing on TI EVM platform, as I wrote above.

    If you tell me about the library <PDK/ti/board/src/flash/include/board_flash.h>, I tried to run it too. I will attach a test project using this library. Function Board_flashOpen() is hang too.

    The only thing that the platform_device_open() function works for me.

    Regards,
    George

    test_flash.zip

  • George,

    Is there any reason that you are not using the flash writer provided in the package at pdk_c665x_2_0_12\packages\ti\boot\writer\nor

    This flash writer code is designed to copy image loaded at base of DDR memory into flash at the address specified in the nor_writer_input.txt file. Please check an example description of how this works located here:
    software-dl.ti.com/.../index_Foundational_Components.html

    Hope this helps.

    Regards,
    Rahul
  • Rahul,

    Why can't I use the SPI driver to communicate with nor flash? Does this driver not work with nor flash?

    I could not run this example: <PDK/packages/ti/drv/spi/example/spi_flash/>.

    Flash writer is using platform_device_*() functions, but this API doesn't suit me.

    Regards,

    George

  • Hi, all!

    Has the question no answer?

    Regards,

    George

  • George,

    The SPI LLD driver has been tested with many serial flash devices as you can see from the complete list of flash devices where this driver has been validated on in the board flash package:
    pdk_c667x_2_0_12\packages\ti\board\src\flash\nor\spi

    If you change the hardware, then you can`t expect to re-use the software. You need to look at the different in the protocol, timing and check on the scope if the modified code is acting as per the requirements of the flash that you have used on the custom HW. We provide the driver and flash programming code as reference that works on TI hardware evaluation platform.

    From a device perspective, we can tell you how to configure the SPI and the driver but any changes/testing on your custom hardware needs to be done by you. Have you put a probe on the chipselect, clock and data line and ensured there is no issue in the read or write commands. Can you atleast get the glash device ID. There are some basic sanity checks that you should do and be specific in the questions that you need answers from TI. 

    Hope this helps. 


    Regards,
    Rahul