Forums - Selecting the proper ATH_FIRMWARE_TARGET revision to match the board

8 posts / 0 new
Last post
Selecting the proper ATH_FIRMWARE_TARGET revision to match the board
wrdavis
Join Date: 23 Oct 15
Posts: 17
Posted: Thu, 2015-12-03 12:30

I successfully ran the SP140/SP144 throughput demo out of the box.  I then moved on to compiling the source code for this same demo which successfully compiled.  When I download and run it I get various assertions in the code at power up, all related to interacting with the Wifi initialization.  The places in the code where it fails seems to have #if statements around it that depend on the revision level as defined by ATH_FIRMWARE_TARGET.

The code defaults to:

#define ATH_FIRMWARE_TARGET TARGET_AR400X_REV1

But there are 5 different possible ones provided in a_config.h:

#define TARGET_AR4100_REV2 0x30000582
#define TARGET_AR400X_REV1 0x31C80997
#define TARGET_AR400X_REV2 0x31C80002
#define TARGET_AR400X_REV3 0x31C8270E
#define TARGET_AR400X_REV4 0x32000052
 
In the release notes it just says how to compile, download, and run the demos.  It doesn't address anything about setting a target depending on revision of the board.
 
How can I know which one matches the board that I have?  Is this a function of the firmware load or the chip revision?  The firmware load is whatever is loaded from the factory.  If I lift the sticker from the Wifi chip I can read the following on the chip:
 
QCA4004X-BL3B
NNT917.BUA
1444
CHINA
 
Roger

 

  • Up0
  • Down0
wrdavis
Join Date: 23 Oct 15
Posts: 17
Posted: Fri, 2015-12-04 06:13

I've decided that the a_config.h is benign in that it is setup by the batch file in the installation and the values are not what seems to be causing my problems.  However, I cannot build and run the demo out of the box like the instructions seem to imply despite following the directions carefully.  I would blame the hardware but the demo that came with it ran fine.

Here is where the compiled code fails at startup. First, this assertion occurs in spi_hcd.c:

spi_hcd.c, around #1140
        /* read the buffer space available for this chip, at reset we should have an empty buffer */    
        status = DoPioReadInternal(pCxt, ATH_SPI_WRBUF_SPC_AVA_REG, &pDCxt->spi_hcd.WriteBufferSpace);
        /* save this off for watermark level calculations */
        pDCxt->spi_hcd.MaxWriteBufferSpace = pDCxt->spi_hcd.WriteBufferSpace;
  
        //printf("%d\r\n", pDCxt->spi_hcd.MaxWriteBufferSpace);
        /* NOTE: if this assert fails it suggests that SPI communication with the WIFI device
         * is not functioning. Perhaps the 2 chips are not connected. */
        A_ASSERT(pDCxt->spi_hcd.MaxWriteBufferSpace == EXPECTED_MAX_WRITE_BUFFER_SPACE);
 
The value that is read is usually something larger than the "expected" value, like 4883 instead of 3163.  It seems that since this value changes at runtime, it is dangerous coding to expect a fixed value.  However, if I change the code so that it is happy as long as the value is non-zero, the code proceeds until it gets to this next assertion:
 
