# Wifi exp board on legato21 (R15)

**URL:** <https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333>\
**Category:** Uncategorized\
**Created:** [November 14, 2022, 8:44am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333 "2022-11-14T08:44:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 14, 2022, 8:44am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/1 "2022-11-14T08:44:33Z")

</div>

we are following a topic for running the wifi talon exp board on a FX30 (wp77xx) R15 (legato21) and are having issues with the configuration.  
This is the log from the device, where it seems there is an error with the i2c communication:

Nov 14 16:23:04 fx30 user.debug Legato: DBUG | wifiService[1437]/daemon T=main | pa\_wifi\_ap.c GenerateHostapdConf() 401 | LE\_WIFIAP\_SECURITY\_WPA2  
Nov 14 16:23:04 fx30 user.info Legato: INFO | wifiService[1437] | WIFI\_START  
Nov 14 16:23:05 fx30 user.debug Legato: DBUG | wifiService[1437]/daemon T=main | pa\_wifi\_ap.c pa\_wifiAp\_Start() 665 | WiFi hardware started correctly  
Nov 14 16:23:05 fx30 user.debug Legato: DBUG | wifiService[1437]/framework T=main | thread.c SetSchedPolicyAttr() 682 | Set scheduling policy to SCHED\_OTHER for thread ‘WifiApPaThread’.  
Nov 14 16:23:05 fx30 user.debug Legato: DBUG | wifiService[1437]/framework T=WifiApPaThread | thread.c PThreadStartRoutine() 478 | Set nice level to 0.  
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437]/daemon T=WifiApPaThread | pa\_wifi\_ap.c WifiApPaThreadMain() 278 | Wifi event report thread started!  
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437] | WIFIAP\_HOSTAPD\_START  
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437]/daemon T=WifiApPaThread | pa\_wifi\_ap.c WifiApPaThreadMain() 295 | PARSING:WIFI\_SET\_EVENT : len:15  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | /legato/systems/current/apps/wifiService/read-only/pa\_wifi:  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | line 427:  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | /bin/hostapd: not found  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] |  
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437]/daemon T=WifiApPaThread | pa\_wifi\_ap.c WifiApPaThreadMain() 295 | PARSING: (phy #0): unknown event 8 (del\_interface) : len:43  
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437]/daemon T=WifiApPaThread | pa\_wifi\_ap.c WifiApPaThreadMain() 295 | PARSING:phy #0: delete wiphy : len:21  
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437] | mangOH red board  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | sh: write error: Operation not permitted  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR\* failed to read i2c data  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR\* I2c get addr 0x3e value failure  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR\* Set mode 0 failure  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR\* failed to read i2c data  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR\* I2c get addr 0x3e value failure  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR\* Set polarity 0 failure  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR\* failed to read i2c data  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR\* I2c get addr 0x3e value failure  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR\* Set output 1 failure  
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437]/daemon T=main | pa\_wifi\_ap.c pa\_wifiAp\_Start() 696 | WiFi Client Command “WIFIAP\_HOSTAPD\_START” Failed: (32512)

But on the hardware we have setup the UART to be assigned to the LINUX and then activated the GPIO8:  
AT!MAPUART=17,2  
AT+WIOCFG=8,16,1,0

The only extra thing we have noticed is that some of the module are missing now and we are not sure if this board should be run in a different way.  
Any help will be very much appreciated!!!

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 14, 2022, 9:08am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/2 "2022-11-14T09:08:51Z")

</div>

does it work on R14?  
Some user says it should be working on R14:

> **[Missing drivers on FX30 R15 (built from linux source)](https://forum.sierrawireless.com/t/missing-drivers-on-fx30-r15-built-from-linux-source/27342)**
>
> we are updating from R14 to R15 (legato 21) and have an issue with missing drivers for the init script (see attached) for the Talon wifi IoT exp board. R14 will work: 1)Installing the stock firmware (R14.1.1.002 Firmware for Sierra ) 2) run the...

---

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 14, 2022, 10:27am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/3 "2022-11-14T10:27:41Z")

</div>

Yes, we just tested with r14 and it seems working, no luck with the r15 i was wondering if anyone has a clue about this issue?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 14, 2022, 10:54am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/4 "2022-11-14T10:54:16Z")

</div>

Can you chech this and see if it appears in r14 but not in r15?

`Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | /bin/hostapd: not found`

---

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 18, 2022, 8:17am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/5 "2022-11-18T08:17:59Z")

</div>

