4 Replies Latest reply on Jul 28, 2017 6:50 AM by GauravS_31

    How to use GPIO_0 (WL_HOST_WAKE) on CYW43438?

      Hi all,

       

      We want to use CYM43438 in our product for WiFi connectivity. And our topology is below:

      RTOS-SOC <<=====(SDIO)=====>> CYM43438 <<===(WL_REG_ON + WL_HOST_WAKE) ====>> MCU

       

      Attached file contains the block diagram with more details. In summary

      - RTOS-SOC: acts as HOST and communicate with CYM43438 via SDIO

      - MCU: enables CYM43438 via WL_REG_ON GPIO and waits for CYM43438 to wake it up via WL_HOST_WAKE PIN.

       

      Our goal is to know how to use those PINs especially GPIO_0 (WL_HOST_WAKE) to wake up the MCU via WIRELESS WAKE ON LAN. However it seems that we have not yet found any guidance document to achieve this goal.

       

      So it would be great if you can help me to give some guide or documents on how to control those GPIOs PIN on CYM43438?

       

      Thank you,

      Hieu Le.

        • 1. Re: How to use GPIO_0 (WL_HOST_WAKE) on CYW43834?
          GauravS_31

          I believe you are using CYW43438 in your design and not CYW43834. Please correct me if I am wrong. For Wireless Wake On LAN, you can refer to the WL commands on WOWL in the document Cypress WLAN Client Utility Command Set Band Edge

           

          The pin WL_HOST_WAKE is used for OOB (out of band interrupt) for WLAN. Do you need OOB IRQ in your design?

          2 of 2 people found this helpful
          • 2. Re: How to use GPIO_0 (WL_HOST_WAKE) on CYW43834?

            Dear grsr,

             

            Thank you so much for the reply. Sorry I had a mistake on part number. Yes our product will use CYM43438.

             

            Let me summary a bit about our goal. Sorry I was not so clear on the question:

            - Topology:

            RTOS-SOC <<=====(SDIO)=====>> CYM43438 <<===(WL_HOST_WAKE) ====>> MCU

             

            - Application:

            When MCU and RTOS-SOC are in sleeping mode, CYM43438 RECEIVED WoWLAN (Wireless Wake On LAN ) from the EXTERNAL SOURCE (e.g: phone or laptop), then it DRIVES the WL_HOST_WAKE PIN to wake up MCU.

             

            So my question is:

            - Is CYM43438 capable of this task? If yes, please enlighten me with some document or the staring point?

            - For quick test, can we use Pi3 (with also use CYM43438) for this purpose? It would be simple as PC sends WoWLAN packet and TOGGLE WL_HOST_WAKE pin.

            - Is there any source code for "wl" utility tool you mentioned on your answer? I want to try it out on Pi3.

             

            Thank you very much,

            Hieu

             

            • 3. Re: How to use GPIO_0 (WL_HOST_WAKE) on CYW43834?
              GauravS_31

              I need to know whether you will use linux kernel or WICED SDK in your design. The answer below is valid for WICED SDK.

               

              The pin WL_HOST_WAKE is used for Out of band (OOB) interrupts in CYW43438. When the host MCU is in sleep mode, this pin is used to trigger an interrupt and wake up host MCU whenever wifi chip would receive data. In WICED platform BCM943438WCD1, it is connected to pin PC6 of the host STM32F411 processor as shown in the attached schematic. During the SDIO bus init process (wwd_bus_init() in /43xxx_Wi-Fi/WICED/WWD/internal/bus_protocols/SDIO/wwd_bus_protocol.c attached), the OOB interrupt is set to the correct WLAN GPIO pin which for 43438 is GPIO_0 using wwd_bus_sdio_set_oob_interrupt( host_platform_get_oob_interrupt_pin( ) ) and subsequently the OOB host interrupt is enabled using host_enable_oob_interrupt( ) as shown in /43xxx_Wi-Fi/WICED/platform/MCU/STM32F4xx/WWD/wwd_SDIO.c attached. If you check the definition of host_enable_oob_interrupt( ), the function platform_gpio_init( &wifi_sdio_pins[WWD_PIN_SDIO_OOB_IRQ], INPUT_HIGH_IMPEDANCE ); is used to initialise the host GPIO pin where wifi_sdio_pins[WWD_PIN_SDIO_OOB_IRQ]={ GPIOC,  6 } which is basically the PC6 pin of the host. This mapping is found in /43xxx_Wi-Fi/platforms/BCM943438WCD1/platform.c attached here. After this, the function platform_gpio_irq_enable( &wifi_sdio_pins[WWD_PIN_SDIO_OOB_IRQ], IRQ_TRIGGER_RISING_EDGE, sdio_oob_irq_handler, 0 ); causes an interrupt to be triggered whenever there is a rising edge on this pin. The interrupt handler sdio_oob_irq_handler( void* arg ) would cause the host MCU to exit powersave mode and wake up. I have enquired internally to find out if there are any other settings that are required to enable OOB.

               

              Alternately you can use WOWL to wake up the host MCU using WL commands. The test.console app is available for the same. In the console.mk file, you need to set CONSOLE_ENABLE_WL ?= 1 to enable WL commands and then use UART terminal to send WOWL commands.

               

              If you are using linux driver, then please create a separate thread in our linux community here https://community.cypress.com/community/linux.

              1 of 1 people found this helpful
              • 4. Re: How to use GPIO_0 (WL_HOST_WAKE) on CYW43834?
                GauravS_31

                In addition, for every WLAN to host interrupt, if OOB is configured, WLAN would also send OOB interrupt. When the host is sleeping, in-band interrupt is not possible because the host will not respond. In addition to the above, WLAN can be configured to send OOB using nvram. The following nvram values in wifi_nvram_image.h are used to control the OOB and GPIO pin:

                 

                #sd_gpout=0  /* Mask for GPIO */

                #sd_gpval=1 /* Value of GPIO */

                #sd_oobonly=1 /* Send to OOB only */

                 

                Regarding WOWL, the WLAN can only wake up the host based on certain data pattern. However CYW43438 does not have WOWL enabled so it cannot be used.

                 

                 

                1 of 1 people found this helpful