Changes between Version 37 and Version 38 of expansion/gw16130


Ignore:
Timestamp:
07/08/2020 06:47:52 PM (2 years ago)
Author:
Tim Harvey
Comment:

updated eeprom config with new default

Legend:

Unmodified
Added
Removed
Modified
  • expansion/gw16130

    v37 v38  
    6868 * CBUS3: not connected
    6969
    70 By default the FTDI EEPROM is configured by gateworks such that all 4 of the CBUS pins are configured for IOMODE/GPIO mode which means that you need to enable CBUS0 gpio to enable the modem.
     70By default (for all GW16130 boards manufactured after Jul 8, 2020) the FTDI EEPROM is configured by Gateworks such that CBUS0 is configured to always drive a logic high level (DRIVE1) to enable the modem at powerup and the other CBUS pins are configured as GPIO.
    7171
    72 '''Important''' Run the following to configure GPIO & enable the modem (requires a 4.20 kernel or newer) :
    73 {{{
     72If you wish to be able to disable the modem you can use the {{{ftx_prog}}} utility to alter the EEPROM configuration for CBUS0 and make it a GPIO then use either Linux gpiolib (/sys/class/gpio) as shown below or some other means (such as an application using libftdi) to manipulate it. If you change CBUS0 to a GPIO the modem will by default be disabled (due to the 10k pull-down on that signal) until you configure the GPIO to output a logic high.
     73
     74The {{{ftx_prog}}} utility is an open source program that uses libftdi and can be easily built:
     75{{{#!bash
     76sudo apt-get install git build-essential gcc make libftdi-dev
     77git clone https://github.com/richardeoin/ftx-prog.git
     78cd ftx-prog
     79make
     80}}}
     81
     82The following commands are used to configure the FTDI EEPROM such that the CBUS0 is a GPIO:
     83{{{#!bash
     84sudo ./ftx_prog --cbus 0 GPIO # configure CBUS0 as GPIO
     85}}}
     86
     87And if you want to re-configure it to change it back to Drive_1 to make the modem always enabled at power-up:
     88{{{#!bash
     89sudo ./ftx_prog --cbus 0 Drive_1 # configure CBUS0 as always output high
     90}}}
     91
     92You will need to either power-cycle your board or reload the ftdi_sio kernel module to make this take effect:
     93{{{#!bash
     94rmmod ftdi_sio
     95modprobe ftdi_sio
     96}}}
     97
     98If CBUS0 is configured as GPIO you can use the following commands (on a 4.20 or newer kernel) to configure GPIO & enable the modem:
     99{{{#!bash
    74100base=$(for i in $(ls -1d /sys/class/gpio/gpiochip*); do [ "ftdi-cbus" = "$(cat $i/label)" ] && cat $i/base; done)
    75101[ "$base" ] || { echo "Error: could not find ftdi-cbus device"; }
     
    83109}}}
    84110
    85 Note that exporting the gpio's above will fail if you have used something like {{{ftx_prog}}} (below) to re-configure the CBUS pins to a mode other than IOMODE/GPIO.
     111Note that exporting the GPIO will fail if it was configured for 'Drive_1'.
    86112
    87 === Procedure for kernels prior to Linux 4.20
    88 Because support for controlling the FTDI GPIOs was introduced in Kernel 4.20, a program (ftx_prog) can be used to configure the FTDI io-pins in the EEPROM on the FTDI chip on earlier kernels. Configuring CBUS0 as 'drive-1' makes it always output a logic high enabling the modem and removes the need (and ability) to manipulate the gpio to turn the modem on/off.
    89 
    90 This is an open source program located here: https://github.com/richardeoin/ftx-prog
    91 
    92 Building:
    93 {{{#!bash
    94 sudo apt-get install git build-essential gcc make libftdi-dev
    95 git clone https://github.com/richardeoin/ftx-prog.git
    96 cd ftx-prog
    97 make
    98 }}}
    99 
    100 The following commands are used to re-configure the CBUS0 pin to keep the modem always enabled:
    101 {{{#!bash
    102 sudo ./ftx_prog --cbus 0 Drive_1 # configure CBUS0 as always output high
    103 }}}
    104 
    105 And if you want to re-configure it to change it back to a GPIO (in which case you will need a Linux 4.20 kernel or newer or a userspace application to configure the ftdi-cbus gpio):
    106 {{{#!bash
    107 sudo ./ftx_prog --cbus 0 GPIO # configure CBUS0 as GPIO
    108 }}}
    109 
    110 Note: Power cycle board after running commands.
    111113
    112114== Modem AT Commands