how do you check to what is mapped UART2?  
AT!MAPUART? will give the mapping of UART1…?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 18, 2022, 8:19am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/6 "2022-11-18T08:19:46Z")

</div>

You can see this:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/2/2babd1f6a5282716a48e6dcf3edd5e53a45846aa.png)

---

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 20, 2022, 11:15pm UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/7 "2022-11-20T23:15:40Z")

</div>

Yup, so it seems that the second interface is mapped to the linux:  
AT!MAPUART?  
!MAPUART: 1,17

The new pa\_wifi script should run the tiwifi setup script part below:

ti\_wifi\_start() {  
lsmod | grep wlcore \>/dev/null  
if [$? -ne 0]; then

```
    # This is only required for WP85, because kernel is different.
    if ["${KVERSION}" = "314"] ; then
        # Check if MMC/SDIO module is inserted. Because WIFI use SDIO/MMC bus
        # we need to remove the SDIO/MMC module
        lsmod | grep msm_sdcc >/dev/null
        if [$? -eq 0]; then
            grep -q mmcblk /proc/mounts
            if [$? -ne 0]; then
                rmmod msm_sdcc
            else
                false
            fi
            if [$? -ne 0]; then
                # Unable to remove. May be others devices use SDIO/MMC bus
                echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
                echo "Unable to remove the SDIO/MMC module... May be in use ?"
                echo "Please, free all SDIO/MMC devices before using TI WIFI."
                echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
                exit 127
            fi
        fi
    fi

    # Enable all GPIOs on all EXPANDERs
    gpioexp 1 1 enable >/dev/null || exit 127

    ### mangOH green has 3 expanders
    # Set IOTO_RESET, GPIO#4/EXPANDER#3 - IOT0 Reset signal is disabled
    gpioexp 3 4 output normal high >/dev/null 2>&1
    if [$? -ne 0]; then
        echo "mangOH red board"

        # Set IOT0_GPIO2 = 1 (WP GPIO13)
        [-d ${GPIO_DIR}13] || echo 13 >${GPIO_EXPORT}
        echo out >${GPIO_DIR}13/direction
        echo 1 >${GPIO_DIR}13/value

        # Set IOT0_RESET = 1 (WP GPIO2)
        [-d ${GPIO_DIR}2] || echo 2 >${GPIO_EXPORT}
        echo out >${GPIO_DIR}2/direction
        echo 1 >${GPIO_DIR}2/value

        # Clear SDIO_SEL, GPIO#9/EXPANDER#1 - Select the SDIO
        gpioexp 1 9 output normal low >/dev/null || exit 127
    else
        echo "mangOH green board"

        # Set IOT0_GPIO2 = 1 (WP GPIO33)
        [-d ${GPIO_DIR}33] || echo 33 >${GPIO_EXPORT}
        echo out >${GPIO_DIR}33/direction
        echo 1 >${GPIO_DIR}33/value

        # Clear SDIO_SEL, GPIO#13/EXPANDER#1 - Select the SDIO
        gpioexp 1 13 output normal low >/dev/null || exit 127
    fi

    # Kernel 3.14 only.
    if ["${KVERSION}" = "314"] ; then
        modprobe msm_sdcc || exit 127
    fi

    modprobe wlcore || exit 127
    modprobe wlcore_sdio || exit 127
    modprobe wl18xx || exit 127
fi
attempt=6
for i in $(seq 1 ${attempt})
do
    if [$i -ne 1]; then
        sleep 1
    fi
    (ifconfig -a | grep wlan0 > /dev/null) && break
done
if [$? -ne 0]; then
    echo "Failed to start TI wifi, interface does not exist."
    exit ${TI_WIFI_PA_NO_IF_ERR}
fi
ifconfig wlan0 up > /dev/null
if [$? -ne 0] ; then
    echo "Failed to start TI wifi, interface can not be brought up."
    exit ${TI_WIFI_PA_NO_IF_UP_ERR}
fi

```

}

but even when I try to run the command manually it seems that the error with the i2c communication still persist…

wifiService[1438] | WIFI\_START  
wifiService[1438] | ERR\* failed to write i2c data  
_wifiService[1438] | FTL Failed to enable PCA9548A I2C switch_\*  
**wifiService[1438] | Clean up due to unknown error**

---

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 20, 2022, 11:21pm UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/8 "2022-11-20T23:21:16Z")

</div>

