How to compile your C file into an executable for TS-7260 embedded linux processor on KDE-Ubuntu:
- Copy any Makefile and change the name in all places to what your file is named. Typical convention is lower case is source file and all caps is the compiled executable file. The ***.c must have the same name as the ***.o file (ie superprogram.c and superprogram.o, but can use SUPERPROGRAM as the executable, or TREESARECOOL. Unless you're making multiple executables to compare, the convention we will follow is the executable file's name is the code file's name in caps)
- Open Konsole (type Konsole in search) and navigate to folder containing both source file and makefile. Type make. (Navigate using cd [foldername] tp change directory. Use ls to list folder contents to see what folders are available. Use cd .. to move up a folder). Hopefully there won't be any warnings, but there might be... read what is says and try to fix it. You can't go any farther until it compiles
- Once it compiles properly, plug in the serial cable to the computer and attach a null modem adapter at the free end. Plug this end into the microcontroller. Also plug in the power cable to the microcontroller. Lights will flash.
- Ensure file permissions are "read, write, execute" on the code file you're about to upload (can change this in Dolphin, or $ chmod og+rwx filename
- (Suggestion) open a new Konsole for new processes and keep this one for compiling.
- Type minicom . Make sure the baud rate is set to 115200. To change it press and hold control + a and tap p within minicom.
- Type root . Now you are connected to the microcontroller via minicom.
- Type lrz .This sets the microcontroller up to receive a file.
- Now comes some fancy keyboard skills: Press and hold control + a, then tap s.
- Choose zmodem
- Navigate to the folder containing your compiled file. Use the spacebar to select a folder or file (may not work all the time?). Use the arrow keys to select Okay at the bottom, then press Enter. If it says Transfer Incomplete, the file probably already exists on the microcontroller. To view the files on the microcontroller type ls. If it is there use rm [filename] to remove the file. Then try again (don't forget to type lrz again!).
- If you have problems, unplug and replug the power to the microcontroller and lots of words will appear like magic as the microcontroller boots! Then start again from step 6.
- To run the file, type ./[filename] If there is a permission denied error, type chmod og+rwx [filename] . This changes the file permissions to hopefully work. Google it if you're curious about details.
- Tadaaaah :) Good work. We wish you luck in the program actually working and not giving you segfaults...
Sidenote, the code from 2010 has Servo select: DIO1 to pin8, DIO2, pin2 to ground, pin to PWM. Most files are in ~/Documents, PWM control code is in ~/Documents/MAST_Software/XDIO/xdio
http://tldp.org/HOWTO/Serial-Programming-HOWTO/index.html is an excellent reference on Linux serial port programming
http://gpsd.berlios.de/ GPS NMEA serial service handler for linux