Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

What can I do with IGEPv2

9,648 bytes removed, 12:36, 11 May 2016
no edit summary
{{Table/IGEP Technology Devices| cellspacingTech_Family="0" cellpadding="5" border="1" align="center" width="100%" style="text-align{{#lst:Template: left;"Links|-IGEPv2_Tech_Family}}| bgcolorTech_ID="#cccccc" |'''IGEPv2 - Part 2/3'''|-| It is recommended that you '''follow the [[{{#lst:Template:Links|IGEPv2_Community_Guides_1IGEPv2_Tech_ID}}|previous chapters]]''' of this guide before continuing with this tutorial.|}  {{Navigation/IGEP Technology Guides
|Name={{#lst:Template:Links|IGEPv2_Name}}
|Image={{#lst:Template:Links|IGEPv2_Image}}
|ISEE_MainPage={{#lst:Template:Links|IGEPv2_ISEE_MainPage}}
|ISEE_Hardware={{#lst:Template:Links|IGEPv2_ISEE_Hardware}}
|Community_MainPage={{#lst:Template:Links|IGEPv2_Community_MainPage}}
|Community_Guides_1={{#lst:Template:Links|IGEPv2_Community_Guides_1}}
|Community_Guides_2={{#lst:Template:Links|IGEPv2_Community_Guides_2}}
}}
{| cellspacing="0" cellpadding="5" border="1" align="center" style="text-align: left;"|-| bgcolor="#cccccc" colspan="3" | '''IGEP Technology Devices Guides - Part 2/3 - Summary'''|-| [[Image:{{#lst:Template:Links|IGEPv2_Image}}|250px|center|link={{#lst:Template:Links|IGEPv2_Community_MainPage}}]] |-|'''1) [[#Booting and setting up|Booting up IGEPv2]]'''|-|'''2) [[#Updating the pre-installed software|Updating the pre-installed software]]'''|-|'''3) [[#Flashing the software image|Flashing the latest firmware to the IGEPv2 flash memory]]'''|-|'''4) [[#Connect to IGEPv2 via network interfaces|Connect to IGEPv2 via network interfaces]]'''|-|'''5) [[#Basic instructions|Basic instructions]]'''|-|'''6) [[#Send a file between a PC and IGEPv2|Send a file between a PC and IGEPv2]]'''|-|'''7) [[#How to handle the gpio-LED's|Handle IGEPv2's leds]]'''|-|'''8) [[#Mount a MicroSD card|Mount a MicroSD card]]'''|-|} __NOTOC__ === Booting and setting up ===---- {| cellspacing="0" cellpadding="5" border="1" align="center" widthOverview ="100%" style="text-align: left;"|-| bgcolor="#cccccc" |'''Pre-installed software'''|-|By default, '''all brand new IGEP Processor Boards have a firmware installed''' on its flash memory. That means that if you power up your board it will run a Linux distribution provided and installed by ISEE.|}  All IGEP Processor Boards have a pre-installed software which consists of a '''minimal Linux-based distribution''' with a lite X Window System and GNOME Mobile based applications created with '''Poky Platform Builder'''. In the previous chapter of this tutorial, we have booted IGEPv2 with its pre-installed software. Once the board has booted up, it asks for a login in the serial debug port. You can log in into IGEPv2 via the serial interface.   *The default login user is: '''root''' *There is '''no password''' for this user.   '''Boot priority''' In fact, IGEPv2 can boot from many other devices (listed by priority):  # from USB# from UART3# from a MMC/MicroSD card # from OneNAND memory  As we haven't set any other boot device rather than the oneNAND (the IGEPv2 flash memory) the system boots from it.  But, as '''the MicroSD card has an upper priority than the flash''', if you plug a MicroSD card (with the right configuration on it) to the MicroSD card reader, IGEPv2 will boot from it and won't boot from the flash memory.  Now, We are going to use this functionality to update your pre-installed software. === Updating the pre-installed software ===---- {| cellspacing="0" cellpadding="5" border="1" align="center" width="100%" style="text-align: left;"|-| bgcolor="#cccccc" |'''Requirements - Overview'''|-| For this purpose, you will need: * a '''microSD card'''* a '''computer''' with microSD card reader (or with adapter)* a '''GNU/Linux distribution installed''' on the computer (a Linux partition or a virtual machine on Windows)** the main reason is that Windows does not detect multiple partitions on a microSD card|-|1) '''Download the latest firmware''' into an external computer.
This is the 2) '''Uncompress /3 chapter of the downloaded file'''Getting Started with IGEPv2 Tutorial Guide.
In this second chapter, we will learn some basics tasks. Upon completion, you will be ready to continue with chapter 3) '''Create a MicroSD card''' in your external computer/3 that explains more advanced tasks.
4) '''Plug the MicroSD card''' to IGEPv2 and boot from it.
|}
__TOC__
We are now going to update the pre-installed software to the latest version.
{{#lst:How to create a SD-card with the latest software image|IGEPv2}}= What can I do =
4) '''Plug You must logged in the MicroSD card'''board.
Therefore, you are ready == How to try the MicroSD Card. '''Plug the MicroSD card into IGEPv2''' and '''power up your board'''.use serial console ==
=== Flashing Connect a serial (COM port) cable (known as the software image ===-AT/Everex Cable) to the 10-pin header J960 on the board. Now you need a Null-Modem DB9 male-make serial cable. Connect the cable between the board and your PC. Open the serial on your PC using your preferred serial communications program (minicom) and configure the port as follows:
{| cellspacing="0" cellpadding="5" border="1" align="center" width="100%" style="text-align: left;"* 115200|-* 8N1| bgcolor="#cccccc" |'''Overview'''|-| 1* no flow control (either software or hardware) '''Log into IGEPv2'''
2) '''Run /opt/firmware/flasherOpen the serial port and the debug shell prompt should appear.sh script'''|}
A detailed guide on how to connect via serial debug port can be found by following this link: [[Using serial debug port to communicate]]
Now your IGEPv2 has == Handle the latest firmware '''running from MicroSD card'''.GPIO-LEDS ==
But you might want to write the firmware to the flash memoryThe board has two user bicolor (green/red) leds available that can be controlled. In its simplest form, so '''you won't need the MicroSD card when booting''' the board. So let's do itcan control of LEDs fromuserspace.LEDs appear in /sys/class/leds/ and you can turn on and off with following commands:
$ echo 0 > /sys/class/leds/d240\:green/brightness
''Note $ echo 1 > /sys/class/leds/d240\: The following process is assuming that your host PC is connected to IGEPv2 via the Serial Debug port. If not, read the Serial Port instructions in the [[Getting Started with IGEPv2|previous chapter of this tutorial]].''red/brightness $ echo 0 > /sys/class/leds/d240\:red/brightness
$ echo 1 > /sys/class/leds/d440\:green/brightness
$ echo 1 > /sys/class/leds/d440\:red/brightness
Enter A detailed guide on how use GPIO-LEDS can be found by following this link: [[How to IGEPv2 using:handle the gpio-LED]]
* root as login name == Handle generic GPIO == * an empty passwordSee [[How_to_use_GPIOs|GPIOs HOWTO]] to know details about that.Quick example could be:<pre>echo 156 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio156/directionecho 0 > /sys/class/gpio/gpio156/value</pre>
The software provided by ISEE has a script that flashes the content of your MicroSD Card to the flash memory <pre>echo 157 > /sys/class/gpio/export echo in your IGEPv2.> /sys/class/gpio/gpio157/directioncat /sys/class/gpio/gpio157/value</pre>
You have == How to run this script, that is located at /opt/firmware directory. Open a Terminal and run:use UART1 (RS232) ==
cd /opt/firmware The board has another UART available on J960 connector (UART1)./flashThis UART is shared with RS485 so it's incompatible use both interfaces at the same time.shFor that reason to use UART1 for RS232 comunications you should disable RS485 interface. You can do this [[How_do_I_edit_my_kernel_command_line | adding following kernel cmdline parameter]]
This will last a few minutes board. When it is ready, unplug the SD card from IGEPv2 and reboot the board:ei485=no
rebootNow, you can connect the serial AT/Everex Cable to the 10-pin header J960 on the board. In that case the first pin of the AT/Everex Cable (red) should be connected to the pin number 10 of the header J960. You also need a Null-Modem DB9 male-make serial cable. Connect the cable between the target board and your PC.
Enjoy Open the new firmware running from flash memory.serial port on your PC using your preferred serial communications program (minicom) and configure the port as follows:
'''Other references''': [[Update_the_PRE-INSTALLED_software_image_to_a_current_release|'''update your pre-installed * 115200* 8N1* no flow control (either software image''']]or hardware)
=== Connect to IGEPv2 via network interfaces ===----On the target board open a serial port as follows:
{| cellspacing="0" cellpadding="5" border="1" align="center" width="100%" style="text $ microcom -align: left;"|-| bgcolor="#cccccc" |'''Overview'''|-| 1) '''Plug an ethernet cable to IGEPv2s 115200 /dev/ttyS0
2) '''Connect via ethernet network'''Now when you write a character in you PC serial port, SSH: root@192the character should appear in the target board.168.x.x
3) '''Connect via wireless network''', SSHA detailed guide on how use UARTS can be found by following this link: IGEP_WLAN at root@192.168.x.x|}[[How to use UARTs]]
You can log into IGEPv2 via many '''interfaces with network connectivity''', such ethernet, wifi, usb== How to use RS-ethernet gadget, etc.485 ==
In {{#lst:How to use RS485|overview}}A detailed guide on how use UARTS can be found by following this tutorial we are going to connect via an ethernet cable. To to that, you need link: [[How to set an IP in IGEPv2 (host) and start a SSH session in your PC (client). Let's do it.use RS485]]
First of all, you will need:== Get sound in (audio in) ==
* an '''Ethernet cable'''* External Audio input devices, such as a '''Linux powered microphone or the audio output of a Windows host PC'''or MP3 player, can be connected to the via a 3.5mm jack (Audio IN).
Note that the board has been designed to use Line In for the audio input which means users need to add some type of pre-amp for a microphone to work or use a powered microphone. For a pre-amp for a microphone you can use MAX9812.
Log into IGEPv2 via the '''serial cable to the serial debug port in IGEPv2''', as you have done in the previous chapter of this tutorial guide.Enable capture:
Once you are logged in, run the following command:<pre>amixer -c 0 sset 'Analog Right AUXR' capamixer -c 0 sset 'Analog Left AUXL' cap </pre>
ifconfigYou can record audio in with the application arecord, for example:
This will '''list all the enabled network interfaces''' in your IGEPv2. We are going to '''focus on 'eth0''''. This is the ethernet interface in your IGEPv2, which is the interface we will '''connect to from our host PC'''. Connect the ethernet cable between your host PC and IGEPv2 (or through any wired network such switch). Now, let's '''set an static IP''' to this interface in IGEPv2, so we will be able to reach the target from the PC. Type the following command in your serial console:  ifconfig eth0 192.168.6.2  Next, set an '''IP within the subnet''' in your host PC, for example: 192.168.6.3 Then, run a '''SSH client''' such '''Putty''' and start a SSH session to the target from your host PC. You can download it from its official page at: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Install and run Putty. It will look like this: [[Image:Putty ssh.png|center]] # Select the '''SSH''' at connection type.# Next insert the '''IP address of the target'''. In this case, the IGEPv2 IP you have already set (192.168.6.3).# Ensure that the port is set to '''22''', the default for SSH communications.# Finally, push the '''Open button''' to start the SSH session.  If everything goes right, you will be able to access to an IGEPv2 console from your PC via ethernet. === Basic instructions ===---- {| cellspacing="0" cellpadding="5" border="1" align="center" width="100%" style="text-align: left;"|-| bgcolor="#cccccc" |'''Overview'''|-| Learn some Bash basic instructions in Linux (for newbies). 1) Create, edit, move and delete files 2) Run a simple script|} IGEPv2 is '''compatible with many Linux distributions'''. In this tutorial we are using Poky Linux, which is the pre-installed software from ISEE. In case you are not familiar with Bash instructions, here comes some basic instructions to help you startup with the board. First of all, '''log in to IGEPv2''' with a console from your host PC (via serial port or via SSH), as shown previous sections in this article. Remember the default settings:  login: root password: (none: press return) Once you are logged in IGEPv2, run the following commands:  cd / ls You have moved to the root directory, that is "/".The instruction "ls" lists all the existing files and directories in the current "path". Now let's go to the directory /home/root/ with:  cd /home/root/ You can always check at which directory you are with the instruction:  pwd Most instructions include a 'help' option that can be accessed by inserting the parameter --help. Check out the help page of 'echo' instruction, for example:  echo --help You can try the instruction by yourself and type:  echo Hello You have sent the text "Hello" to the standard output, that is the console you are interacting with. But you can change and 'redirect' the output by using the character '>' :  echo Hello world! > /home/root/name.file Now notice you have redirected the output to a file called name.file :  ls You can append any file using '>>' instead of '>'.You can print the content of the file to the standard output:  cat /home/root/name.file '''Building a basic script''' You can create a script that can run any instruction you want to use in Bash. The main advantage is that you do not have to compile the code, as is auto-interpereted by the system. We are going to create a basic 'Hello World' script that is going to run the same command you have actually used before:  echo "echo Hello world!" > /home/root/example.sh cat example.sh Now you have created a file called example.sh, but by default it has no execute permissions (x):  ls -la We are going to add permission to the file by:  chmod a+x example.sh ls -la Now you can run the script:  ./example.sh You can edit this file (example.sh) with 'vi', the pre-installed text editor in IGEPv2.  vi example.sh Press ESC and: * :q! , to exit without saving* :w , to save* :wq , to quit and save* i , to insert text '''Other simple & useful instructions''' * mkdir* rmdir* find* grep You can stop any instruction by pressing CTRL+C  === Send a file between a PC and IGEPv2 ===---- {| cellspacing="0" cellpadding="5" border="1" align="center" width="100%" style="text-align: left;"|-| bgcolor="#cccccc" |'''Overview'''|-| Transfer a file from IGEPv2 to your PC via SCP|} In a Linux host PC, you can use SCP (secure copy) via SSH to transfer files between IGEPv2 and your host PC. First of all, set an static IP to your Linux Host (for example, 192.168.6.3) and another IP within the subnet for IGEPv2 (for example, 192.168.6.2). First of all, you check the connectivity (From IGEPv2 console):  ping 192.168.6.3 Press CTRL-C to stop the command. Now let's transfer a file called original.file in your host PC to IGEPv2 in /home/root/ In your Host PC open Terminal and type:  scp -r original.file root@192.168.6.2:/home/root/destination.file You can repeat the process from the IGEPv2 console, and transfer a file from IGEPv2 to your Host PC. === How to handle the gpio-LED's ===---- {| cellspacing="0" cellpadding="5" border="1" align="center" width="100%" style="text-align: left;"|-| bgcolor="#cccccc" |'''Overview'''|-| Using IGEPv2 LED's with the associated platform device at /sys/devices/platform/leds-gpio/leds/|} IGEPv2 has many devices that can be controlled using '''simple instructions'''. In this tutorial, we are going to use the '''4 LED's available in the board''', which probably is the most simple feature in the board, but sometimes you may want LED's to be a way of checking the status of some of your applications.  You can easily '''turn LED's on and off''' using the 'echo' instruction. Log into IGEPv2 (via serial port or via SSH, as shown before), and run the following commands to turn LED's on: <pre>echo 1 &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/brightnessecho 1 &gt; /sys/devices/platform/leds-gpio/leds/d240\:red/brightnessecho 1 &gt; /sys/devices/platform/leds-gpio/leds/d440\:green/brightnessecho 1 &gt; /sys/devices/platform/leds-gpio/leds/d440\:red/brightness</pre>  You can turn them down using the same command and write '0' instead of '1'.  '''Other functionalities''' If you want to trigger the leds you can enable this mode and select the trigger source (none by default) to: mmc0, mmc1, timer, heartbeat and default-on.<br>  To enable any of this modes you just have to change a parameter in the directory of the led you want to control. You can see all the possibilities using the instruction 'cat':<br>  <pre>$ cat /sys/devices/platform/leds-gpio/leds/d240\:green/trigger [none] mmc0 mmc1 timer heartbeat default-on</pre>  In the example above, we have checked the status of the trigger in led D240:green. Mode 'none' is selected.  To change it, for example, to the timer mode you can use 'echo': <pre>echo timer &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/trigger</pre>  In this case, we have set the trigger to the 'timer' mode. Now you can set the time for what the led is ON and the time it is OFF using: <pre>echo 250 &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/delay_onecho 750 &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/delay_off</pre>  Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF.  === Mount a MicroSD card ==={| cellspacing="0" cellpadding="5" border="1" align="center" width="100%" style="text-align: left;"|-| bgcolor="#cccccc" |'''Overview'''|-| Mount the MicroSD card partitions into IGEPv2|}  (Work in progress section!) ==== Access to Generic FAT32 microSD ====  mount -t vfat /dev/mmcblk0 /mnt/tmp/ ==== Access to Generic USB Flash disk ====  mount -t vfat /dev/sda1 /mnt/tmp/ ==== Safety Remove microSD ====  umount /mnt/tmp ==== Access to IGEP demo microSD ====  mount -t jffs2 /dev/mmcblk0 /mnt/tmp/ === How to use RS-485 ===---- {| cellspacing="0" cellpadding="5" border="1" align="center" width="100%" style="text-align: left;"|-| bgcolor="#cccccc" |'''Overview'''|-| Follow the link to the extensive article: [[How_to_use_RS485_on_IGEP0020_board|How to use RS-485 on IGEPv2 board]]|}  === How to get sound out (audio out) ===---- {| cellspacing="0" cellpadding="5" border="1" align="center" width="100%" style="text-align: left;"|-| bgcolor="#cccccc" |'''Overview'''|-| Use: aplay |} The amplifiers for the headset output are disabled by default, so the first thing you'll do is enable these amplifiers with:  amixer set -D hw:0 'Headset' 0dB amixer set -D hw:0 'HeadsetL Mixer AudioL2' on amixer set -D hw:0 'HeadsetR Mixer AudioR2' on Then you can easily play a *.wav sound with the application Aplay, for example:  aplay sample.wav === How to get sound in (audio in) === {| cellspacing="0" cellpadding="5" border="1" align="center" width="100%" style="text-align: left;"|-| bgcolor="#cccccc" |'''Overview'''|-| Use: arecord|} You can record audio in with the application Arecord, for example:  arecord -t wav -c 2 -r 44100 -f S16_LE -v audio-in.wav</pre>
Following output is expected on console:
boundary &nbsp;: 1073741824
When ever you think you want to stop recording just press CTRL+C  == Get sound out (audio out) == Connect an external output audio device to the 3.5mm jack Audio Out connector in the board, such as external stereo powered speakers.
{{Navigation/The amplifiers for the headset output are disabled by default, so the first thing you'll do is enable these amplifiers with:  $ amixer set -D hw:0 'Headset' 0dB $ amixer set -D hw:0 'HeadsetL Mixer AudioL2' on $ amixer set -D hw:0 'HeadsetR Mixer AudioR2' on Then you can easily play a *.wav sound with the application Aplay, for example:  $ aplay audio-in.wav == How to use wifi == If you have a wireless network adapter in your computer you can also connect to the board using the ad hoc network connection that the firmware configures byu default. Use your wireless manager to connect to the wireless network called in the form  IGEP_xx After connecting, a DHCP IP address should be adquired. Now you can access, for example with ssh, to the target board connecting to the 192.168.7.1 address.  $ ssh root@192.168.6.1 A detailed guide on how use wifi can be found by following this link: [[Using IGEP Technology Devices GuidesWLAN to communicate]] == How to use bluetooth == A detailed guide on how use bluetooth can be found by following this link: [[How to setup Marvell bluetooth]] == How to use the SD card == You can connect a micro SD card for storage. After plugin the SD card the kernel should detect the card and automount in /Next Stepmedia directory. |Name={{#lst= How to use the USB OTG == In order to act in host mode and add some peripherals like keyboard, mouse or pendrives you require a special cable that grounds the ID pin. Since the OTG port only provides 100mA of power a USB hub is recommended. Though a common USB Standard-A to Mini-B type cable the port acts as a device. In this mode you can connect to the board using the USB Ethernet Gadget. Use this cable between your computer and the target board and connect with:Template  $ ssh root@192.168.7.1 A detailed guide on how use wifi can be found by following this link:Links|IGEPv2_Name}}[[Using USB ethernet gadget to communicate]] |Community_MainPage={{#lst:Template:Links|IGEPv2_Community_MainPage}}|Next_Step=Start developing under Navigation/IGEP TechnologyGuides/What can I do/Ending}}
[[Category:IGEP Technology Devices Guides]]
[[Category:IGEP0020]]
[[Category:Work in progress]]
0
edits