User Tools

Site Tools


Sidebar

Launch of Linino.org

wiki:115kdeafultconsole

Arduino YUN console speed

The Arduino YUN use a USB serial console. The default speed from the Arduino YUN Linino Kernel to the 32U4 is 250k baud. The user is able to connect using a standard serial speed over the micro USB connector because the sketch inside the 32U4 make the translation from 250k to USB serial console. ( You can select any serial baud speed on your terminal console program )

Linino ONE console speed

On the Linino ONE the default speed from the Linino Kernel to the 32U4 is 115.2k baud.

You can upload the default 115.2k baud speed 32U4 FW console using the following command

wget download.linino.org/pkg-bin/LininoOneSerialTerminal.hex
run-avrdude LininoOneSerialTerminal.hex

You can check the Linino Kernel console serial speed (console=ttyATH0,250000) typing the following command at the Linino prompt:

root@Arduino:~# cat /proc/cmdline
 board=Linino console=ttyATH0,250000 mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14656k(rootfs),1280k(kernel),64k(nvram),64k(art),15936k@0x50000(firmware) rootfstype=squashfs,jffs2 noinitrd
root@Arduino:~#

On your terminal emulator you can switch the baud speed from 32U4 to the Linino Kernel or the boot loader typing ~1 or ~2 ( ~1=115.2k, ~2=250k )

Please see the code bellow

/*
  Arduino Yun USB-to-Serial
 
 Allows you to use the Yun's 32U4 processor as a
 serial terminal for the linino processor.
 
 Upload this to an Arduino Yun via serial (not WiFi) 
 then open the serial monitor at 115200 to see the boot process
 of the linino processor. You can also use the serial monitor
 as a basic command line interface for the linino processor using 
 this sketch.
 
 From the serial monitor the following commands can be issued:
 
 '~' followed by '0' -> Set the UART speed to 57600 baud
 '~' followed by '1' -> Set the UART speed to 115200 baud
 '~' followed by '2' -> Set the UART speed to 250000 baud
 '~' followed by '3' -> Set the UART speed to 500000 baud
 '~' followeb by '~' -> Sends the bridge's shutdown command to
                        obtain the console.
                        
 The circuit:
 * Arduino Yun
 
 created March 2013
 by Massimo Banzi
 modified by Cristian Maglie
 
 This example code is in the public domain.
  
 http://arduino.cc/en/Tutorial/YunSerialTerminal
 
 */


long lininoBaud = 115200;

void setup() {
  Serial.begin(115200);      // open serial connection via USB-Serial
  Serial1.begin(lininoBaud); // open serial connection to Linino
}

boolean commandMode = false;

void loop() {
  // copy from virtual serial line to uart and vice versa
  if (Serial.available()) {           // got anything from USB-Serial?
    char c = (char)Serial.read();     // read from USB-serial
    if (commandMode == false) {       // if we aren't in command mode...
      if (c == '~') {                 //    Tilde '~' key pressed?
        commandMode = true;           //       enter in command mode
      } else {
        Serial1.write(c);             //    otherwise write char to Linino
      }
    } else {                          // if we are in command mode...
      if (c == '0') {                 //     '0' key pressed?
        Serial1.begin(57600);         //        set speed to 57600
        Serial.println("Speed set to 57600");
      } else if (c == '1') {          //     '1' key pressed?
        Serial1.begin(115200);        //        set speed to 115200
        Serial.println("Speed set to 115200");
      } else if (c == '2') {          //     '2' key pressed?
        Serial1.begin(250000);        //        set speed to 250000
        Serial.println("Speed set to 250000");
      } else if (c == '3') {          //     '3' key pressed?
        Serial1.begin(500000);        //        set speed to 500000
        Serial.println("Speed set to 500000");
      } else if (c == '~') {
        Serial1.write((uint8_t *)"\xff\0\0\x05XXXXX\x0d\xaf", 11);
        Serial.println("Sending bridge's shutdown command");
      } else {                        //     any other key pressed?
        Serial1.write('~');           //        write '~' to Linino
        Serial1.write(c);             //        write char to Linino
      }
      commandMode = false;            //     in all cases exit from command mode
    }
  }
  if (Serial1.available()) {          // got anything from Linino?         
    char c = (char)Serial1.read();    // read from Linino  
    Serial.write(c);                  // write to USB-serial
  }
}

Note:Please be sure to run the latest Linino update How to upgrade Linino image

/var/www/wiki.linino.org/data/pages/wiki/115kdeafultconsole.txt · Last modified: 2014/02/27 02:58 by administrator

2014 © dog hunter llc and the Linino Community. Linino.org is a dog hunter sponsored community project. Credits