I use BBB + TI SDK3.0 to talk to a custom Wilink 1873 (not 1837) board and have a question about WL_EN voltage level setting during powering up of Wilink . According to WLxx power up sequence requirements, WL_EN (GPIO026) should not be asserted before stabilization of Vbattery(3.3V), VIO (1.8V) and slow clock (SCLK2, 32.768kHz) to avoid damage to Wilink chip.
Q1: For most example device tree, I saw WL_EN gpio line is setup as below. After rebooting, WL_EN line becomes high. Because SCLK2 is also enabled in my device tree, how can I make sure WL_EN is enabled high after SCLK.
wlan_en_reg: fixedregulator@1 {
compatible = "regulator-fixed";
regulator-name = "wlan-en-regulator";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
gpio = <&gpio0 26 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
pinctrl-single,pins = <
0x28 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_ad10.gpio0_26 WL_EN*/
…
I noticed some example device tree includes the line below in wlan-en_reg setup:
Startup-delay-us = <70000>
What does the line above do exactly? Will it delay turn on of WL_EN line?
Q2: For experiment, I tried to set WL_EN low using the device tree below and WL_EN line becomes low after booting. But how can I bring WL_EN high again manually. I will ask the question in more detail in Q3.
wlan_en_reg: fixedregulator@1 {
compatible = "regulator-fixed";
regulator-name = "wlan-en-regulator";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
gpio = <&gpio0 26 GPIO_ACTIVE_LOW>;
enable-active-low;
};
pinctrl-single,pins = <
0x28 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad10.gpio0_26 WL_EN*/
…
Q3: How to manually enable WL_EN line?
I cannot manually write to GPIO0_26 to change its output status. But I know ifconf wlan0 up or down can do the trick. What’s the difference here? I read one is software, but it becomes hardware after being tied to a voltage regulator. Please help to finish the paragraph here…
root@am335x-evm:/sys/class/gpio# echo 26 > export
-sh: echo: write error: Device or resource busy
root@am335x-evm:/sys/class/gpio# cat /sys/kernel/debug/gpio
GPIOs 0-31, platform/44e07000.gpio, gpio:
gpio-6 ( |cd ) in lo IRQ
gpio-26 ( |wlan-en-regulator ) out hi
GPIOs 32-63, platform/4804c000.gpio, gpio:
gpio-44 ( |sysfs ) out lo
gpio-53 ( |? ) out lo
gpio-54 ( |? ) out lo
gpio-55 ( |? ) out hi
gpio-56 ( |? ) out lo
Q4: What does it take for ifconfig command to list wlan0?
With my E14 WL1837 wireless cape, running ifconfig command will list wlan0. Somehow I could not bring up wlan0 up on my custom WL1873. I am very certain about the following:
- The device tree setup, but please check the attachement
- WL1873 draws around 10mA from power supply,
- WL_EN is high and Vbattery(3.3V), VIO (1.8V) and slow clock (32.768kHz) are stable,
- Wlink in debug mode: UART_DGB_BT = 1, WL_IRQ = 1, AUD_OUT_BT = 0
- BBB has TI SDK 3.0, Wilink8 adds-on, Bluetopia Bluetooth stack
Do I need to manually insert all Wi-Fi related modules? Shouldn’t all the Wi-Fi modules be automatically loaded after booting? Any ideas for me to debug this issue?
Q5: Why should WL_EN be tied to a 1.8V regulator as described in the device tree? Can any independent GPIO port be used to turn On/Off WI-FI on WL18xx?. Why not 3.3V regulator? Please help me understand more about attaching GPIO to hardware.