TWR-WIFI-AR4100 + TWR-MCF54418

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

TWR-WIFI-AR4100 + TWR-MCF54418

1,104 次查看
oakie_doke
Contributor III

Hi,

I am working with CW10.6. and MQX 4.0.2 + AR4100 patch added. I need to use TWR-WIFI-AR4100 tower module with TWR-MCF54418. There is no example for this platform. I have to port one of available Kinetis examples. I need help with it.

First I want to test my boards. I want to send some command, and check if AR4100 response is correctly, but I can't find in any manuals what exactly I should send through SPI. I want to use embedded AR4100P's stack, not host MQX's stack. I read 80-Y2300-1_A_IP_Stack_Offload_Intf_and_Porting_Gd.pdf document, but I don't fully understand how this communication works.

In wmi.h file there is a list of commands and list of events which are 2 bytes length. When I send any command everytime I get the same response. Few bytes 0x49494900 for first time and 0x20202020 (0x20200020 or 0x20202000) for next sended commands. There is no this values in events list in wmi.h.

SPI clock mode is setted to SPI_CLK_POL_PHA_MODE3, endian to SPI_DEVICE_BIG_ENDIAN, baud rate to 500kHz.

How to contact with Atheros Support? On webside https://support.atheros.com/ login is necessary but there is impossible registration.

I would be very gratefull for any example or suggestions.

0 项奖励
回复
3 回复数

863 次查看
soledad
NXP Employee
NXP Employee

Hello,

Please check the below thread, I hope this helps.

Re: MQX4.0 and TWR-WIFI-AR4100 patch?


Have a great day,

Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

863 次查看
oakie_doke
Contributor III

Hi,

I am trying to port example application. I followed thread which you propose, but still can't run application. I followed steps proposed by Martin Latal. I describe what I did.

1) Skipped. I have installed  MQX 4.0.2 patch.

2) Skipped. Folder atheros_wifi exist in F:\Freescale\twrmcf54418_clone MQX\demo\atheros_wifi\source\atheros_wifi

3) Skipped. I added line

#define ENET_MEDIACTL_VENDOR_SPECIFIC                            _IO(IO_TYPE_MEDIACTL_WIFI,0x81)

to file F:\Freescale\twrmcf54418_clone MQX\mqx\source\io\enet\enet_wifi.h

4) Skipped.

5) Skipped. I'm already working on cloned bsp (twrmcf54418_clone), I cloned it earlier.

6) Done.

7) Done. I dragged atheros_wifi folder and dropped into bsp->Peripheral IO Drivers->enet. I also dragged atheros_phy.c and atheros_phy files and dropped into bsp->Peripheral IO Drivers->enet\phy. I choosed the option to "Link to files and recreate folder structure with virtual folders" relative to MQX_ROOT_DIR.

8) Done. I added suitable C compiler include search paths into C compiler properties:

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/phy"

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/atheros_wifi"

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/atheros_wifi/include"

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/atheros_wifi/include/AR6002"

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/atheros_wifi/include/AR6002/hw4.0/hw"

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/atheros_wifi/include/AR6002/hw2.0/hw"

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/atheros_wifi/custom_src/include"

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/atheros_wifi/custom_src/stack_custom"

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/atheros_wifi/common_src/include"

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/atheros_wifi/common_src/stack_common"

"${MQX_ROOT_DIR}/demo/atheros_wifi/source/atheros_wifi/common_src/wmi"

9) Done.

10) I am confused in this point . In init_enet.c in "${MQX_ROOT_DIR}\demo\atheros_wifi\source\" there already is enet device

const ENET_IF_STRUCT ENET_1 = { 

     &ATHEROS_WIFI_IF, 

     &ATHEROS_PHY_IF, 

     1, 

     1, 

     0, 

}; 

ATHEROS_PARAM_WIFI_STRUCT atheros_wifi_param = { 

BSP_ATHEROS_WIFI_SPI_DEVICE, 

    BSP_ATHEROS_WIFI_GPIO_INT_PIN, 

    BSP_ATHEROS_WIFI_GPIO_PWD_PIN 

};

and ATHEROS_PARAM_WIFI_STRUCT in atheros_wifi.h is

typedef struct param_wifi_struct {

   char_ptr                      SPI_DEVICE; // communication interface

   LWGPIO_PIN_ID                 INT_PIN; // used by wifi chip to notify host

   LWGPIO_PIN_ID                 PWD_PIN; // used to reset wifi device

}ATHEROS_PARAM_WIFI_STRUCT, * ATHEROS_PARAM_WIFI_STRUCT_PTR;

Why this struct has only 3 elements, not 5? There is no *INT_DEVICE an *PWD_DEVICE as in followed thread.

I changed const ENET_PARAM_STRUCT ENET_default_params_wifi[BSP_ENET_DEVICE_COUNT] as in point 10 in followed thread.

11) Skipped. First I want to run program in slower baudrate (10000000).

12) Done.

Added

    #define BSP_ENET_DEVICE_COUNT    (MACNET_DEVICE_COUNT +(BSPCFG_ENABLE_ATHEROS_WIFI?1:0))

and

    #define ATHEROS_WIFI_DEFAULT_ENET_DEVICE    1 

    #if BSPCFG_ENABLE_SPI0    // I use SPI0

    /* in file name, number after : is the mask for chip select. chip select 0 in this case. */ 

    #define BSP_ATHEROS_WIFI_SPI_DEVICE                 "spi0:1" 

    #else 

    #error "SPI0 must be defined in user_config.h" 

    #endif 

    #define BSP_ATHEROS_WIFI_GPIO_INT_DEVICE            "gpio:input" 

    #define BSP_ATHEROS_WIFI_GPIO_INT_PIN               (GPIO_PORT_C|GPIO_PIN_IRQ_FALLING|GPIO_PIN1)  

    #define BSP_ATHEROS_WIFI_GPIO_PWD_DEVICE    "gpio:write" 

    // corresponds to B23 on elevator 

    #define BSP_ATHEROS_WIFI_GPIO_PWD_PIN    (GPIO_PORT_G|GPIO_PIN3)    // I connected suitable pins on TWR-ELEV and TWR-WIFI-AR4100

13) In cust_hw_api.c there already is

fflush(GET_DRIVER_CXT(pCxt)->spi_cxt) in

line 111 (function Custom_Bus_InOutBuffer()),

line 157 (function Custom_Bus_InOutToken()),

line 202 (function Custom_Bus_CompleteTransfer())

I removed lines

    if (SPI_OK != ioctl (pCustCxt->spi_cxt, IO_IOCTL_SPI_SET_CS, &input))

    {

        A_ASSERT(0);

    }

from function Custom_HW_Init().

14) There already is

a_netbuf_ptr->native.FREE = (PCB_FREE_FPTR)freefn;

in line 52 in function a_netbuf_init();

15) Done.

16) Done.

BSP and other MQX libraries and application httpsrv is building properly now, but function ipcfg_init_device_wifi() return error 0xA4FF when it is running.

I put oscilloscope probes to spi bus, there is something sended on MOSI, and some response on MISO.

Do you have any idea what I could do to make it works?

Thanks.

0 项奖励
回复

863 次查看
oakie_doke
Contributor III

Thank You for reply. I saw that thread, but first more helpful would be information how low level SPI frame should look like and how to configure SPI (AR4100 has 16-bit or 8-bit SPI?). I can't find it in any document. I can't identify AR4100 response, so I think I send wrong command or SPI configuration is wrong.

Regards

0 项奖励
回复