Skip to content

Latest commit

 

History

History
122 lines (94 loc) · 6.22 KB

File metadata and controls

122 lines (94 loc) · 6.22 KB

UART CLI Example

The purpose of this application is to provide a UART Command Line Interface (CLI) to allow interaction with part of the Wi-Fi FMAC driver and the LwIP APIs.

Requirements

Hardware Prerequisites

The example requires the hardware components below:

Software Prerequisites

The required software includes:

  • The example projects available in this repository
  • A Serial terminal to communicate with the board. For example, Tera Term or Putty
  • The correct ST-link driver installed on your machine
  • Optionally, IAR Embedded Workbench IDE (version >= 7.80.2)

Set up your Kit

Follow the steps described below:

  1. Connect the Arduino/Nucleo interposer board to the NUCLEO-F429ZI board.
  2. Connect the WF(M)200 expansion kit to the Arduino/Nucleo interposer board.
  3. Make sure the "Power" switch on the WF200 expansion kit is in the [On Board LDO] position.
  4. Select [SPI] or [SDIO] on the bus switch depending on the bus you want to use.
  5. Connect the NUCLEO board to your PC using the USB cable. The board should appear as a mass storage device named "NODE_F429ZI".

Flash the STM32 MCU

Use the Binary Files

The first option to run the uart_cli is to use the precompiled binaries provided under wfx-fullMAC-tools/Examples/STM32/uart_cli/Binaries/. Depending on the bus selected on the switch, choose the corresponding binary file:

  • f429zi_uart_cli_spi.bin
  • f429zi_uart_cli_sdio.bin

To use this method, drag-and-drop or copy the f429zi_uart_cli_xxx.bin file to the "NODE_F429ZI" mass storage.

After the STM32 is successfully flashed, you can jump to the Start the Example section.

Compile the Project

Alternatively, use an IDE to compile and flash the project into the NUCLEO board.

  1. Open the project with the EWARM IDE.
  2. Select the bus configuration (SPI or SDIO). Make sure it matches the switch position on the WF(M)200 expansion board.
  3. Build the project.
  4. Flash the project to the NUCLEO-F429ZI board.

After the STM32 is successfully flashed, jump to the Start the Example section.

Start the Example

  1. If using Windows, open the Device Manager to see the COM Port Number assigned to the USB device [STMicroelectronics STLink Virtual COM Port].

  2. Open a Serial Terminal application, such as PuTTY, configure it to the COM Port Number you found in the previous step, and set the UART settings to 115200 bps, 8 data bits, 1 stop bit and no parity.

  3. Reset the NUCLEO board using the black button. You should see the following output.

     Type "help" to view a list of registered commands.
     @
    
  4. The uart_cli project is ready to receive commands. You can start by the 'help' command to list available commands. The 'help' list below is provided as an indication. To access an up-to-date list, use the 'help' command on the target.

     help                     : Lists all the registered commands
     cpu-reset                : Reset the host CPU
     cli-version              : Provide the version of the registered modules
     get                      : Get a parameter value
     						Usage: get <param_name>
     set                      : Set a parameter value
     						Usage: set <param_name> <param_value>
     wifi-reboot              : Reboot the Wi-Fi chip
     network-up               : Connect to the Wi-Fi access point with the information stored in wlan parameters
     nup                      : Alias of network-up
     network-down             : Disconnect from the Wi-Fi access point
     ndo                      : Alias of network-down
     scan                     : Perform a Wi-Fi scan
     wlan-pm                  : Enable/disable the Power Mode on the WLAN interface of the Wi-Fi chip
     						NOTE: WLAN must be up
     						Usage: wlan-pm <mode> [interval]
     							mode: 0(awake), 1(wake-up on beacons), 2(wake-up on DTIMs)
     							interval: number of beacons/DTIMs to skip while asleep
     wlan-ps                  : Enable/disable the Power Save on the WLAN interface of the Wi-Fi chip
     						Usage: wlan-ps <state>
     							state: 0(OFF), 1(ON)
     wlan-rssi                : Get the RSSI of the WLAN interface
     softap-up                : Start the SoftAP interface using the information stored in softap parameters
     sup                      : Alias of softap-up
     softap-down              : Stop the SoftAP interface
     sdo                      : Alias of softap-down
     softap-rssi              : Get the RSSI of a station connected to the SoftAP
     						Usage: softap-rssi <sta_mac>
     softap-client-list       : Get the list of clients connected to the SoftAP
     iperf                    : Start a TCP iPerf test as a client or a server
     						Usage: iperf <-c ip [-t dur] [-p port] [-k] | -s>
     							ip: iPerf server address to connect to (IPv4 format)
     							dur: test duration in client mode (default 10s)
     							port: server port to connect to (default 5001)
     							-k: execute the command in foreground
     iperf-server-stop        : Stop the running iPerf server
     iperf-client-stop        : Stop the running iPerf client
     ip-stats                 : Display the IP stack statistics
     ping                     : Send ICMP ECHO_REQUEST to network hosts
     						Usage: ping [-n nb] <ip>
     							ip: address to ping (IPv4 format)
     							nb: number of requests to send (default 3)
     wfx_test_agent           : Send a command to the RF Test Agent
     						Usage: wfx_test_agent <cmd> [cmd_args]
    

Additionally, you can display the specific command help by tipping:

@ [command] help