driver_init.c, around #706
        do{
            if (Driver_ReadDataDiag(pCxt,
                    TARG_VTOP(HOST_INTEREST_ITEM_ADDRESS(hi_refclk_hz)),
                                     (QOSAL_UCHAR *)&param,
                                     4) != A_OK)
            {
                 A_ASSERT(0);
            }
 
It appears to call down several levels into read/write routines and gets A_ERROR which it passes back up the stack.
 
I was really hoping to work on debugging my own application and not the code that is supposed to work out of the box.  Any help in figuring out what is wrong would be helpful.  The source that I am working with was downloaded per the instructions and the patch applied, etc.
Since I am about a week into a 30-day evaluation license of the IAR compiler, I would like to figure out whether this is going to work before spending $4K on the license.
 
Thanks,
Roger
  • Up0
  • Down0
natie
Join Date: 3 Jun 14
Posts: 9
Posted: Sat, 2015-12-05 01:24

Hi Roger,

Looks like your SPI driver is not working well, I would start debugging that.

 

 

For the version numbers, you can read your target version if you start in BMI mode. Look at the function Driver_GetTargetInfo(). Then you change the define of your target version for the specific hardware you compile for. Anyway, that is how I understand it.

 

I only saw 0x32000052 for the Rev B chipsets. So you can change it but then you will need to make one or two other changes in the driver you download here to get it to work. I don’t think the driver for the QCA400x is very well maintained in this regard.

 

 

  • Up0
  • Down0
wrdavis
Join Date: 23 Oct 15
Posts: 17
Posted: Mon, 2015-12-07 10:04

I suppose I could begin debugging the SPI driver. But it's unmodified from the source that was provided.  That's the problem - the unmodified source code provided does not appear to work when compiled, downloaded, and run.  I'm fairly certain its not a hardware problem because the firmware that came with the board ran fine.

Roger

  • Up0
  • Down0
wrdavis
Join Date: 23 Oct 15
Posts: 17
Posted: Fri, 2015-12-18 10:12

There seems to be a catch-22 here.  I was told that I need to get the version number from Driver_GetTargetInfo() but the code fails before it gets to that place in the code.  It fails at Hcd_Init().  So, I cannot read the version number since the basic problem is that I cannot reliably talk across the interface.


R

  • Up0
  • Down0
natie
Join Date: 3 Jun 14
Posts: 9
Posted: Sat, 2016-01-16 05:16

Its not a catch-22, it is two different problems. You read back 4883 ( 0x1313). It looks like the byte in the tx buffer repeating on the MISO line that can mean the command was not recognized a read-command, the QCA400x does that. You don’t need the revision to read the MaxWriteBufferSpace.

  • Up0
  • Down0
praine
Join Date: 1 Mar 17
Posts: 3
Posted: Thu, 2017-03-02 10:28

Looks like I have a similar issue:

The ‘target version’ reported by Driver_GetTargetInfo() is 0x32000052.

Clearly, TARGET_AR400X_REV4 matches the value returned by Driver_GetTargetInfo(), but if we re-build with this defined there are multiple build errors because only TARGET_AR4100_REV2 and TARGET_AR400X_REV1 appear to be supported in the code.

For example – in “wmi.h” – the following enumerated types are only defined for TARGET_AR4100_REV2 and TARGET_AR400X_REV1:

typedef enum {

#if ATH_FIRMWARE_TARGET == TARGET_AR4100_REV2

    WMI_STORERECALL_STORE_EVENTID   = 0x9004,

    WMI_WPS_GET_STATUS_EVENTID      = 0x9005,

    WMI_WPS_PROFILE_EVENTID         = 0x9006,

    WMI_SOCKET_RESPONSE_EVENTID     = 0x9007,

    /* P2P Events */

    WMI_P2P_GO_NEG_RESULT_EVENTID       = 0x1036, /* 1035 */

    WMI_P2P_INVITE_REQ_EVENTID          = 0x103C,

    WMI_P2P_INVITE_RCVD_RESULT_EVENTID  = 0x103d,

    WMI_P2P_INVITE_SENT_RESULT_EVENTID  = 0x103e,

    WMI_P2P_PROV_DISC_RESP_EVENTID      = 0x103f,

    WMI_P2P_PROV_DISC_REQ_EVENTID       = 0x1040,

    WMI_P2P_START_SDPD_EVENTID          = 0x1045,

    WMI_P2P_SDPD_RX_EVENTID             = 0x1046,

    WMI_P2P_NODE_LIST_EVENTID           = 0x901a,

    WMI_P2P_REQ_TO_AUTH_EVENTID         = 0x901b,

#elif ATH_FIRMWARE_TARGET == TARGET_AR400X_REV1

    WMI_STORERECALL_STORE_EVENTID   = 0x9003,

    WMI_WPS_GET_STATUS_EVENTID      = 0x900e,

    WMI_WPS_PROFILE_EVENTID         = 0x900f,

    WMI_SOCKET_RESPONSE_EVENTID     = 0x9016,

    WMI_P2P_GO_NEG_RESULT_EVENTID       = 0x1036,

    WMI_P2P_INVITE_REQ_EVENTID          = 0x103E,

    WMI_P2P_INVITE_RCVD_RESULT_EVENTID  = 0x103F,

    WMI_P2P_INVITE_SENT_RESULT_EVENTID  = 0x1040,

    WMI_P2P_PROV_DISC_RESP_EVENTID      = 0x1041,

    WMI_P2P_PROV_DISC_REQ_EVENTID       = 0x1042,

    WMI_P2P_START_SDPD_EVENTID          = 0x1045,

    WMI_P2P_SDPD_RX_EVENTID             = 0x1046,

    WMI_P2P_NODE_LIST_EVENTID           = 0x901a,

    WMI_P2P_REQ_TO_AUTH_EVENTID         = 0x901b,

    WMI_P2P_LIST_PERSISTENT_NETWORK_EVENTID  = 0x9030,   

#endif

 

It would seem that either I don’t have the correct driver source code to support my chip, or some modifications need to be made to add declarations for TARGET_AR400X_REV4.

But how do I know what values to use for the above _EVENT_IDs etc.?

There doesn’t appear to be any instructions in the Programmers Guide (80-Y9106-1 Rev. B) for how to do this.

  • Up0
  • Down0
hsims
Join Date: 2 Jun 15
Posts: 1
Posted: Tue, 2017-03-28 16:08

I have also had to deal with this issue.

Basically the provided sample driver has not been updated to support all of the possible defined target revisions. At this point I would be surprised if it ever will be.

Your options are continue compiling for a AR400X_REV1 target or do your best to fill-in-the-blanks and add "or AR400X_REV4" to everywhere a AR400X_REV1 target is mentioned.

The rev 4 target will behave mostly like the earlier revisions, meaning the event ID enumerations will remain the same, etc.

You have to manually fix some boot-related issues that arise (will most likely be in Driver_BootComm() if any do).

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