Sunday, September 16, 2012

Objective 2: Establish Serial Port Communication

You most definitely will want to load a custom Linux distribution onto a microSD card, and when booting from said card, you may encounter bugs especially if you will be modifying and boot arguments.  A good way to view the boot log is to set up a serial communication between your computer and the Beagleboard-xM.
  1. Power down your Beagleboard-xM and connect a serial cable (If your computer has a serial port) or a USB to Serial adapter  between your computer and the Beagleboard-xM.
  2. Open up a terminal and execute the command:
  3.   sudo minicom -s

    This will bring up the minicom program which will look something like:
      +-----[configuration]------+ 
      | Filenames and paths      | 
      | File transfer protocols  | 
      | Serial port setup        | 
      | Modem and dialing        | 
      | Screen and keyboard      | 
      | Save setup as dfl        | 
      | Save setup as..          | 
      | Exit                     | 
      | Exit from Minicom        | 
      +--------------------------+  

  4. Select “Serial port setup” and a sub menu will come up with will look something like:
  5.   +-----------------------------------------------------------------------+
      | A -    Serial Device      : /dev/tty8                                 |
      | B - Lockfile Location     : /var/lock                                 |
      | C -   Callin Program      :                                           |
      | D -  Callout Program      :                                           |
      | E -    Bps/Par/Bits       : 115200 8N1                                |
      | F - Hardware Flow Control : Yes                                       |
      | G - Software Flow Control : No                                        |
      |                                                                       |
      |    Change which setting?                                              |
      +-----------------------------------------------------------------------+
              | Screen and keyboard      |
              | Save setup as dfl        |
              | Save setup as..          |
              | Exit                     |
              | Exit from Minicom        |
              +--------------------------+
    

  6. If you are using a serial port change the Serial Device to /dev/ttyS0.  If you are using a USB to Serial Adapter  change the Serial Device to /dev/ttyUSB0.  Ensure selection E is set to 115200 8N1 and change Hardware Flow Control to “No”.  After updating it will look something like:
  7.   +-----------------------------------------------------------------------+ 
      | A -    Serial Device      : /dev/ttyUSB0                              |
      | B - Lockfile Location     : /var/lock                                 |
      | C -   Callin Program      :                                           | 
      | D -  Callout Program      :                                           |
      | E -    Bps/Par/Bits       : 115200 8N1                                | 
      | F - Hardware Flow Control : No                                        |
      | G - Software Flow Control : No                                        |
      |                                                                       | 
      |    Change which setting?                                              |
      +-----------------------------------------------------------------------+ 
              | Screen and keyboard      |
              | Save setup as dfl        |
              | Save setup as..          |
              | Exit                     |
              | Exit from Minicom        |
              +--------------------------+

  8. Select “Save setup as dfl” to save these settings as the default and then select “Exit”.  The communication port will now open and the terminal will look something like:
  9.   Welcome to minicom 2.5
    
      OPTIONS: I18n                                                               
      Compiled on May  2 2011, 00:39:27.                                          
      Port /dev/ttyUSB0                                                           
                                                                                
      Press CTRL-A Z for help on special keys 

  10. Power on the Beagleboard-xM and the boot log will display on your computer's terminal.  It will look something like:
  11.   Texas Instruments X-Loader 1.5.0 (Mar 27 2011 - 17:37:56)
      Beagle xM
      Reading boot sector
      Loading u-boot.bin from mmc
    
    
      U-Boot 2011.03-rc1-00000-g9a3cc57-dirty (Apr 01 2011 - 17:41:42)
    
      OMAP36XX/37XX-GP ES2.1, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz
      OMAP3 Beagle board + LPDDR/NAND
      I2C:   ready
      DRAM:  512 MiB
      NAND:  0 MiB                                                                   
      MMC:   OMAP SD/MMC: 0                                                          
      *** Warning - readenv() failed, using default environment                      
                                                                                  
      In:    serial                                                                  
      Out:   serial                                                                  
      Err:   serial                                                                   
      Beagle xM Rev C                                                                
      No EEPROM on expansion board                                                   
      Die ID #765000229ff80000016849a90100f016                                       
      Hit any key to stop autoboot:  0

  12. At this point you can hit any key on your computer's keyboard to stop the boot sequence if you want to add any on-the-fly modifications.
  13. While using minicom, you can press Crtl+A to enter minicom commands.  To exit minicom press Ctrl+A followed by X.  Since we set the necessary minicom parameters as default, the next time you want to start minicom just use the command:
  14.   sudo minicom
    
    The configuration menu will not execute and it will start communication. 

How I learned this:

No comments:

Post a Comment