OpenEmbedded: -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- OpenEmbedded is a cross compiler which we use to build the tamuclient code for the Gumstix. To start a build all you need to do is type, in a terminal window, bitbake –c rebuild [file_name]. All information about bitbake and the .bb files needed to build the package can be found at http://www.gumstix.com/support.html.
A few tips about bitbake:
IMU 605 Thread: ------------------------------------------------------------------------------------------------------------------------------ This thread has two versions. The version that is working on the TamuBot as of now (July 28, 2008) is a polling style thread. This is due to the SPI thread which is also a polling style thread. Once the SPI thread is converted to an event-driven thread the IMU 605 thread can then be event-driven as well. This event-driven design has already been implemented but not tested. This code has a signal handler which listens for the SIGIO signal. When the event handler receives the SIGIO signal it will read the byte from the FIFO buffer. If this byte is the proper header byte the thread will resume, if not the thread will remain in a state of waiting. Serial port settings for IMU 605: open ([port], O_RDWR | O_EXCL | O_NONBLOCK) c_iflag = 0 c_oflag = 0 c_cflag = CLOCAL | CREAD | CS8 c_lflag = 0 c_cc[ VTIME ] = 0 c_cc[ VMIN ] = 1 BAUD: 115200 ================================================================================ 3DM-GX1 Thread: ------------------------------------------------------------------------------------------------------------------------------ With this current design the IMU 605 must be running or the 3DM-GX1 will be forever waiting. If the user wants to only use the 3DM-GX1 during their experiments, the user will only have to remove the wait on IMU 605 thread command. Serial port settings for 3DM-GX1: open([port], O_RDWR | O_NOCTTY | O_NDELAY) c_iflag = IGNPAR c_oflag = 0 c_cflag = B38400 | CS8 | 0 | 0 | 0 | CLOCAL | CREAD c_lflag = 0 BAUD: 38400 ================================================================================ Packages: ------------------------------------------------------------------------------------------------------------------------------
List of Packages: (highlighted packages will not be covered below) helloworld IMU_test Overlapped Overlapped_linux Rover rover_alone RoverOld sertest test
IMU_test bitbake –c rebuild imu
files: Errors.h, imu.cpp, IMUDataParser.cpp/h, Makefile, mpDataSource.cpp/h, Serial.cpp/h This package is nothing but a test package for the two IMU. It is currently set up to run the IMU 605. With this package you can send the IMU commands and check the sensors response. In the current version imu.cpp only uses basic serial port commands; none of the other files are actually used. They are only there for testing purposes. Overlapped bitbake –c rebuild overlapped
files: Errors.h, Overlapped.cpp, IMUDataParser.cpp/h, Makefile, mpDataSource.cpp/h, Serial.cpp/h This version is OUT-DATED. This code is what was used to read sensor data from the IMU 605. The current way of getting the data and parsing the data is different from this package. This package is just used as a reference when creating the current design. Overlapped_linux NOT FOR GUMSTIX
files: Errors.h, Overlapped.cpp, IMUDataParser.cpp/h, Makefile, mpDataSource.cpp/h, Serial.cpp/h This version is OUT-DATED. This code is used to test the IMU 605 on the Linux desktop. The only difference in this code is one line in the .bb file. Again this package is not current because it is a test package. rover_alone bitbake –c rebuild tamualone
files: Errors.h, tamuclient.cpp, IMUDataParser.cpp/h, Makefile, mpDataSource.cpp/h, Serial.cpp/h, Crc8.c/h, dcb.h, DumpMem.c/h, fill_txQ.cpp, GetTime.cpp/h, gpio.c/h, i2c.c/h, i2c-api.c/h, i2c-common.h, i2c-dev.h, i2c-io.h, i2c-io-api.c/h, init_sock.cpp/h, Log.h, m3dmgAdapter.c/h, m3dmgErrors.h, m3dmgSerial.h, m3dmgSerialLinux.c, m3dmgUtils.c/h, protocol.c/h, Queue.h, thr_encoder.cpp, thr_imu.cpp, thr_microstrain.cpp This package does everything the full version does minus the communication to the socket. This allows you to test your code with out the Windows interface. Note: The IMU 605 thread is in a polling style. Here is what the event driven code should look like: #include <sys/signal> void signal_handler_imu605(int status); IMU_thread() { struct sigaction saio; //open port
saio.sa_handler = signal_handler_imu605; sigemptyset(&saio.sa_mask); saio.sa_flags = 0; saio.restorer = NULL; sigaction(SIGIO, &saio, NULL); fcntl(portNum, F_SETOWN, getpid()); fcntl(portNum, F_SETFL, FASYNC); //loop //p_thread wait //read and parse data } void signal_handler_imu605(int status) { read(portNum, &readChar, 1); if (readChar == 0x0BD) { //signal the thread } } This event driven code has not been tested due to the encoder thread. However, the SIGIO signal works when the encoder thread is disabled. The above code is not in any packages at this time. sertest bitbake –c rebuild sertest
files: sertest.cpp, Makefile This code is another serial communications test package. The original version of this code can be found on Gumstix’s buildroot website. test bitbake –c rebuild test
files: Errors.h, microstrain.cpp, m3dmgAdapter.c/h, m3dmgErrors.h, m3dmgSerial.h, m3dmgSerialLinux.c, m3dmgUtils.c/h This package is a test package for the 3DM-GX1IMU. ================================================================================ |
The packages.tar.gz file contains all of the packages needed to test the two IMU, IMU 605 and 3DM-GX1.