Skip to content

mRo X2.1

Jordi Munoz B edited this page Jul 24, 2018 · 2 revisions

Welcome to the mRo X2.1 Hardware wiki!

Availability

X2.1 can be purchased at our mRobotics Store

X2.1 Graphical Datasheet:

Graphical Datasheet

X2.1 UART to Serial port assignments

UART# is the actual hardware port. The Serial# is the label assigned to that particular UART hardware port. You normally will use the Serial# to properly configure it via qGroundControl or Mission Planner. For example, if you configure Serial1 (Telemetry1) on MissionPlanner you will actually "configure" UART2 (hardware):

 USART2= Serial1 - Telemetry1 HWFC
 USART3= Serial2 - Telemetry2 HWFC
 USART4= Serial3 - GPS
 USART8= Serial4 - OSD
 USART7= Serial5 - FTDI

1. FRONT HEADERS

a) ADDITIONAL CHANNELS:

CH1 to CH6 are additional FMU channels, you may need to add your own code to the firmware to enable functionality.

These additional channels can be used for PWM inputs, general purpose inputs or outputs, or analog inputs.

AIR, 5VP, and GND are the analog airspeed sensor pin set, where AIR is the analog input from the airspeed sensor, 5VP and GND are used for powering an analog airspeed sensor.

For more info please check our Graphical Datasheet here

b) CAN INTERFACE:

Those pins are used for interfacing with CAN bus devices.

c) USART7 (SERIAL5) (Console):

By default USART7 (SERIAL5) is used as the serial debug/console interface. For location info please check our Graphical Datasheet here

5VP
U7Tx 
U7Rx 
GND

d) USART3 (SERIAL2) (Telemetry 2):

e) USART4 (SERIAL3) (GPS+I2C):

f) ANALOG CHANNELS ADC1 & ADC2:

Pins used for interfacing with analog inputs. For location info please check our Graphical Datasheet here

NOTE! The full ADC voltage range is 0 < 3.3VDC. If you need to measure higher voltages, please calculate an R-R divider!

g) SBUS / PPM INTERFACE:

Those pins are used for SBUS or PPM interfaces. The SIPI input has protection in case of back EMF from the receiver. For location info please check our Graphical Datasheet here

GND 
VCC-R (VCC Receiver) 
SORI (SBUS OUT / RSSI IN)
SIPI (SBUS IN / PPM IN)

NOTE! If you need to connect additional servos/ESCs to the receiver and to avoid back EMF from it, you should use one of the following connection approaches:

Additional servos connected to the receiver:

a) Disconnect the 5VP power from X2.1 going to the receiver. Use only SIGNAL and GND;

b) Power the receiver from an alternate power source.

Additional ESCs connected to the receiver – you have 2 options:

a) Disconnect all ESC +5V RED cables from the receiver and power the receiver from the autopilot as by default. Use just SIGNAL and GND from ESCs;

b) Disconnect the 5VP from the autopilot, and power the receiver from JUST ONE of the ESCs. Disconnect all other ESC +5V RED cables from the receiver.

2. REAR HEADERS

a) SERVO HEADERS:

S1 to S8 are the signal pins, VS (+VSERVO) is the servo power supply rail, and GND is the GND rail. VS servo rail can NOT be used for powering the flight controller!

NOTE! Please use just one ESC/BEC for powering the servo rail with a voltage between 4.5VDC and 5.5VDC! Also, don’t forget that the servo bus operates at 50Hz for fixed wing and 400Hz in multirotors!

b) POWER BRICK:

BAT, CURR, VOLT, and GND are respectively Vcc BRICK, current sensing, voltage sensing and GND from Power supply module / Power Brick, etc.

NOTE! BAT (VCC BRICK) must be between 4.5VDC and 5.5VDC! Voltages from VOLTAGE and CURRENT sensing must be 3.3VDC max!

c) BUZZER CONNECTOR

5Vp and BUZZ pins are used for connecting the buzzer. For location info please check our Graphical Datasheet here

NOTE! Please connect the Buzzer Positive (+) terminal to "5Vp" and Buzzer Negative (-) terminal to "BUZZ"!

d) SPEKTRUM CONNECTOR:

