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.

MCU-PLUS-SDK-AM273X: I tried many way but MIBSPI still not works each mode: peripheral and controller.

Part Number: MCU-PLUS-SDK-AM273X
Other Parts Discussed in Thread: TMS570LC4357, SYSCONFIG, TMDS273EVM

Tool/software:

I need help  to make MIBSPI works each mode: peripheral and controller.


I checked many items but MIBSPI still not work.
I have no any idea now so need help.

I attach a project file.
Contents are below.

-   check_mibspiA_as_peripheral_am273x-evm_r5fss0-0_freertos_ti-arm-clang
    -   check SPIA as peripheral mode.
    -   Pin assignment:
        -   
            -   from P2 of Schematics e2e.ti.com/.../tmds273evm-where-is-the-tmds273evm-schematic
        -   SPIA_CLK: G19
        -   SPIA_MISO: G17
        -   SPIA_MOSI: H18
        -   SPIA_CS0: F19
    -   SPI controller is script in `script-FT4232HL`
-   check_mibspiA_as_gpioIn_am273x-evm_r5fss0-0_freertos_ti-arm-clang
    -   check SPIA as GPIO input.
    -   SPI controller is script in `script-FT4232HL`
-   check_mibspiB_as_controller_am273x-evm_r5fss0-0_freertos_ti-arm-clang
    -   check SPIB as controller mode.
    -   Pin assignment:
        -   
            -   from P2 of Schematics e2e.ti.com/.../tmds273evm-where-is-the-tmds273evm-schematic
        -   SPIB_CLK: D18
        -   SPIB_MISO: C19
        -   SPIB_MOSI: C18
        -   SPIB_CS0: D19
-   check_mibspiB_as_gpioOut_am273x-evm_r5fss0-0_freertos_ti-arm-clang
    -   check SPIB as GPIO output.
    -   Oscilloscope is used to check waveform.
-   script-FT4232HL
    -   python script to make FT4232HL works.

---

Tryied items to make MIBSPI works are below.

-   a: degital loopback: OK
-   b: analog loopback: OK
-   c: check function MIBSPI_transfer as peripheral: NG
    -   no status errors.
        -   all status are success.
    -   infinity wait
        -   because timeout is set as WAIT_FOREVER
        -   If timeout is set, it failed with timeout error.
-   d: check function MIBSPI_transfer as controller: NG
    -   no status errors.
        -   all status are success.
    -   no waveforms.
        -   SPICLK: always low.
        -   MOSI: always low.
        -   CS0: always high.
        -   It same in pulldown/pullup/nopull.
        -   when reset board and no booting
            -   SPICLK: always high.
            -   MOSI: always high.
            -   CS0: always high.
-   d: waveform check: FT4232HL: OK
    -   with script-FT4232HL
    -   CLK, MOSI, CS are seen with Oscilloscope.
    -   SPICLK is set as 1MHz
    -   waveforms
        -   SPICLK
            -  
        -   MOSI
            -   
        -   CS
            -   
-   e: check SPIA as GPIO input
    -   Result log of check_mibspiA_as_gpioIn is shown below.
    -   It is seen that pin assignment and checking pin selection is right.

```
CLK MISO MOSI HOSTIRQ CS0
1 0 0 0 0
1 0 1 0 0
0 0 1 0 0
0 0 0 0 1
0 0 0 0 1
1 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
1 0 0 0 0
1 0 1 0 0
0 0 1 0 0
0 0 1 0 0
```

-   f: check SPIB as GPIO output
    -   Result of check_mibspiB_as_gpioOut is shown as voltage low/high each of SPICLK, SPIMISO, SPIMOSI, CS.
    -   It is seen that pin assignment and checking pin selection in SPIB is also right.
-   g: check SPIB as GIO

    -   reference: [MibSPI is not working in TMS570LC4357 - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums](e2e.ti.com/.../mibspi-is-not-working-in-tms570lc4357)
    -   SPIFUN, SPIDIR, SPIDSET, SPIDCLR are found in register view.
    -   SPICLK, SPIMOSI, SPICS was checked controllable by there.
    -   

-   others
    -   `MIBSPI_enableLoopback(spihandle, MIBSPI_LOOPBK_NONE)`: no change
    -   `MIBSPI_disableLoopback(spihandle)`: no change
    -   16 byte packet size: no change
    -   2 byte packet size and 16bit transfer size: no change
    -   Enable DMA in SysConfig ON/OFF: no change
    -   clock freq 5MHz/1MHz/0.5MHz: no change
    -   rebuild project and remake project: no change
    -   change USB port on PC and USB cable: no change

---

