Forums - htc connection

10 posts / 0 new
Last post
htc connection
angus.ku
Join Date: 3 May 18
Posts: 20
Posted: Mon, 2018-08-27 03:53

Hi

we are running htc demo

We have 2 QCA4024 boards and want to use SPI interface to communication with each other.

I trace this demo code, there are a GPIO interrupt, the pin number of which is 21.

Could u guide us  how to connect this pin from host side to slave side?

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Tue, 2018-08-28 12:03

Pin connection details for SPI using two QCA402x boards:

SPI Slave                SPI Host
GPIO/PIN              GPIO/PIN    
**************************
J5.29           CLK        J5.4
J5.31             CS         J5.2
J5.33          MISO      J5.8
J5.35          INTR       J5.35
J5.39          MOSI      J5.6

Example: J5 pin 29  of SPI slave Clock  is connected to J5 pin 4 of SPI host clock

  • Up0
  • Down0
angus.ku
Join Date: 3 May 18
Posts: 20
Posted: Tue, 2018-08-28 23:18

HI

Thx~ As of now, we can use SPI to transmit data by HTC.

Now , we want to try SDIO interface to commuicate with each other.

Could u supply the pin connection details  for SDIO using two QCA402x boards:

Btw, SDIO pin configuration of Host side which has to be modified was metioned In 80-ya121-140-qca402xcdb2x_development_kit_user_guide.

Do I have to modify SDIO pin configuration of Slave side? ?

 

  • Up0
  • Down0
angus.ku
Join Date: 3 May 18
Posts: 20
Posted: Thu, 2018-08-30 03:11

HI 

Following Development guiode, We have to enable SDIO mode and modify the pin confiuger of Host side.

In Initialization of the HTC Host functionality, We will meet  qapi_SDCCM_Open failed

Could u kindly confirm with SDIO pin connection. 

SDIO Slave            SDIO Host
GPIO/PIN              GPIO/PIN    
******************************
J5.18          CLK         J5.18
J5.19          CMD         J5.19
J5.20          DAT0        J5.20
J5.21          DAT1        J5.21
J5.22          DAT2        J5.22
J5.23          DAT3        J5.23 
 
 
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2018-08-30 16:42

SDIO Pin Connection details

SDIO Slave                                       SDIO Host
GPIO/PIN                                          GPIO/PIN
**************************************
GPIO18 / J5.29           CLK                 J5.29
GPIO19 / J5.31           CMD                J5.31
GPIO20/ J5.33         DATA0            J5.33
GPIO21 / J5.35         DATA1              J5.35
GPIO22 / J5.37        DATA2             J5.37
GPIO23 / J5.39        DATA3             J5.39

  • Up0
  • Down0
angus.ku
Join Date: 3 May 18
Posts: 20
Posted: Thu, 2018-08-30 18:57

Hi Raja,

Thx for giving us the pin connection details for SDIO.

Now, I have confirmed that SDIO connection is right.

First, I type "start 0" to start the target demo application in SDIO mode.

and them, When I try to init HTC in host side, sdio_hal_init still will return error in SDIO demo code.

I found qapi_SDCCM_Open which returns QAPI_ERROR has always failed.

Following is SDIO demo code : sdio.c
#############################################
htc_status_t sdio_hal_init (trans_device_t *tdev)
{
    qapi_Status_t  status;
    uint32  reg_Addr;
    uint8   data_Out;
sdio_device_t *dev = NULL;
    
 
    QCLI_Printf(qcli_sdio_group, "Initialize Master SDIO\n");
 
dev = (sdio_device_t*) malloc(sizeof(sdio_device_t));
 
if (dev == NULL) {
return HTC_NO_MEMORY;
}
 
memset (dev, 0, sizeof(sdio_device_t));
    dev->id = tdev->id;
    tdev->dev = (void *)dev;
 
    /* Populate device configuration reading from DevCFG */
    dev->sdio_Config.adma_Descr_Items = SDIO_ADMA_DESCR_ITEMS;    /* adma descriptor items */
    dev->sdio_Config.SDCC_Bus_Width = SDIO_BUS_WIDTH;      /* sdio bus width 1 bit or 4 bits */
    dev->sdio_Config.freq = SDIO_FREQ;     /* bus frequency */
    dev->sdio_Config.block_Size = SDIO_BLOCK_SIZE;    /* block size */
      
    dev->asyncintdelay = 2;
 
    qapi_Slp_Set_Max_Latency(QAPI_SLP_LAT_PERF);
        
    status = qapi_SDCCM_Init(&dev->sdio_Config, &dev->handle);
    if (status != QAPI_OK)
    {
        QCLI_Printf(qcli_sdio_group, "Master SDIO Init fails  result:%d\n", status);
        goto error;
    }   
    
    status = qapi_SDCCM_Open(dev->handle);      <<<===========  It is alwasy failed 
    if (status != QAPI_OK)
    {
        qapi_SDCCM_Deinit (dev->handle);
        goto error;
 

 

    }
    .
    .
    .

 

Could u tell us what did this function result from ????

 

Sincerely

Angus 

 

 

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Fri, 2018-08-31 11:43

You need to make few changes in the code before trying the SDIO interface to communicate with each other.

Make sure to enable SDIO_TRANSPORT in source code @target\quartz\demo\QCLI_demo\src\targetif\transport\qurt\transport.c
For SDIO:
//#define SPI_TRANSPORT
#define SDIO_TRANSPORT

Change the DevCfg_master_fom_out_cdb.xml file to reflect the following.
<global_def>
<var_seq name="sdio_gpio_arr" type="0x00000002">
0x12, 3, 0, 1, 1,
0x13, 3, 0, 2, 1,
0x14, 3, 0, 2, 1,
0x15, 3, 0, 2, 1,
0x16, 3, 0, 2, 1,
0x17, 3, 0, 0, 1,
end
</var_seq>
<var_seq name="sdio_gpio_off_arr" type="0x00000002">
0x12, 3, 0, 1, 1,
0x13, 3, 0, 2, 1,
0x14, 3, 0, 2, 1,
0x15, 3, 0, 2, 1,
0x16, 3, 0, 2, 1,
0x17, 3, 0, 2, 1,
end
</var_seq>

  • Up0
  • Down0
angus.ku
Join Date: 3 May 18
Posts: 20
Posted: Sun, 2018-09-02 20:59

Do I need to modify the DevCfg_master_fom_out_cdb.xml file for both ?  or Only Host side?

Could u kindly confirm it.

Thx~

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Mon, 2018-09-03 22:26

Modify the DevCfg_master_fom_out_cdb.xml file to configure SDIO HOST controller.
However it should not affect even if you have modified on both sides.

  • Up0
  • Down0
angus.ku
Join Date: 3 May 18
Posts: 20
Posted: Tue, 2018-09-04 23:12

Good day,

First, thank you for information.

Previously, We have confirmed  HTC for SPI that can be transferred  successful.

Now, We initialize HTC host functionality for SDIO that has succeeded.

But Host always waits for block size negotiation with target ,When we  open HTC.

log msg : Peripherals\HTCHost: Waiting for the block size negotiation to finish

Pin connection is correct, but It seems nothing happened to target.

Our pin connection:

https://drive.google.com/drive/folders/1VLI98blEIIICqzrtxcA_wi_A0mz6Hb6o

Could u kindly confirm HTC for SDIO?

Besides, Is it ok for SDIO connection to use  solid wire?

Sincerely

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