All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Debug and command shell

A command shell can (optionally) be used on the host serial port, this is the same port used to download the firmware so they can not be used simulateously. Open the serial port on the PC or OSX at a baud rate of 115200, for example, on OSX the screen command can be used in the terminal.

screen /dev/tty.usbserial 115200

Your serial port may be different to the one shown.

The shell is usually created in the "main" function and is enabled for all the demo programs. Typing "help" at the command prompt will list all commands available.

ch> 
ch> help 
Commands: help exit info systime mem threads reboot adc spi motor lcd enc son ime test sm apollo 
ch> 

some commands are always available, some configured by the user code. Here is the output from the "info" command. See the demo code for examples of how to add more shell commands.

ch> info
Kernel:       2.6.0
Compiler:     GCC 4.7.2
Architecture: ARMv7-M
Core Variant: Cortex-M3
Port Info:    Advanced kernel mode
Platform:     STM32F10x Performance Line High Density
Board:        VEX CORTEX
Build time:   Aug 19 2013 - 18:30:40
ch> 

Try the others to see their output.

Apollo

Apollo is an optionally linked file that allows a real time text based display of most cortex sensor and motor data. Type "apollo" at the prompt to start the display, hit any key to stop it.

+------------------------------------------------------------------------------+
| MTR EID  CMD ENCODER  RPM  AMPS  TEMP |  DIGITAL          |  ANALOG          |
|  1  -- R   0       0    0  0.00  22.2 |  1 SonarCm     -1 |  1         251   |
|  2   0   -26       0    0  0.75  32.5 |  2                |  2         253   |
|  3   0   -26       0    0  0.75  32.2 |  3 Input        1 |  3         253   |
|  4  -- R   0       0    0  0.00  22.2 |  4 Input        1 |  4         251   |
|  5      ----  ------  ---  ----  ---- |  5 Encoder      0 |  5         254   |
|  6      ----  ------  ---  ----  ---- |  6                |  6         251   |
|  7   4     0       0    0  0.00  22.2 |  7 Input        1 |  7         253   |
|  8   0 R -26       0    0  0.75  32.3 |  8 Input        1 |  8         254   |
|  9   0 R -26       0    0  0.75  32.9 |  9 Input        1 |                  |
| 10   0     0       0    0  0.00  22.2 | 10 Output       1 |                  |
| C 1-5                      1.49  35.4 | 11 Output       0 |                  |
| C 6-10                     1.49  36.0 | 12 Output       0 |                  |
+------------------------------------------------------------------------------|
|        U  D  L  R           H     V            U  D  L  R           H     V  |
| BTN5   0  0        JS_1     0  -101     BTN5   0  0        JS_1     0     0  |
| BTN6   0  0        JS_2     0    14     BTN6   0  0        JS_2     0     0  |
| BTN7   0  0  0  0           X     Y     BTN7   0  0  0  0           X     Y  |
| BTN8   0  0  0  0  ACCL    10     0     BTN8   0  0  0  0  ACCL     0     0  |
|                                                                              |
|                                                                              |
| 00:00:30  Main 7.02V  Backup 0.00V                                           |
+------------------------------------------------------------------------------+