Best regards.
  • Hi Tanaka-san,

    In check_mibspiA_as_peripheral_am273x-evm_r5fss0-0_freertos_ti-arm-clang, you set SPI to 4-pin mode with expected CS to be F19, but in syscfg you actually set the CS pin to be A2

      

    As a peripheral, you have to wait for the controller to send the expected amount of data. When you run the script-FT4232HL, please check the following pins:

    F19 (CS), G19 (CLK) and H18(MOSI)

    Best regards,

    Ming

  • Hi Ming.

    Thank you for reply.

    I tried to fix it but situation is same.

    When python script for FT4232HL, waveform is watchable as above.

    Did attached project make MIBSPI works in your environment? 

    Situation in my environment is below: 

       - check_mibspiA_as_periferal_am273x-evm_r5fss0-0_freertos_ti-arm-clang

          -   SPICLK, MOSI, CS is worked by python script.

             - They are seen by oscilloscope.

          - but it is stucking.

       - check_mibspiB_as_controller_am273x-evm_r5fss0-0_freertos_ti-arm-clang

         - no waveforms can see.

    Best regards.

  • Hi Tanaka-san,

    1.  For check_mibspiA_as_periferal_am273x-evm_r5fss0-0_freertos_ti-arm-clang

          -   SPICLK, MOSI, CS is worked by python script.

             - They are seen by oscilloscope.

          - but it is stucking.

    [MW] It may be caused by the mis-matching between the FT4232 and the MIBSPIA on AM273x.

    2. For check_mibspiB_as_controller_am273x-evm_r5fss0-0_freertos_ti-arm-clang

    [MW] can you try to change MIBSPIB to MISPIA like the MIBSPI loopback example and see whether you can get any CLK, CS and MOSI?

    Best regards,

    Ming

  • Hi Ming.

    Thank you for advise.

    I would like to know that did attached project make MIBSPI works and could you can see waveform in your environment.

    >[MW] It may be caused by the mis-matching between the FT4232 and the MIBSPIA on AM273x.

    My thinking is below. Mis-matching and I/O problem seems unlikely.

    - Waveform FT4232 outputs is correct.

        - It is seen by image in my first post.

    - Same pins are works with no problem.

       - It is seen by GPIO input project.

    FT4232HL script and peripheral project are attached.

    Could you see setting which cause mis-matching?

    > [MW] can you try to change MIBSPIB to MISPIA like the MIBSPI loopback example and see whether you can get any CLK, CS and MOSI?

    Result of setting MIBSPIA as controller is seem like same the case of MIBSPIB.

    No waveforms are watchable.

    Waveform check method I tried is below.

    MIBSPA and FT4232HL have been connected above My board: TMDS273EVM.

    I have checked waveforms by attaching oscilloscope to FT4232HL pins directly.

    MIBSPIB has been connected to open pin.

    I have checked waveforms by attaching oscilloscope to points in below image.

    Best regards.

  • Dear Ming.

    SPIB controller mode problem is solved.

    It had already been working. Problem was my usage of oscilloscope.

    I had to use single mode of that.

    Because of DebugP_log, main loop is too slow to show with auto mode.

    SPICLK, MOSI, CS0 are correct waveforms.

    SPIA peripheral mode problem is remain.

    When set SPIA to controller mode, SPICLK and MOSI is shown as correct waveform.

    CS0 is not shown.

    I tried 3pin mode, but it is not works too.

    Best regards.

  • Hi Tanaka-san,

    Glad to see that the MIBSPI controller mode is working on both SPIA and SPIB. We will look into the MIBSPI peripheral mode issue you reported. Will update you as soon as we have any progress.

    Best regards,

    Ming

  • Hi Ming.

    Thank you for reply and starting research.

    I hope to find anything to fix problem.

    Best regards.

  • Hi Tanaka-san,

    Due to the coming Thanksgiving holiday, we will get back to you the week of Dec 2nd, 2024.

    Best regards,

    Ming

  • Hi Tanaka-san,

    After discussion with our software development team, we have no plan to add example of the MIBSPI peripheral mode. The current MIBSPI driver will not be updated. If you want to use the MIBSPI as peripheral mode, you have to figure it out on your own.

    Best regards,

    Ming 

  • Hi Ming.

    Thank you for reply.

    I'd like to know that why my project and pyftdi script is not work on TMDS273EVM board.
    The project and pyftdi script has been shared.


    I don't hope to add as examples.

    Best regards.

  • Hi Tanaka-san,

    Due to the resource limitation, we are not able to debug your program for the features we do not officially support.

    Best regards,

    Ming

  • Hi Ming.

    Thank you for support.

    I give up using SPI peripheral mode.

    The conclusion was reached,  this issue is closed.

    Best regards.