Selecting the proper ATH_FIRMWARE_TARGET revision to match the board
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
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:
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.
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
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
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.
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.
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).