Forums - QCA4020 SPI communication not working on my silex board

4 posts / 0 new
Last post
QCA4020 SPI communication not working on my silex board
akshay.b
Join Date: 2 Aug 19
Posts: 62
Posted: Wed, 2019-09-25 07:06

Hello,

I was just testing the SPI communication using QCLI_demo project, i have passed the command on CLI as you can see below.

Here while debugging found that the code is getting stuck at 

qurt_signal_wait(&spi_signal, SPI_SIGNAL_TRNSFR_COMPLETE, QURT_SIGNAL_ATTR_CLEAR_MASK); and also nothing is displaying on logic analyzer as i am using echo mode, kindly suggest me possible solution for this.

Also there is no printfunction called inthe cb function for SPI.

 

Command List:
  Commands:
     0. Ver
     1. Help
     2. Exit
 
  Subgroups:
     3. BLE
     4. HMI
     5. WLAN
     6. Net
     7. Coex
     8. FwUp
     9. LP
    10. Fs
    11. Ecosystem
    12. SecureFs
    13. Crypto
    14. ZigBee
    15. Thread
    16. Peripherals
    17. Platform
    18. JSON
    19. FLASHLOG
    20. UART
 
 
> 16
 
Peripherals> 1
 
Command List (Peripherals):
  Commands:
     0. Ver
     1. Help
     2. Up
     3. Root
 
  Subgroups:
     4. ADC
     5. SENSORS
     6. PWM
     7. Master SDCC
     8. HTCSlave
     9. HTCHost
    10. SPI
    11. GPIO
    12. Keypad
 
 
Peripherals> 10
 
Peripherals\SPI> 1
 
Command List (Peripherals\SPI):
  Commands:
     0. Ver
     1. Help
     2. Up
     3. Root
 
     4. spi_test
 
 
Peripherals\SPI> spi_test 1
 
Thank you
 
Regards,
akshaay
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Mon, 2019-09-30 14:59

Kindly Make sure the JTAG jumper settings are removed while verifying SPI functionality.
 

  • Up0
  • Down0
akshay.b
Join Date: 2 Aug 19
Posts: 62
Posted: Fri, 2019-10-04 01:06

Hello,

Now the SPI is running properly as i can write data and view it on logic analyzer.

How can i accomplish a case for SPI communication where i want to write and read a data continuously in a single chip select operation.

Example : i want to read data in an EEPROM chip, so i Transmit memory address and read a byte from that address in continuous communication. during this entire communication my chip select will be low.

I have written below code for it

 

    data_size_tx = 4;
    data_size_rx = 1;
    
    tx_info.buf_len = data_size_tx;
    rx_info.buf_len = data_size_rx;
 
  //Allocating buffer length for TX & RX using malloc
  //data in rx_info.buf_phys_addr is not set to NULL
 
    tx_info.buf_phys_addr = write_buf;
    rx_info.buf_phys_addr = read_buf;
 
    result = qapi_SPIM_Full_Duplex(hSPI, &spi_device_config, &tx_info, &rx_info, spi_io_complete_cb, NULL);
    if (result != 0)
    {
        QCLI_Printf(qcli_spim_group,"spi write failed with err %x\n",result);
        Test_Result = QCLI_STATUS_ERROR_E;
        return Test_Result;
    }
 
    result = qurt_signal_wait(&spi_Tx_done, sig_mask, QURT_SIGNAL_ATTR_WAIT_ALL);
    if (result != sig_mask)
    {
        QCLI_Printf(qcli_spim_group,"waiting for test thread to finish - failed\n");
        Test_Result = QCLI_STATUS_ERROR_E;
        return Test_Result;
    }
 

ONLY THE TRANSMITTED DATA CAN BE SEEN ON LOGIC ANALYZER AND THE CHIP SELECT GOES HIGH AFTER THAT.

 

Is the code written correctly for the case i need to achieve?

Suggest a solution ASAP.

Thank you.

  • Up0
  • Down0
akshay.b
Join Date: 2 Aug 19
Posts: 62
Posted: Mon, 2019-10-21 04:05

Hello,

Waiting for the reply over SPI communicaiton. A sooner help will be appretiated.

 

Thank you

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.