As it fails for i2c communication, while on the previous legato version it seemed this was using the UART2 communication, I am wondering if we have to change the way the communication with the IoT exp board works?  
Understand this is not something fully supported by SWI, possibly someone experienced with the talon IoT wifi could reply? We are looking at implementing this on several devices and would like to have an understanding of why this is no longer working with the new legato version…

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 21, 2022, 1:11am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/9 "2022-11-21T01:11:56Z")

</div>

it failed on “gpioexp 1 1 enable”, seems not UART2 issue.

---

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 21, 2022, 2:35am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/10 "2022-11-21T02:35:20Z")

</div>

how can you say it fails in that command? we assume it should not cause an i2c communication error if it is only trying to enable the gpioexp…?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 21, 2022, 2:43am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/11 "2022-11-21T02:43:17Z")

</div>

what did you see in console if you type that command?

---

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 21, 2022, 8:32am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/12 "2022-11-21T08:32:04Z")

</div>

thank you for that, you were correct, this is what happens:

root@fx30:~# gpioexp 1 1 enable  
expander#:1 gpio pin:1, i2cAddr:0x3e  
module 1, pin 1 i2cAddr 62 bus 4 bank 1  
Open I2C Bus at, ‘/dev/i2c/4’  
Try open I2C Bus at, ‘/dev/i2c-4’  
Enabling PCA9548A I2C switch…  
Open I2C Bus at, ‘/dev/i2c/4’  
Try open I2C Bus at, ‘/dev/i2c-4’  
ERR\* failed to write i2c data  
FTL\* Failed to enable PCA9548A I2C switch

What is the meaning of this? We didn`t have this problem with the previous version of legato (19).

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 21, 2022, 8:46am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/13 "2022-11-21T08:46:04Z")

</div>

i think this is not related to legato, but i guess there is change of yocto imge in R15 which makes this problem

I wonder if you can modify the tiwifi so that it will skip this line

---

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 21, 2022, 8:54am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/14 "2022-11-21T08:54:46Z")

</div>

I can try to, do you have any reference and documentation about this gpioexp command?  
We can try to rebuild from linux source to see if this solves the problem…

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 21, 2022, 8:59am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/15 "2022-11-21T08:59:40Z")

</div>

I am not sure if FX30 is really using this gpio expander in hardware…  
this gpioexp seems is for mangoh board.

Anyway, source code of gpioexp is in here:  
./build\_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/sierra-init-tiwifi/1.0-r0/gpioexp.c

I suggest you modify tiwifi to see if it works first

---

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 21, 2022, 9:18am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/16 "2022-11-21T09:18:46Z")

</div>

yup, it actually worked.  
Will have a look to see if this can be handled from the legato part itself but I think we will need to re-build the linux image to solve the problem…

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 21, 2022, 9:32am UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/17 "2022-11-21T09:32:17Z")

</div>

how is your modification now in tiwifi to make it work in R15?  
Just comment out this line?

` gpioexp 1 1 enable >/dev/null || exit 127`

Why do you need to modify legato image?  
Didn’t you only need to modify tiwifi?

---

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 22, 2022, 2:02pm UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/18 "2022-11-22T14:02:57Z")

</div>

in order to get it up an running on a new device I need to modify the linux image.  
but have tested a bit more this and it actually doesn’t work…  
even when we comment the exit error, it will get stuck on deploying the kernel modules.  
It would be nice to hear from anyone using the same IoT exp board as I guess this will be the same issue for everybody, or anyone can advise any alternative IoT wifi board?  
we don`t really care and the talon one seems completely without any sort of support

---

<div class="post-metadata">

**Author:** ![ccu](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@ccu](https://forum.legato.io/u/ccu)\
**Post date:** [November 22, 2022, 2:10pm UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/19 "2022-11-22T14:10:03Z")

</div>

it gets stuck on the call  
modprobe wlcore\_sdio || exit 127  
it doesn’t return error or anything but it doesn’t proceed either…

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 22, 2022, 2:51pm UTC](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333/20 "2022-11-22T14:51:33Z")

</div>

For FX30 (WP7702 inside), I remember i need to do the following first in R14:

```auto
cat /proc/kmsg &
modprobe wlcore_sdio.ko
modprobe wlcore.ko
modprobe wl18xx.ko
echo 33 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio33/direction
echo 1 > /sys/class/gpio/gpio33/value
echo 8 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio8/direction
echo 1 > /sys/class/gpio/gpio8/value
wifi client start

```

[Next page](https://forum.legato.io/t/wifi-exp-board-on-legato21-r15/6333.md?page=2)
