This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Any limitations in loading the WiFi drivers at boot in Linux?

Other Parts Discussed in Thread: WL1271

I have been trying to get the TI WLAN drivers to load without any interaction from the command line (i.e. I want the install.sh to run automatically). However when I try to do this from a Matrix application or from the init.d at boot, though the script runs through to completion, seeming successfully (though I have seen it crash at boot before), it does not appear to be accessible. I see the control point in /var/run/tiwlan0 but the utilities (wlan_cu, wpa_cli, wpa_gui) are unable to contact the supplicant. On the other hand if I just log on to the board through the UART terminal and run install.sh manually it goes fine and everything works.

Has anyone gotten the TI WLAN drivers to load automatically at boot? Any ideas on what I could be doing wrong?

  • Bernie - Can you post any boot scripts you have come up with so that I can take a look?  Thanks.

    Steve K.

  •  

    Hi Berne,

    I have come across similar issue while running 'install.sh at boot and found that the install.sh is based on relative folder paths. So it could not locate some files and failed.

    On my file system, the WLAN/BT packages have been installed under /opt/

    I have created one wlan_install.sh (changed relative paths to absolute paths where the files have been saved) under /etc/init.d/ and created one softlink from /etc/rc5.d/S99wlan

    ie. # ln -s /etc/init.d/wlan_install.sh S99wlan

    Here is my script:

    ==================================================================

    if [ -d /opt/ti-wlan-modules ]; then
        echo "Installing WL1271-WLAN kernel modules..."

        echo "- sdio.ko"
        insmod /opt/ti-wlan-modules/sdio.ko
        if [ "$?" -eq "0" ]; then
            echo "  Success"
        else
            echo "  Failed"
        fi

        echo "- bmtrace.ko"
        insmod /opt/ti-wlan-modules/bmtrace.ko
        if [ "$?" -eq "0" ]; then
            echo "  Success"
        else
            echo "  Failed"
        fi

        echo "- tiwlan_drv.ko"
        insmod /opt/ti-wlan-modules/tiwlan_drv.ko
        if [ "$?" -eq "0" ]; then
            echo "  Success"
        else
            echo "  Failed"
        fi

       
    else
        echo "WL1271-WLAN kernel modules not available"
        exit 1
    fi

    echo "Loading firmware..."
    /opt/ti-wireless/tiwlan_loader -i /opt/ti-wireless/tiwlan.ini -f /opt/ti-wireless/firmware.bin
    if [ "$?" -eq "0" ]; then
        echo "Success"
    else
        echo "Failed"
    fi

    echo "Bringing-up the WLAN interface..."
    ifconfig tiwlan0 up
    if [ "$?" -eq "0" ]; then
            echo "Success"
    else
            echo "Failed"
    fi


    echo "Starting wpa_supplicant..."
    wpa_supplicant -Dwext -itiwlan0 -c /opt/ti-wireless/wpa_supplicant.txt &
    if [ "$?" -eq "0" ]; then
            echo "Success"
    else
            echo "Failed"
    fi

    echo ""
    echo "Now you may run the application \"./wlan_cu\""

    echo ""

    ====================================================================

     

    Here is my serial console logs:

    ====================================================================

    Wed May 12 18:39:00 UTC 2010
    INIT: Entering runlevel: 5
    Starting system message bus: dbus.
    Starting telnet daemon.
    Starting syslogd/klogd: done
    Starting thttpd.
    Starting PVR
    Starting Matrix GUI application.
    Installing WL1271-WLAN kernel modules...
    - sdio.ko
      Success
    - bmtrace.ko
      Success
    - tiwlan_drv.ko
    TIWLAN: driver init
      Success
    Loading firmware...
    Success
    Bringing-up the WLAN interface...
    TIWLAN:
    ...init_config: invalid int value for <RxFemInsertionLoss_2_4G> : 0E  # 14


    ###################### FEM0 parameters #########################

    # (for Single bend 2.4G parameters FEM0 (RFMD 3.0) HDK20)

    #RxTraceInsertionLoss_2_4G = 0
    #TXTraceLoss_2_4G = 0
    #RxRssiAndProcessCompensation_2_4G  = ec,f6,00,0c,18,f8,fc,00,08,10,f0,f8,00,0a,14
    #TXBiPReferencePDvoltage_2_4G = 0x0164
    #TxBiPReferencePower_2_4G  = 0x80
    #TxBiPOffsetdB_2_4G = 00
    #TxPerRatePowerLimits_2_4G_Normal = 1c,1f,22,24,28,29
    #TxPerRatePowerLimits_2_4G_Degraded = 19,1f,22,23,27,28
    #TxPerChannelPowerLimits_2_4G_11b = 50,50,50,50,50,50,50,50,50,50,50,50,50,50
    #TxPerChannelPowerLimits_2_4G_OFDM = 50,50,50,50,50,50,50,50,50,50,50,50,50,50
    #TxPDVsRateOffsets_2_4G = 01,02,02,02,02,00
    #TxIbiasTable_2_4G  = 1a,1a,1a,1a,1a,21
    #RxFemInsertionLoss_2_4G  = 0x10

    ##############################################################################################################################
    ################################################## Radio
    TIWLAN:
    ...init_config: invalid int value for <RxTraceInsertionLoss_2_4G> : 0E
    TXTraceLoss_2_4G  = 0E
    RxRssiAndProcessCompensation_2_4G = ec,f6,00,0c,18,f8,fc,00,08,10,f0,f8,00,0a,14
    TXBiPReferencePDvoltage_2_4G = 177  #375 mV
    TxBiPReferencePower_2_4G = 80       #128 mV
    TxBiPOffsetdB_2_4G = 0
    TxPerRatePowerLimits_2_4G_Normal = 1c,1f,22,24,28,29
    TxPerRatePowerLimits_2_4G_Degraded =19,1f,22,23,27,28
    TxPerChannelPowerLimits_2_4G_11b = 50,50,50,50,50,50,50,50,50,50,50,50,50,50
    TxPerChannelPowerLimits_2_4G_OFDM = 50,50,50,50,50,50,50,50,50,50,50,50,50,50 
    TxPDVsRateOffsets_2_4G = 01,02,02,02,02,00
    TxIbiasTable_2_4G = 11,11,15,11,15,0f
    RxFemInsertionLoss_2_4G  = 0E  # 14


    ###################### FEM0 parameters #########################

    # (for Single bend 2.4G parameters FEM0 (RFMD 3.0) HDK20)

    #RxTraceInsertionLoss_2_4G = 0
    #TXTraceLoss_2_4G = 0
    #RxRssiAndProcessCompensation_2_4G  = ec,f6,00,0c,18,f8,fc,00,08,10,f0,f8,00,0a,14
    #TXBiPReferencePDvoltage_2_4G = 0x0164
    #TxBiPReferencePower_2_4G  = 0x
    TIWLAN:
    ...init_config: invalid int value for <TXTraceLoss_2_4G> : 0E
    RxRssiAndProcessCompensation_2_4G = ec,f6,00,0c,18,f8,fc,00,08,10,f0,f8,00,0a,14
    TXBiPReferencePDvoltage_2_4G = 177  #375 mV
    TxBiPReferencePower_2_4G = 80       #128 mV
    TxBiPOffsetdB_2_4G = 0
    TxPerRatePowerLimits_2_4G_Normal = 1c,1f,22,24,28,29
    TxPerRatePowerLimits_2_4G_Degraded =19,1f,22,23,27,28
    TxPerChannelPowerLimits_2_4G_11b = 50,50,50,50,50,50,50,50,50,50,50,50,50,50
    TxPerChannelPowerLimits_2_4G_OFDM = 50,50,50,50,50,50,50,50,50,50,50,50,50,50 
    TxPDVsRateOffsets_2_4G = 01,02,02,02,02,00
    TxIbiasTable_2_4G = 11,11,15,11,15,0f
    RxFemInsertionLoss_2_4G  = 0E  # 14


    ###################### FEM0 parameters #########################

    # (for Single bend 2.4G parameters FEM0 (RFMD 3.0) HDK20)

    #RxTraceInsertionLoss_2_4G = 0
    #TXTraceLoss_2_4G = 0
    #RxRssiAndProcessCompensation_2_4G  = ec,f6,00,0c,18,f8,fc,00,08,10,f0,f8,00,0a,14
    #TXBiPReferencePDvoltage_2_4G = 0x0164
    #TxBiPReferencePower_2_4G  = 0x80
    #TxBiPOffsetdB_2_4G = 00
    #Tx
    TIWLAN: 4106.061627: pInitParams->RoamingScanning_2_4G_enable 0
    SDIO clock Configuration is now set to 24Mhz
    After sdioDrv_ConnectBus, iStatus=0
    After SD_IO_GO_IDLE_STATE, iStatus=0
    After VDD_VOLTAGE_WINDOW, iStatus=0
    After SD_IO_SEND_RELATIVE_ADDR, iStatus=0
    After SD_IO_SELECT_CARD, iStatus=0
    After w 0x82, iStatus=0
    After r 0x82, iStatus=0
    After w 0xC8, iStatus=0
    After CCCR_BUS_INTERFACE_CONTOROL, uCount=1
    After CCCR_IO_ENABLE, uCount=1
    TIWLAN: 4106.314496: CHIP VERSION... set 1273 chip top registers
    TIWLAN: 4106.321027: Working on a 1273 PG 2.0 board.
    TIWLAN: 4106.325818: Starting to process NVS...
    TIWLAN: 4106.330121: No Nvs, Setting default MAC address
    TIWLAN: 4106.335217: pHwInit->uEEPROMCurLen: 1c
    TIWLAN: 4106.339520: ERROR: If you are not calibating the device, you will soon get errors !!!
    TIWLAN: 4106.348065: Chip ID is 0x4030111.
    TIWLAN: 4106.352246: FEM Type 1
    TIWLAN: 4106.355511: Starting to download firmware...
    TIWLAN: 4106.429730: Starting to download firmware...
    TIWLAN: 4106.445172: Starting to download firmware...
    TIWLAN: 4106.450543: Starting to download firmware...
    TIWLAN: 4106.459515: Starting to download firmware...
    TIWLAN: 4106.466412: Starting to download firmware...
    TIWLAN: 4106.473279: Finished downloading firmware.
    TIWLAN: 4106.477978: Firmware running.
    TIWLAN: 4106.511670:
    TIWLAN: 4106.513715: --------------------------------------------------------------------
    TIWLAN: 4106.521741: Driver Version  : WiLink_Driver_6.1.0.0.130
    TIWLAN: 4106.527570: Firmware Version: Rev 6.1.0.0.313
    TIWLAN: 4106.532452: Station ID      : 08-00-28-12-34-56
    TIWLAN: 4106.537579: --------------------------------------------------------------------
    TIWLAN: 4106.545544:
    Success
    Starting wpa_supplicant...
    Success

    Now you may run the application "./wlan_cu"

    TIWLAN: 4106.569104: Interrogate TX/RX parameters

     _____                    _____           _         _  
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_| 
                  |___|                    |___|           

    Arago Project http://arago-project.org dm3730-am3715-evm ttyS0

    Arago 2010.05 dm3730-am3715-evm ttyS0

    dm3730-am3715-evm login: root   
    ==================================================================

     

    Thanks,

    Sinoj

  • I had adjusted my paths just like yours Sinoj, but I missed one part, it was the tiwlan_loader part of the script, apparently if you do not successfully load the firmware (which happens if you run it like the original script with no arguments from a different path) you end up with a crash and core dump, this explains why I was seeing a crash when I tried to run it at boot sometimes (not really sometimes, now I believe it only happened after I had tried to adjust the paths in the install.sh and run it out of init.d) . With that fixed, my script now matches Sinoj's, and it appears to be succeeding at boot.

    What I had tried to do originally which was failing oddly (everything seemed to complete successfully but the configuration utilities could not contact the supplicant) is more like the below. Essentially I tried to have the script move its working directory to the place I had installed the WiFi drivers, execute the script, and than return to the original working directory to keep from messing up other scripts.

    Bernie's not so working WiFi loader script said:

    echo "Loading the WL1271 WiFi Drivers..."
    currentWorkingDirectory=`pwd`
    echo "This is my current working directory:"
    echo $currentWorkingDirectory
    echo "Changing directory to /opt/ti-wireless"
    cd /opt/ti-wireless
    pwd
    echo "Running Install Script..."
    ./install.sh
    cd $currentWorkingDirectory
    echo "Returning to the original directory"
    pwd
    echo "Loading complete..."
    echo "You may now use the WiFi Utility..."

    I am guessing there is something special about the working directory when executing as a boot script which throws off the initialization of the supplicant, or there is something fundamentally wrong with this approach I have not caught yet.

    In any case with the other script working, my goal has been achieved, thanks for the help.