Used to interface with Spektrum satellite receivers. Note that special cable is required which is usually included if you acquired the product from us. For location info please check our Graphical Datasheet here

U1Rx -> SIGNAL (Cable Color is YELLOW or GRAY)
GND -> Ground (Cable Color is BLACK)
Vspek -> Dedicated Power supply for SPEKTRUM receiver/satellite (Cable Color is RED).

e) SAFETY BUTTON CONNECTOR:

Pins used to connect the Safety Switch/Button with LED indicator. For location info please check our Graphical Datasheet here

SAFE -> Actual button contact
LED -> LED signal
IO 3V -> 3.3V power supply

NOTE! Please connect the supplied button with the connector Red wire on the IO 3V pin.

3. SIDE HEADERS

a) USART2 (SERIAL1) HEADER (Telemetry 1):

USART2 (SERIAL1) is a full set serial interface.

b) USART4 (SERIAL3) HEADER (GPS and I2C interfaces)

USART4 (SERIAL3) is a full set serial interface.

c) JTAGs Programming ports & USB:

There are two JTAG interfaces – FMU one over the FMU side and IO over the IO side.

For flashing the bootloaders, firmware and debugging, the cheap STM32 Nucleo Board can be used.

Also, the affordable ST-LINK V2 from eBay/Amazon/DigiKey is a good choice. The X2.1 boards are supplied with both FMU and IO bootloaders flashed, so you are not required to flash them again.

4. LEDS and SAFETY SWITCH

There are 4 LEDs on the X2.1 board and 1 more externally mounted on the Safety Button/Switch; FMU status LED (BLUE), IO status LED (RED), Power LED (GREEN), GPS/Position LED(Blue) and External Safety Button (RED).

POWER LED (GREEN/Internal)

SOLID ON = Device is powered (always ON)

STATUS LED (BLUE/Internal)

SOLID ON = Uploading new firmware (red LED should be solid or blink unevenly)
BLINKING (2Hz) = Heartbeat Loop running

FMU LED (RED/Internal)

SLOW BLINK = Ready to arm (System self-tests are OK)
FAST BLINK = Refusing to arm (System self-tests are NOT OK)
SOLID ON = Armed

IO LED (RED/Internal)

FAST BLINK = Bootloader active (the BLUE LED should be off in this state)
BLINKING (4Hz) = No FMU input
SOLID ON = Initialization error, check parameter "RC config" in your configuration. 
OFF = System is OK

SAFETY SWITCH STATUS (RED/External)

SOLID ON = FMU and IO are ARMED
SLOW BLINKING = Ready to arm
FAST BLINKING = Error / Refusing to arm
LONG OFF with FAST DOUBLE BLINK = IO armed, but FMU not
LONG OFF with FAST QUAD BLINK = FMU armed, but IO not

5. POWERING the X2.1

There are two power inputs – USB (only for programming and testing) and Power from the Power Brick. The servo Vdd bus is separated from the Brick Power and from the USB.

NOTE!

The Power Brick voltage and the Servo Bus voltage must be between 4.5VDC and 5.5VDC!
DO NOT cover any of the other heat dissipating components (LDO regulators and the STM32F4 processor)!

VERY IMPORTANT NOTE!

THE MAXIMUM ALLOWABLE TOTAL CURRENT CONSUMPTION FOR ALL PERIPHERALS IS 500 mA! ALWAYS ALLOW AIR CIRCULATION OVER BOTH X2.1 SURFACES!

6. UPLOADING THE FIRMWARE

You can use ArduPilot Mission Planner or PX4 QGroundControl to upload firmware.

Important Note: In order to boot successfully using Ardupilot you must insert an empty FAT16 or FAT32 formatted MicroSD card into the X2.1 MicroSD card socket. Otherwise, it won't work!

7. PX4 & ArduPilot BOOTLOADER "ISSUE"

IMPORTANT!

You are not required to follow this steps if you purchased your X2.1 after July 23, 2018. After this date all units come out with the latest Bootloader. Why? Because Mission Planner has been updated and now the original X2.1 bootloader works in Mission Planner like the rest of the Autopilots, so there is no need to change the bootloader to either match QGC or MP. =)

