FreeRTOS Net NT-Shell

Overview

This is embARC Example for NT-Shell on LwIP and FreeRTOS

Detailed Description

  • Extra Required Tools

    NO

  • Extra Required Peripherals

    Digilent PMOD WIFI (MRF24WG0MA)

  • Design Concept

    The Pmod modules should be connected to your embARC board. This example is designed to show how to use NT-Shell over network in FreeRTOS.

  • Usage Manual
    This is an example running NT-Shell command interface over network, and use telnet to connect to it:
    • First setup your WiFi AP which your board would connect to. The default SSID is embARC, default password is qazwsxedc.

    • Run the example program on your board, wait until it is connected to the wifi. When you see the message showing below, type main to console to run the main program which is a Telnet server running at port 23 on board’s IP address.

      Please run NT-Shell command(main) to start your application.
      main command may required some arguments, please refer to example's document.
      
    • Make sure your PC is in the same IP section of your board. For example, you can connect your laptop to the same wifi which your board is connected to.

    • Open another cmd console / terminal, use telnet command to connect to the ip address of your board. If there are outputs, then you can run and try out ntshell commands. An telnet example is given below, in this example the IP address of the board is 192.168.137.108.

      $ telnet 192.168.137.108
      
    • Some commands require extra peripheral modules, for example command temp require Digilent PMOD TMP2 module in order to measure temperature

  • Extra Comments

    NO

Buidling and Running

This example outputs to the console. It is supported by all platform. The commands to run this example are as follows:

$ cd <embarc_root>/example/freertos/net/ntshell
$ make BOARD=emsk BD_VER=22 CUR_CORE=arcem7d TOOLCHAIN=gnu run

Sample Output

Here is sample output from ntshell example, highlight lines are user input.

-----------------------------------------------------------
 ____                                _ ____
|  _ \ _____      _____ _ __ ___  __| | __ ) _   _
| |_) / _ \ \ /\ / / _ \ '__/ _ \/ _` |  _ \| | | |
|  __/ (_) \ V  V /  __/ | |  __/ (_| | |_) | |_| |
|_|   \___/ \_/\_/ \___|_|  \___|\__,_|____/ \__, |
                                             |___/
                     _       _    ____   ____
       ___ _ __ ___ | |__   / \  |  _ \ / ___|
      / _ \ '_ ` _ \| '_ \ / _ \ | |_) | |
     |  __/ | | | | | |_) / ___ \|  _ <| |___
      \___|_| |_| |_|_.__/_/   \_\_| \_\\____|
------------------------------------------------------------

embARC Build Time: Apr 12 2018, 17:35:28
Compiler Version: Metaware, 4.2.1 Compatible Clang 4.0.1 (branches/release_40)
FatFS initialized successfully!
Start Init LWIP
ntshell command info(Information) was registered!
ntshell command main(Call main function) was registered!
ntshell command swape(Swap endianness of input variable) was registered!
ntshell command map(Show the memory map of bootloader) was registered!
ntshell command bcr(Dump processor build configuration) was registered!
ntshell command lr(Read auxiliary register) was registered!
ntshell command sr(Write auxiliary register) was registered!
ntshell command mem(Operate the memory) was registered!
ntshell command ledflash(Run led flash example) was registered!
ntshell command led(Write LED) was registered!
ntshell command btn(Read button value) was registered!
ntshell command swt(Read DIP switch value) was registered!
ntshell command ledswbtn(Operate the LED through button and switch) was registered!
ntshell command adc(PMOD ADC sensor demo command) was registered!
ntshell command temp(Show current temperature) was registered!
ntshell command wifi(wifi operations) was registered!
ntshell command ls(List information about files) was registered!
ntshell command cd(Change the working directory) was registered!
ntshell command rm(Remove the file or the folder) was registered!
ntshell command mkdir(Create the directory) was registered!
ntshell command cat(Output file contents) was registered!
ntshell command cp(Copy source to destination) was registered!
ntshell command mv(Rename file or move file) was registered!
ntshell command pwd(Print the current working directory) was registered!
ntshell command touch(Create a file) was registered!
ntshell command ymodem(Ymodem file transfer protocol) was registered!
ntshell command disk(Operate the storge device) was registered!
ntshell command load(Load .bin file from SD card to ram at specified address) was registered!
ntshell command boot(Load application specified in a boot.cfg file from sdcard and run) was registered!
ntshell command go(Run the program at the specified address) was registered!
ntshell command spirw(Read/Write the image in spi flash for updating bootloader/application image) was registered!
ntshell command mload(Update firmware, read or write MCS file in the SPI flash) was registered!
NTShell Task StartUp
COM1>
Now trying to connect to WIFI hotspot, please wait about 30s!
MRF24G Device Information As Follows:
Device Type:2, ROM Ver:31, Patch Ver:7
Connection Profile ID:1
WF INIT SUCCESSFULL!
MRF24G MAC ADDRESS:00-1e-c0-0e-6e-0a
WF_EVENT_CONNECTION_SUCCESSFUL
Link is UP!

Now start get ip address using DHCP, Please wait about 30s!

-----PMOD WIFI IP ADDRESS INFO-----
 ipaddr 192.168.137.108 netmask 255.255.255.0 gw 192.168.137.1
 dns server 0 :192.168.137.1
 dns server 1 :0.0.0.0
-----------------------------------
WiFi connected
Please run NT-Shell command(main) to start your application.

main command may required some arguments, please refer to example's document.
main
NT-Shell for FreeRTOS + LwIP + FatFs
Now please telnet to the IPAddr @ Port 23, to run ntshell ver telnet
Command line like this: telnet ipaddr port
COM1>