Kauai Labs navX-MXP User Manual

Robotics navigation sensor

Advertisement

navX-MXP Robotics Navigation Sensor User Guide
Kauai Labs
Copyright — 2019

Advertisement

Table of Contents
loading

Summary of Contents for Kauai Labs navX-MXP

  • Page 1 Robotics Navigation Sensor User Guide Kauai Labs Copyright — 2019...
  • Page 2: Table Of Contents

    Table of Contents Overview navX-MXP Features Technical Specifications "Behind the Design" Frequently-asked Questions Installation Installation RoboRIO Installation FTC Installation Orientation OmniMount I/O Expansion Alternative Installation Options Creating an Enclosure Software Software RoboRIO Libraries Android Library (FTC) Linux Library Arduino Library...
  • Page 3 Serial Protocol Register Protocol Open-source Hardware/Software Firmware Customization navXUI Customization Technical References...
  • Page 4: Overview

    9-axis inertial/magnetic sensor and motion processor. Designed for plug-n- play installation onto a National Instruments RoboRIO™, navX-MXP also provides RoboRIO I/O Expansion. navX-MXP is a must-have add on to any RoboRIO-based control system, and includes free software libraries, example code and many more features.
  • Page 5: Features

    The Eclipse IDE and a free version of an ARM compiler can be downloaded for those wishing to customize the firmware. Firmware updates can be easily downloaded to the navX-MXP circuit board via the USB port.
  • Page 6: Technical Specifications

    Overview Technical Specifications Technical Specifications The navX-MXP circuit board and official firmware provide inertial and magnetic measurements, with a range, accuracy and update rate as described on this page. Note that certain performance specifications are only valid after a start-up...
  • Page 7 Overview "Behind the Design" navX-MXP on Team 624’s 2015 Robot Team 2062’s 2015 Robot...
  • Page 8: Frequently-Asked Questions

    FIRST and its impact. Frequently-asked Questions Will navX-MXP work with the National Instruments RoboRIO™? Yes, the navX-MXP is designed specifically to work with the RoboRIO. Please see the instructions for installing navX-MXP onto a FIRST FRC robot for more details, as there are several installation options.
  • Page 9 . You will need a USB-to-RS232 serial converter in order to connect navX-MXP to the CRIO’s RS-232 port, and you will also need a 12VDC-to-5VDConverter to provid power/ground to the power pins on the navX-MXP’s MXP Connector.
  • Page 10 To track a FRC or FTC robot’s position during autonomous requires an accuracy of about 1 cm of error per 15 seconds. While the accuracy of the navX-MXP displacement estimates might be good enough to track the position of an automobile on a road, it is too low for use in tracking a FRC or FTC robot’s position during the 15 second...
  • Page 11 Processor) and interface specs, or are you using what other people reverse engineered a while ago? The navX-MXP firmware uses the officially released Invensense MotionDriver version 6.1. Kauai Labs has ported this driver to work correctly on the navX-MXP’s STM32F411 micro-controller. What’s the difference between navX-MXP and the navX-MXP Aero? navX-MXP and the navX-MXP Aero share a single design.
  • Page 12: Installation

    National Instruments RoboRIO™. This installation takes about only a minute. To install, simply place the 34-pin “MXP” Connector on the bottom of the navX-MXP circuit board into the corresponding MXP slot on the top of the RoboRIO, as shown below.
  • Page 13 Installation RoboRIO Installation...
  • Page 14: Ftc Installation

    Securing navX-MXP to the RoboRIO Next, secure navX-MXP to the RoboRIO using two #4-40 screws, each with a length of 3/16th inch. You can also use a 1/4 inch-long screw if you place a small washer between it and the top of the navX-MXP circuit board.
  • Page 15 0, starting at the bottom-most port on the left-hand side of the DIM. Connect the +5V, Data (SDA), Clock (SCL) and GND pins on the selected DIM I2C port to the corresponding pins on the navX-MXP External I2C Port Connector.
  • Page 16 “Voltage Select” jumper is set to 5V. Electrical Wiring Verification If properly wired, when power is applied to the DIM, the Red 3.3V LED on the navX-MXP should light up. Double-check that the SDA and the SCL wires on the DIM match the corresponding pins on the navX-MXP circuit board.
  • Page 17 Orientation Orientation navX-MXP measures a total of 9 sensor axes (3 gyroscope axes, 3 accelerometer axes and 3 magnetometer axes) and fuses them into a 3-D coordinate system. In order to effectively use the values reported by navX-MXP, a few key concepts must be understood in order to correctly install navX-MXP on a robot.
  • Page 18 Board Orientation (Board Frame) Aligning Board Frame and Body Frame In order for the navX-MXP sensor readings to be easily usable by a robot control application, the navX-MXP Coordinate System (Board Frame) must be aligned with the Robot Coordinate system (Body Frame).
  • Page 19 Since Body Frame and Board Frame coordinates should be aligned, and because the Yaw axis must be aligned with gravity, by default you must orient the navX-MXP with the top of the board facing up, and with the Y axis (on the circuit board) pointing to the front of the robot.
  • Page 20 Installation Orientation...
  • Page 21: Omnimount

    In certain cases, the navX-MXP axes (Board Frame) may not be oriented exactly as that of the Robot (Body Frame). For instance, if the navX-MXP circuit board is plugged directly into the RoboRIO-MXP connector, and the top of the RoboRIO (the edge on which the USB connectors are mounted) is pointing up with the top side of the RoboRio pointing towards the front of the robot, the navX-MXP axes will not be oriented identically to the Robot.
  • Page 22 Transforming navX-MXP Board Frame to Body Frame with OmniMount The navX-MXP’s “OmniMount” feature can transform the navX-MXP X, Y and Z axis sensor data (Board Frame) into Robot Orientation (Body Frame) by detecting which of its three axes is perpendicular to the earth’s surface. [NOTE: this requires navX-MXP firmware revision 1.1.37 or later].
  • Page 23: I/O Expansion

    OmniMount To configure OmniMount, follow these simple steps: Install the navX-MXP onto your robot. ENSURE that one of the navX-MXP axes (as shown on the navX-MXP circuit board) is perpendicular to the earth’s surface. This axis will become the yaw (Z) axis. Note that this axis can either be pointing away from the earth’s surface, or towards the earth’s surface.
  • Page 24 Installation I/O Expansion...
  • Page 25 Each of the 10 Digital I/O pins may be configured for use as either DigitalInputs or DigitalOutputs, PWM (Outputs) or Counters (Inputs). Additionally, multiple (either 2 or 3) DigitalInputs may be used to form an QuadratureEncoder input. DigitalInput/DigitalOutput Addressing navX-MXP Port MXP Pin Number RoboRIO Channel Address DIO0 DIO1...
  • Page 26 Installation I/O Expansion DIO12 DIO13 PWM Output Addressing navX-MXP Port MXP Pin Number RoboRIO Channel Address PWM0 PWM1 PWM2 PWM3 PWM4 PWM5 PWM6 PWM7 PWM8 PWM9 For further documentation, please see the on this topic. NOTE: The MXP connector has 2 Digital I/O pins which are dedicated to the I2C interface. MXP Digital I/O Pin DIO14 is used for I2C SCL and DIO15 is used for I2C SDA.
  • Page 27: Alternative Installation Options

    SPI connector. TTL UART The navX-MXP TTL UART connector can be used to connect the RoboRIO to an external TTL- level UART device. NOTE: The TTL UART connector cannot be used to connect to an external RS-232 signal, since RS-232 voltages are much higher than TTL-level UART voltages.
  • Page 28 Image not found One-wire Connect via USB cable By using a USB Mini-B type (Male) to USB A type (Male) connector, navX-MXP can receive both power and also communicate with the RoboRIO. This installation method allows the navX-MXP circuit board to be placed longer distances away from the RoboRIO than via the “Floppy-disk”...
  • Page 29 Power, Ground and I2C/SPI/TTL UART signals on the MXP Connector. To use the I2C interface without directly plugging the navX-MXP circuit board into the RoboRIO MXP connector, first ensure that the navX-MXP circuit board has power (either via the USB connector, or via the +5VDC pin on the MXP connector).
  • Page 30: Creating An Enclosure

    Finally, connect the CS, CLK, MISO and MOSI pins on the host computer (e.g., the RoboRIO) to the corresponding CS, CLK, MISO and MOSI pins on the navX-MXP circuit board. The SPI pins are 5V tolerant, so the host computer can use either 5V or 3.3V DC levels on these pins.
  • Page 31 Installation Creating an Enclosure navX-MXP circuit board. Note that the design file scale is 1000X actual size, so will need to be scaled down by a factor of 1000 before printing. navx-mxp-roborio-lid_v4_scaleddown.stl: STL Format File for 3d printing the lid-style enclosure for the navX-MXP circuit board.
  • Page 32: Software

    Java LabVIEW navX-AE These libraries provide access to navX-MXP via SPI, I2C and USB and UART – as well as USB and I2C interfaces to navX-Micro, and USB Interfaces to VMX-pi. [Update: 2/2/2019 – Version 3.1.366 is now available – which is compatible with the 2019 FRC Release (2019.1.1).
  • Page 33: Android Library (Ftc)

    Software RoboRIO Libraries Android Library (FTC) NOTE: The 2016 Version of the navX-Micro Android Library for FTC is tested with the current 2017 version of the “ftc_app” library for use with the Modern Robotics Core Device Interface Module. The navx_ftc Android software library supports access to navX-Model devices via the I2C communication interface.
  • Page 34: Linux Library

    – by adding this line near the bottom of the gradle build file, in the dependencies section: dependencies { compile (name:'navx_ftc-release', ext:'aar') Linux Library A library for accessing navX-MXP (and navX-Micro) from Linux is available. This library was developed by Alexander Allen of FRC Team 900 (Zebracorns) and...
  • Page 35: Arduino Library

    Linux Library supports the USB interface. The navX-MXP Linux Library is useful for integrating with video processors such as the Raspberry-PI and the Jetson TK1 and TX1. To use the library, you can the source code with Git. Online help is also available.
  • Page 36: Navxui

    Gyro Calibration in Progress Indicator The Gyro Calibration in Progress Indicator is displayed during initial gyroscope calibration, which occurs immediately after power is applied to the navX-MXP. If the gyroscope calibration does not complete, the navX-MXP yaw accuracy will be adversely impacted. For more...
  • Page 37 “Motion Threshold”. The Rotating indicator is present whenever the change in yaw value within the last second exceeds the “Rotating Threshold”. Note that the navX-MXP Gyroscope Calibration only occurs when the navX-MXP is not Rotating for a few seconds.
  • Page 38: Tools

    Aero. Valid altitude readings are displayed in white text. Installing/Running the navXUI To run the navXUI, the navX-MXP must be connected to a PC running Windows via USB. Make sure Java 7 (version 1.7) or Java 8 (version 1.8) is installed on your computer.
  • Page 39 These tools run on a Windows PC and communicate via USB to navX-MXP. NOTE: These tools are provided for use by advanced users; please carefully read the tool descriptions before using them.
  • Page 40: Examples

    Examples Examples Examples Examples Example source code for various navX-MXP (and navX-Micro) capabilities are available for both for FRC and FTC Robotics Control Systems. FRC Examples This section provides example code for several common navX-MXP (and navX-Micro) applications used by FIRST FRC teams on their robots to add sophisticated navigation capabilities.
  • Page 41 Examples Field-Oriented Drive (FRC) An easy-to-use, highly-maneuverable drive system is at the heart of a successful robot. Omnidirectional drive systems provide motion in the Y axis (forward- backward), X-axis (strafe), and Z axis (rotating about it’s center axis). Each “degree of freedom”...
  • Page 42 FRC Java Example Full Java Source code on GitHub FRC LabView Example The navX-MXP FieldCentric-Drive LabView example shows how to make small modifications to the LabView “FRC RoboRIO Robot Project” using the “Mecanum Robot” configuration to implement high-accuracy Field-Centric drive.
  • Page 43 Drive VI, which rotates the joystick X/Y coordinates by the gyro angle (and thus implements FieldCentric drive control). Additionally, if a driver joystick button is pressed, the navX-MXP “Yaw” angle is reset to zero. The navX-MXP Device TypeDef is passed to the Teleop.vi via a VI input terminal.
  • Page 44: Rotate To Angle (Frc)

    Full LabVIEW Source code on Github Rotate to Angle (FRC) Automatically rotating a robot to an angle using navX-MXP can be used to rotate a robot quickly and accurately to a known angle, as long as the robot drive system provides independent Z-axis rotation (the capability to “spin on a dime”).
  • Page 45 Full Java Source code on GitHub FRC LabView Example The navX-MXP Rotate to Angle LabView example shows how to make small modifications to the LabView “FRC RoboRIO Robot Project” using the “Mecanum Robot” configuration to rotate the robot to a given angle.
  • Page 46 Rotate to Angle (FRC) Teleop.vi The Teleop.vi is modified to feed the current navX-MXP “Yaw” angle reading to the Holonomic Drive VI, which rotates the joystick X/Y coordinates by the gyro angle (and thus implements FieldCentric drive control). Additionally, if a driver joystick button is pressed, the navX-MXP “Yaw”...
  • Page 47: Automatic Balancing (Frc)

    263 demonstrated the auto-balance feature effectively during the 2018 FRC Championships. The basic principle used in the example is based upon measurement of the navX-MXP Pitch (rotation about the X axis) and Roll (rotation about the Y axis) angles. When these angles exceed the “off balance”...
  • Page 48 FRC Java Example Full Java Source code on GitHub FRC LabView Example The navX-MXP AutoBalance LabView example shows how to make small modifications to the LabView “FRC RoboRIO Robot Project” using the “Mecanum Robot” configuration to implement high-accuracy Automatic Balancing.
  • Page 49 Automatic Balancing (FRC) Teleop.vi The Teleop.vi is modified to feed the current navX-MXP “Yaw” angle reading to the Holonomic Drive VI, which rotates the joystick X/Y coordinates by the gyro angle (and thus implements FieldCentric drive control). Additionally, if a driver joystick button is pressed, the navX-MXP “Yaw”...
  • Page 50: Collision Detection (Frc)

    Jerk (which is defined as the change in acceleration). As shown in the graph below (taken from navX-MXP data recorded in LabVIEW of a small collision), whenever the jerk (in units of G) exceeds a threshold, a collision has occurred.
  • Page 51 Full C++ Source Code FRC Java Example Full Java Source Code FRC LabView Example The navX-MXP AutoBalance LabView example shows how to make small modifications to the LabView “FRC RoboRIO Robot Project” using the “Mecanum Robot” configuration to implement collision detection. RobotMain.vi...
  • Page 52 Examples Collision Detection (FRC) rate is 50Hz. You may need to process faster for your situation. For the SPI, I2C and USB connections the max sample rate is 200Hz. Teleop.vi The Teleop.vi is modified to feed the Linear Acceleration to a threshold detector to determine if a collision has occured.
  • Page 53: Motion Detection (Frc)

    Examples Collision Detection (FRC) Full LabVIEW Source code on Github Motion Detection (FRC) Detecting motion/no-motion can be simply detected by determining if a body’s linear acceleration exceeds a small threshold. Using the data directly from accelerometers, this is not as easy as it seems, since raw accelerometer readings contain both acceleration due to gravity as well as acceleration due to a body’s motion.
  • Page 54 FRC Java Example Full Java Source Code FRC LabView Example The navX-MXP AutoBalance LabView example shows how to make small modifications to the LabView “FRC RoboRIO Robot Project” using the “Mecanum Robot” configuration to detect when your robot is moving.
  • Page 55: Data Monitor (Frc)

    Full LabVIEW Source code on Github Data Monitor (FRC) The Data Monitor example code demonstrates how to perform navX-MXP initialization and display all sensor values on a FIRST FRC robotics dashboard. The output data values include: Yaw, Pitch and Roll angles...
  • Page 56 FRC Java Example Full Java Source code on GitHub FRC LabVIEW Example The navX-MXP Test_Window.vi example shows all of the outputs from the navX through “FRC RoboRIO Robot Project”. RobotMain.vi Place the NavX main vi on the block diagram and set it up to your needs. The default sample rate is 50Hz.
  • Page 57 Examples Data Monitor (FRC) Test Window.vi Place the Test Window.vi inside of a loop in any VI (for instance in your Teleop.vi loop) and the values will automatically update. Test Window.vi is in the navX-AE “Get” folder.
  • Page 58: Mxp I/O Expansion (Frc)

    Analog Inputs (e.g., Ultrasonic Sensor) Analog Input Trigger (e.g., Proximity Sensor trigger) Analog Trigger Counter Analog Output (e.g., Constant-current LED, Sound) This example also demonstrates a simple method for calculating the ‘RoboRIO Channel Number’ which corresponds to a given navX-MXP IO Pin number.
  • Page 59 FRC Java Example Full Java Source code on GitHub FRC LabView Example The navX-MXP FieldCentric-Drive LabView example shows how to make small modifications to the LabView “FRC RoboRIO Robot Project” using the “Mecanum Robot” configuration to implement high-accuracy Field-Centric drive.
  • Page 60 Examples MXP I/O Expansion (FRC) The InitExpansionIO.vi instantiates the various objects which map onto the navX-MXP Expansion IO Pins. GetChannelFromNavX-MXPPin.vi The GetChannelFromNavX-MXPPin.vi performs the translation from the navX-MXP Digital or Analog Pin number to the corresponding RoboRIO Channel Number, which is provided to the...
  • Page 61 Examples MXP I/O Expansion (FRC) Teleop.vi The Teleop.vi reads the Joystick inputs and programs the output pins accordingly (PWM to motor controllers, Digital Outputs and Analog Outputs). As well, values from the input pins (Digital Inputs, Encoders and Analog Inputs) is retrieved and displayed on the Smart Dashboard.
  • Page 62: Guidance

    Avoiding navX-MXP restarts is very important if your robot software uses the “yaw” angle. To avoid a navX-MXP restart when stage 2 brownouts occur, a secondary power supply for the navX-MXP circuit board should be provided. Fortunately, the RoboRIO provides just such a power supply, since its onboard USB interface is powered by a boost regulator which will provide 5V of power even when the RoboRIO input voltage (VIN) drops as low as 4.4 volts...
  • Page 63 Guidance Best Practices Using the navX-MXP yaw angle before calibration completes may result in errors in robot control. To avoid this situation, your robot software should verify that calibration has completed (e.g., by calling the isCalibrating() function) before using navX-MXP data.
  • Page 64: Terminology

    For optimal results, the navX-MXP circuit board should be mounted at the robot’s center of rotation. If the navX-MXP circuit board cannot be mounted near the robot’s center of rotation, the offset from the center of rotation can be used to correct the yaw angle.
  • Page 65 Pitch and Roll angles should be 0. The Yaw angle is different – Yaw is not referenced to anything external. When navX-MXP startup calibration completes, the Yaw angle is automatically set to 0 – thus at this point, 0 degrees represents where the “head”...
  • Page 66 Up/Down + Up / – Down Because the gyroscope and accelerometer axes are aligned, navX-MXP measures linear acceleration in the same set of 3 axes used to measure Pitch, Roll and Yaw. However unlike Pitch, Roll and Yaw, acceleration measures linear motion rather than rotation, and is measured in units of G, with a range of +/- 2.0.
  • Page 67 Guidance Terminology Altitude is a measure of distance in the “up” direction from a reference; navX-MXP (Aero Edition) calculates altitude above sea-level using a pressure sensor. navX-MXP (Aero Edition) altitude has a range of 0 to 25,000 meters. Important Note: Altitude is calculated based upon barometric pressure. In order to accurately estimate altitude above the earth, navX-MXP should be configured with the sea-level barometric pressure in the surrounding area.
  • Page 68 != 0), navX-MXP performs “tilt correction” fusing the reading from the magnetometers with the pitch and roll angles from the accelerometers. Once corrected, the compass heading is aligned with the navX-MXP Z axis, which ensures that the Yaw angle and the Compass Heading measure rotation similarly.
  • Page 69 “Body Reference Frame”. This works well as long as the navX-MXP circuit board is in it’s original orientation. However as the navX-MXP circuit board rotates, the X and Y accelerometer axes no longer point “forward/back” and “left/right”...
  • Page 70: Selecting An Interface

    The navX-MXP interfaces fall into two types: Streaming and Register-based. Streaming: data is sent at regular intervals by the navX-MXP, and the host is notified when new data arrives. To support the low bitrate of the TTL UART interface, the streaming data is sent in...
  • Page 71: Gyro/Accelerometer Calibration

    Based upon the above, the following recommendations are provided for selecting the best navX- MXP communications interface: – If mounting the navX-MXP directly on the RoboRIO, the SPI interface is preferred for it’s high speed and low latency. – If mounting the navX-MXP separately from the RoboRIO using an extension cable and if MXP IO support is desired, run SPI at a lower speed.
  • Page 72 Guidance Gyro/Accelerometer Calibration navX-MXP onboard sensors require calibration in order to yield optimal results. We highly recommend taking the time to understand this calibration process – successful calibration is vital to ensure optimal performance. Accurate Gyroscope Calibration is crucial in order to yield valid yaw angles. Although this process occurs automatically, understanding how it works is required to obtain the best results.
  • Page 73 MXP. When navX-MXP is re-started, it will perform the Initial Gyro Calibration – the same process that occurs at our factory. NOTE: It is very important to hold navX-MXP still, and parallel to the earth’s surface, during this Initial Gyro Calibration period. You might consider...
  • Page 74 MXP protocol and libraries provide a way to determine the yaw offset value it is currently using. NOTE: If navX-MXP is moving during startup, this Yaw Offset Calibration may take much longer than 2 seconds, and may not be calculated at all if the sensor continues moving long enough.
  • Page 75: Magnetometer Calibration Tool

    The importance of stillness This is the most important takeaway from this discussion: It is very important that navX-MXP be held still during the above Initial Gyro and Initial Yaw Offset calibration periods. In support of this, navX-MXP indicates when it is calibrating; we recommend you incorporate this information into your software.
  • Page 76 8 seconds, which helps manages temperature instability. Errors in the navX-MXP Pitch and Roll values to be extremely accurate over time since gyroscope values in the pitch/roll axes can be compared to the corresponding values from the accelerometer.
  • Page 77 EKF (it exhibits similar accuracy to documented EKF implementations on MEMS acceleromter/gyroscope sensors). With this processing, navX-MXP exhibits yaw drift on the order of ~1 degree per minute; yaw drift is typically much lower when navX-MXP is still.
  • Page 78: Support

    The navX-MXP Software Archive includes past navX-MXP software releases. NOTE: Kauai Labs strongly recommends using the latest software versions. To download an archived navX-MXP software version, right-click on the version number and download the file to your computer, and run the setup.exe file. 2018 FRC Season Release...
  • Page 79 Support Software Archive Version Number: 3.0.348 The cross-platform build is also available for non-Windows platforms. 2017 FRC Season Release Version Number: 3.0.329 The cross-platform build is also available for non-Windows platforms. 2016 FRC Season Release Version Number: 3.0.263 Change Summary Added new “Omnimount”...
  • Page 80: Advanced

    Advanced Serial Protocol In order to communicate sensor data to a client (e.g., a RoboRio robot controller) the navX-MXP software uses a custom protocol. This protocol defines messages sent between the navX-MXP and the client over a serial interface, and includes an error detection capability to ensure corrupted data is not used by the client.
  • Page 81 Advanced Serial Protocol 16-bit Integer (HighByte,HighNibble)(HighByt ‘1A0F’ e,LowNibble)(LowByte,HighNib ble)(LowByte,LowNibble) Data Type Encoding (Binary) Binary encoding is used for all Binary message elements. All Binary-formatted data types that are signed are encoded as 2’s complement. All multi-byte data types are in little-endian format.
  • Page 82 Message Body Definitions Yaw/Pitch/Roll/Compass Heading Update Message The Yaw/Pitch/Roll/Compass Heading Update message indicates the navX-MXP current orientation and heading, in units of degrees, as follows: Byte Offset Element...
  • Page 83 Note that the accelerometer and gyroscope data has already had bias calibration applied. Additionally, raw magnetometer data is provided. Note that the raw magnetometer data may have already had soft/hard iron calibration applied, if the navX-MXP magnetometer calibration procedure has already been completed. Byte Offset...
  • Page 84 Uint8 NAVX_SELFTEST_STATUS Stream Configuration Command By default, navX-MXP begins transmitting YPR Updates upon power up. The Stream Configuration Command is sent in order to change the type of navX-MXP Streaming Update transmitted to the client. Byte Offset Element Data Type...
  • Page 85: Register Protocol

    Byte Offset Element Data Type Action Uint8 (NAVX_INTEGRATION_CTL) Parameter Uint32 Register Protocol In addition to the streaming Serial protocol, navX-MXP may be accessed over the I2C and SPI buses, using a register-based protocol. This page documents the register-based protocol used...
  • Page 86 “polled” interface, in that the consumer of the navX-MXP data (in this case referred to as a “bus master”) can request data from the navX- MXP at any time. At the same time, when using the register-based protocol the bus master does not know when new data is available.
  • Page 87 Register Protocol When accessing the navX-MXP via the SPI bus, this following pattern is used: – When the SPI bus master is not communicating with the navX-MXP, the SPI bus master must hold the chip select (CS) line high. – The SPI bus master lowers the CS line.
  • Page 88 Advanced Register Protocol – The SPI bus master delays for 200 microseconds, giving the navX-MXP sufficient time to prepare for the upcoming SPI bus transaction. – The SPI bus master lowers the CS line. – The SPI bus master initiates a series of SPI bus transactions, where the number of individual 8-bit transfers is equal to the count previously specified, plus one additional transfer for a CRC value transmitted by the nav-MXP.
  • Page 89: Open-Source Hardware/Software

    0x0C Capability Flags (high) Read-only “” 0x0D-0x0F Read-only Open-source Hardware/Software The navX-MXP project is completely open source, including schematics, firmware and design files for an enclosure. These sources are available online at the navX-MXP Github Repository. Firmware Customization The navX-MXP was developed/debugging using the following software tools, which (with the exception of the Debugging hardware) are open-source or freely-available.
  • Page 90 Advanced Firmware Customization https://sourcery.mentor.com/sgpp/lite/arm/portal/subscription?@template=lite After installing, the compiler is installed into folder (32-bit Windows) C:\Program Files\CodeSourcery\Sourcery G++ Lite For 64-bit Windows, it is installed into: C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite Add the path to the “bin” director underneath the Code Sourcery G++ Lite installation directory, so that the compiler is on the path.
  • Page 91 Zylin Plugin Update URL: http://opensource.zylin.com/embeddedcdt.html Import the project into Eclipse Open up eclipse, and import the project which is contained in the navX-MXP stm32 directory in the Github repository. Building In Eclipse, select Project->Build. You might find it necessary to Project->Clean first to remove old build output files.
  • Page 92 Additional utilities for the ST-LINK/V2 (for windows) are available on the STM website. Connecting the ST-LINK/V2 to the navX-MXP Circuit Board You will need to solder a 4-pin header to the navX-MXP board in order to connect debug on the navX-MXP’s STM32F411 microcontroller. Then, you will need to connect 4 wires from the connector to the corresponding location on the ST-LINK/V2 connector.
  • Page 93 MPORTANT NOTE: THe 0.9.0 release of OpenOCD contains a bugfix; earlier releases of OpenOCD from cannot communicate correctly with the STM32F411 microcontroller used in the navX-MXP. If you are not able to acquire this release of OpenOCD, please contact support@kauailabs.com for information on how to proceed.
  • Page 94: Navxui Customization

    6b) To start a debug session, first create a debug configuration: Select Run->Debug Configurations… Select “Zylin Embedded Debug (Cygwin)” Then, add a new configuration (e.g., (navX-MXP OpenOCD Debug Session”); the new configuration will be a child node of Zylin Embedded Debug (Cygwin) On the Debugger Tab: Set GDB Debugger to arm-none-eabi-gdb Set GDB Command File to <navx-mxp-distribution_directory\stm32\gdb\nav10.script...
  • Page 95: Technical References

    If your computer has more than one serial port, you will need to select the appropriate serial port (corresponding to the USB serial port navX-MXP is connected to) from the COM port selection drop-down list in the top-right of the navXUI display.

Table of Contents