If you are not sure you have the correct bootloader on your board and you want verify it then please follow these simple steps:

  1. Download and install the latest version of QGroundControl, plug your X2.1 via USB to your computer and run QGC.

  2. Click the "Gear" icon and select the "Firmware" submenu. Follow the instructions. The system will require you to unplug and plug your X2.1, then you should see something like the following window:

Good to go!

If your QGC says "Found Device: AUAV X2.1 FMU V2" then you are good to go (please refer to the picture above), you don't need to update anything. Maybe you already did it when you wanted to load PX4 stack before. In case you have issues using Mission Planner please read below, you might require to remove and reinstall Mission Planner to fix the problem.

In case you get "Found Device: PX4 FMU V2" then you have the old/wrong bootloader, just must continue to step #3 (refer to the picture below).

Wrong BL

  1. You must update your bootloader so the system is recognized as "AUAV X2.1 FMU V2" and not as "PX4 FMU V2". The easiest way to do this is by adding a couple of files to your SD Card to update the bootloader, but first, you must make sure you have PX4 software installed, otherwise the little piece of software needed to update the BL will not work and, is not available on ArduPilot software stack.
    In the same window as step #2, you will see a dialog in right as the picture below. Select PX4 Flight Stack ... and click OK:

This will load PX4 stack and install the bootloader updater. After the installation is done, reboot and follow step #4.

  1. Now you will have to access the NuttX terminal and verify you have the bootloader updater installed. Follow the steps of the picture below:

  1. Then scroll up and make sure you have "bl_update" in the list:

If bl_update is there just to step #7. If you can't see the bl_update file, then you must be using this tutorial for another board that has the STMF4 V2 with limited memory or maybe has been removed in the latest versions. Because I know this might happen in the future, I decided to upload an old PX4 stack copy, to use it you must follow step #6.

  1. Download the PX4 Stack used for this tutorial from here: px4fmu-v3_default.px4

Now follow the normal QGC uploading process and choose "Custom firmware file" and select the file "px4fmu-v3_default.px4" you just downloaded (Refer to the picture below):

Go back to step #5 to verify "bl_update" is now there.

  1. Grab any SD card compatible with X2.1 (or use the one included). Insert the SD Card in your PC and delete all the files (Not needed but it simplifies the process":

  1. Download and unzip the file BL_Update_X21.zip and copy the files to the root of the SD Card as follows:

NOTE!

Make sure the file "auavx2v1_bl_fix.bin" and the folder "etc" are not inside any other folder, the files must be in the root of the SD Card.

  1. Unplug your X2.1 from any power source and insert the SD CARD which the freshly added files (Make sure to the remove the SD card from your computer safely. Don't be a savage!). Plug back the X2.1 to any power source and wait. After 30 seconds the bootloader should've been updated successfully. Don't worry about the files you just added to the SD CARD, they were automatically deleted.

  2. Go to Step #2 and Verify is now recognized as "AUAV X2.1 FMU V2". If yes, then you are done and your board should work as is with PX4 and Mission Planner.

BL Update For Advanced Users

If you are an advanced user you can do this faster and verify if the update actually happens. Just add the file "auavx2v1_bl_fix.bin" into the root of the SD Card, enter to the NuttX terminal via QGC and run the command "bl_update /fs/microsd/auavx2v1_bl_fix.bin", if the procedure is successful, you should see something like this:

8. ArduPilot & Mission Planner FAQ

For those using Ardupilot stack, Mission Planner will load FMUv3 and after booting, Ardupilot will recognize it as a PixHawk Mini (because x2.1 has the same sensors). The only last fix required after loading ArduPilot is to change the param BRD_TYPE to "20" (BRD_TYPE=20) to set the right orientation (which is 90 degrees off, unless you want to mount it sideways).

If during the firmware upload process via Mission Planner you get the following error "Error uploading firmware":

Then your Mission Planner is corrupted. You must remove Mission Planner via Windows Uninstaller, and also, as an extra caution remove the folder "C:/Program Files (x86)/Mission Planner" and reinstall Mission Planner via this file: MissionPlanner-latest.msi.

After you are done with fresh installation the problem should be gone, otherwise check your connections very carefully.

Enjoy!