Electronics - Firmware

Intermediate
1

Overview

This section will go over how to flash each board with the correct firmware using the Arduino IDE.

Required Tools

2

Downloads

Download the MA40 firmware package here. Extract the files and keep them somewhere safe.

Download and install the Arduino IDE.

3

RP2350 Board Installation

Once you have the Arduino IDE up and running, the next step is to install the RP2350 add-on boards. The electronics all have RP2354, but can be programmed using the Generic PR2350 board, with only very slight modifications.

  1. In Arduino IDE, go to Settings / Preferences → Additional Boards Manager URLs and add https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
  2. Then open Boards Manager, search for pico, and install the Raspberry Pi Pico/RP2040/RP2350 core by Earle F. Philhower.
  3. Under Tools → Board, select: Raspberry Pi Pico/RP2040/RP2350 → Generic RP2350
  4. Then set: Flash Size: 2MB, CPU Architecture: ARM, CPU Speed: 150 MHz
4

Adafruit GFX Library

You'll need this library for the Display driver board.

  1. Open up the library manager by either clicking on the left side or under "Sketch" in the toolbar.
  2. Search for "gfx" and install the Adafruit GFX library
5

Display Flash and Test

First, start by opening up up display.ino, and connecting the display board to your computer.

  1. Select the unconfirmed board in the top-left board selector menu.
  2. A popup may show up asking you to confirm the board type. Choose Generic RP2350. If you don't see this, its probably already selected.
  3. Upload the firmware!
  4. The output console should eventually show something like "Wrote 448512 bytes to /Volumes/RP2350/NEW.UF2" and then automatically switch to the Serial Console.
  5. Without the other boards connected, the Serial console will just spam "(heartbeat) no I2C packets received yet." If you see this, you've done everything right and can now disconnect the display board.
6

Magazine Flash and Test

First, start by opening up up magazine.ino, and connecting the magazine board to your computer.

  1. Follow the same steps above for flashing the firmware.
  2. When complete, the serial monitor should show raw potentiometer values.
7

E-Port Flash and Test

First, start by opening up up eport.ino, and connecting the eport board to your computer. (its the one with Chief's helmet on it)

  1. After plugging into USB, slide the power switch into the "On" position. (Switch to the right)
  2. Follow the same steps above for flashing the firmware.
  3. After flashing, the Serial monitor should periodically report system health values.
8

(Optional) Integration Test

  • You may want to perform a system integration test before installing the electronics. To do this, first connect all boards using the JST cables. Pay special attention to the polarity of the cables since you're assembling them yourself.

  • Once everything is connected, plug USB into the e-port board. The display should turn on and show some value for the ammo count. If you go ahead and solder the potentiometer, you can push on it in different places to change the ammo value.

  • You won't be able to use the compass board or any buttons for this test unless you want to solder and re-solder later.

Guide Complete!

Congratulations!

You've successfully completed this guide.

0 Parts Collected
0 Steps Completed
0 Tasks Checked