Skip to content

Commit 9397888

Browse files
authored
Merge pull request #118 from SeongGino/Valkyrja
Bump backend systems to add RP2350 support
2 parents 9a6f35f + 761d335 commit 9397888

File tree

3 files changed

+39
-17
lines changed

3 files changed

+39
-17
lines changed

.github/workflows/arduino-cli-builds.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,27 @@ jobs:
1818
- name: Raspberry Pi Pico W (USB)
1919
fqbn: rpipicow
2020
pretty: rpipicow-noBT
21-
flags: freq=133,usbstack=tinyusb,flash=2097152_65536,opt=Optimize3
22-
21+
flags: freq=133,usbstack=tinyusb,flash=2097152_65536,opt=Optimize3,wificountry=worldwide,ipbtstack=ipv4only
22+
extra_flags: -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1
23+
24+
# Disabled until issues surrounding interacting with cyw southbridge causing lockups is solved
2325
#- name: Raspberry Pi Pico W (Bluetooth)
2426
# fqbn: rpipicow
2527
# pretty: rpipicow-btBETA
26-
# flags: freq=133,usbstack=tinyusb,opt=Optimize3,ipbtstack=ipv4btcble,wificountry=worldwide
27-
28+
# flags: freq=133,usbstack=tinyusb,flash=2097152_65536,opt=Optimize3,ipbtstack=ipv4btcble,wificountry=worldwide
29+
# extra_flags: -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1
30+
31+
- name: Raspberry Pi Pico 2 [ARM]
32+
fqbn: rpipico2
33+
pretty: rpipico2
34+
flags: freq=133,usbstack=tinyusb,flash=4194304_65536,opt=Optimize3,arch=arm
35+
36+
- name: Raspberry Pi Pico 2W [ARM] (USB)
37+
fqbn: rpipico2w
38+
pretty: rpipico2w
39+
flags: freq=133,usbstack=tinyusb,flash=4194304_65536,opt=Optimize3,wificountry=worldwide,ipbtstack=ipv4only,arch=arm
40+
extra_flags: -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1
41+
2842
- name: Adafruit ItsyBitsy RP2040
2943
fqbn: adafruit_itsybitsy
3044
pretty: adafruitItsy
@@ -49,6 +63,11 @@ jobs:
4963
fqbn: waveshare_rp2040_zero
5064
pretty: waveshareZero
5165
flags: freq=133,usbstack=tinyusb,flash=2097152_65536,opt=Optimize3
66+
67+
- name: Generic RP2350
68+
fqbn: generic_rp2350
69+
pretty: generic_rp2350
70+
flags: freq=133,usbstack=tinyusb,flash=2097152_1048576,opt=Optimize3,arch=arm
5271

5372
- name: Generic RP2040
5473
fqbn: generic
@@ -69,8 +88,10 @@ jobs:
6988
if: ${{ matrix.fqbn == 'arduino_nano_connect' }}
7089
run: arduino-cli lib install WiFiNINA
7190

91+
# use our fork with patched TUSB
92+
# TODO: for now, select version manually (as our -tusb version is currently considered prior to upstream 4.5.4)
7293
- name: Setting up Arduino-cli
73-
run: arduino-cli core install rp2040:rp2040 --additional-urls https://github.com/SeongGino/arduino-pico/releases/download/3.9.2-fix/package_rp2040_fix_index_orig.json
94+
run: arduino-cli core install rp2040:rp2040@4.5.4-tusb --additional-urls https://github.com/TeamOpenFIRE/arduino-pico/releases/download/global/package_rp2040_index.json
7495

7596
- name: Get short SHA
7697
id: get-short-sha
@@ -83,7 +104,8 @@ jobs:
83104
OpenFIREmain
84105
--libraries libraries
85106
--build-property 'build.extra_flags=
86-
-DGIT_HASH="${{steps.get-short-sha.outputs.id}}"'
107+
-DGIT_HASH="${{steps.get-short-sha.outputs.id}}"
108+
${{matrix.extra_flags}}'
87109
88110
- name: Rename build file
89111
run: cp ${{github.workspace}}/OpenFIREmain/build/rp2040.rp2040.${{matrix.fqbn}}/OpenFIREmain.ino.uf2 OpenFIREfw.${{ matrix.pretty }}.uf2

COMPILING.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ For most people, you may prefer editing, testing and using the Arduino IDE. This
1212
1. [Download and install the Arduino IDE for your system]() (or for Linux users, install from your system's package manager).
1313
2. After opening the IDE, go to File->Preferences and paste the following into the *Additional boards manager URLs* field:
1414
```
15-
https://github.com/SeongGino/arduino-pico/releases/download/3.9.2-fix/package_rp2040_fix_index_orig.json
15+
https://github.com/TeamOpenFIRE/arduino-pico/releases/download/global/package_rp2040_index.json
1616
```
17-
3. Open the Boards Manager (second button from the top on the left sidebar), search and install "Raspberry Pi Pico/RP2040 (Fix)" version `3.9.2-fix`.
17+
3. Open the Boards Manager (second button from the top on the left sidebar), search and install the latest version of *"Raspberry Pi Pico/RP2040/RP2350 (TUSB Fix)"*.
1818
- Using this fork is REQUIRED as it includes a fixed version of Adafruit's TinyUSB library. Until adafruit/Adafruit_TinyUSB_Arduino#293 is resolved, do not use the upstream *Arduino-Pico* core or install the separate Adafruit TinyUSB library.
1919
4. Clone/extract the contents of the source repository into your system's `Arduino` folder, so that the `OpenFIREmain` folder is next to `libraries`. Open the `OpenFIREmain` sketch.
20-
5. From the app menu up top, set the current microcontroller to your current board under *Tools->Board:->Raspberry Pi Pico/RP2040 (Fix),* set CPU speed to *133 MHz,* set Optimize to *Optimize Even More (-O3),* set Flash Size to include a 64KB file system,* and set USB Stack to *Adafruit TinyUSB* (not *Host*).
20+
5. From the app menu up top, set the current microcontroller to your current board under *Tools->Board:->Raspberry Pi Pico/RP2040/RP2350 (TUSB Fix),* set CPU speed to *133 MHz,* set Optimize to *Optimize Even More (-O3),* set Flash Size to include at least a 64KB file system,* and set USB Stack to *Adafruit TinyUSB* (not *Host*). For RP2350 boards, *CPU Architecture* must be set to *ARM*.
2121
6. When you're ready to build, click Verify to check for compilation errors, Upload to directly upload the binary to the microcontroller (if connected), or go to *Sketch->Export Compiled Binary* to generate a .uf2 file under `OpenFIREmain/build/rp2040.rp2040.board_name` that you can drag and drop onto your microcontroller when it's in bootloader mode (either by holding BOOTSEL on poweron, or resetting to bootloader from the OpenFIRE App).
2222

2323
### Arduino (-cli) Setup
2424
Compiling from the cli can be used to automate the build process, and is used by the GitHub actions deployments for release builds.
2525
1. [Download the Arduino-cli tool for your system](https://github.com/arduino/arduino-cli/releases/latest) and install it to where it's most convenient (or for Linux users, install from your system's package manager).
2626
- These instructions are tailored to Linux, but Windows users can use `arduino-cli.exe` whenever the tool is referenced.
27-
2. Install the patched RP2040 core for OpenFIRE:
27+
2. Install the latest version of the patched RP2040/RP2350 core for OpenFIRE:
2828
```bash
29-
$ arduino-cli core install rp2040:rp2040 --additional-urls https://github.com/SeongGino/arduino-pico/releases/download/3.9.2-fix/package_rp2040_fix_index_orig.json
29+
$ arduino-cli core install rp2040:rp2040 --additional-urls https://github.com/TeamOpenFIRE/arduino-pico/releases/download/global/package_rp2040_index.json
3030
```
3131
- Optional: for *Arduino Nano RP2040 Connect*, also install its WiFiNINA library:
3232
```bash
@@ -49,7 +49,7 @@ Compiling from the cli can be used to automate the build process, and is used by
4949
Adafruit Feather RP2040 RFM rp2040:rp2040:adafruit_feather_rfm
5050
...
5151
```
52-
5. Find the flash value that allocates 64KB for the File System (replacing `{BOARD}` with your desired microcontroller's FQBN name). The example output below would be seen if `{BOARD}` was set to `rp2040:rp2040:rpipico`:
52+
5. Find the flash value that allocates at least 64KB for the File System (replacing `{BOARD}` with your desired microcontroller's FQBN name). The example output below would be seen if `{BOARD}` was set to `rp2040:rp2040:rpipico`:
5353
```bash
5454
$ arduino-cli board details -b {BOARD}
5555
@@ -67,7 +67,6 @@ Compiling from the cli can be used to automate the build process, and is used by
6767
```bash
6868
$ arduino-cli compile -e --fqbn rp2040:rp2040:{BOARD}:usbstack=tinyusb,opt=Optimize3,flash={FLASH} /path/to/OpenFIRE-Firmware/OpenFIREmain --libraries /path/to/repo/libraries
6969
```
70-
*for custom builds, feel free to configure the above build flags to your needs to enable/disable certain OpenFIREfw features.*
7170

7271
When successful, you will find the exported binary at `/path/to/OpenFIRE-Firmware/OpenFIREmain/build/rp2040.rp2040.{BOARD}/OpenFIREmain.ino.uf2`
7372

@@ -77,9 +76,9 @@ Per-board build configurations for various microcontrollers, and the strings to
7776
### Define Buttons & Timers
7877
Tactile extras can be defined/unset by simply (un)commenting the respective defines in `OpenFIREDefines.h` - though each one of these can be simply disabled at runtime even when the firmware is "fully kitted".
7978

80-
If your gun is going to be hardset to player 1/2/3/4 e.g. for an arcade build, change `#define PLAYER_NUMBER` to 1, 2, 3, or 4 depending on what keys you want the Start/Select buttons to correlate to. Remember that guns can be remapped to any player number arrangement at any time if needed by sending an `XR#` command over Serial - where # is the player number.
79+
If your gun is going to be hardset to player 1/2/3/4 e.g. for an arcade build, uncomment and set `#define PLAYER_NUMBER` to 1, 2, 3, or 4 depending on what keys you want the Start/Select buttons to correlate to. Remember that, when this variable is unset, guns can be remapped to any player number arrangement at any time if needed by sending an `XR#` command over Serial - where # is the player number.
8180

82-
These parameters are easily found and can be redefined in `OpenFIREDefines.h`:
81+
To change the default USB ID, these parameters are easily found and can be redefined in `OpenFIREDefines.h`:
8382

8483
```c++
8584
#define MANUFACTURER_NAME "OpenFIRE"
@@ -88,8 +87,9 @@ These parameters are easily found and can be redefined in `OpenFIREDefines.h`:
8887
```
8988

9089
You may change these to suit whatever your heart desires - though the only parts *necessary to change for multiplayer* is the Device Vendor ID and/or Product ID (the latter is determined by either loaded preferences or Player Number, in that order). Then, just reflash the board!
90+
Keep in mind that for App and most distros' compatibility, the Vendor ID (`DEVICE_VID`) **MUST** be kept at the default `0xF143` identifier.
9191
9292
Remember that the sketch uses the Arduino GPIO pin numbers; on many boards, including the Raspberry Pi Pico and the Adafruit Itsybitsy RP2040, these are the silkscreen labels on the **underside** of the microcontroller (marked GP00-29). Note that this does not apply to the analog pins (A0-A3), which are macros for GP26-29.
93-
For boards already implemented, the OpenFIRE Desktop App has an embedded interactive *boards previewer* to view the default layout and location of GPIO for supported microcontrollers. You can also refer to [this interactive webpage](https://pico.pinout.xyz/) for detailed information on the Pico/W's layout, or your board vendor's documentation for more information about your particular microcontroller.
93+
For boards already implemented, the OpenFIRE Desktop App has an embedded interactive *boards previewer* to view the default layout, location, and extra capabilities of GPIO for supported microcontrollers. You can also refer to [this interactive webpage](https://pico.pinout.xyz/) for detailed information on the Pico/W's layout, or your board vendor's documentation for more information about your particular microcontroller.
9494
9595
The default button:pins layout used will be reflected by default in the OpenFIRE App, which can be used as reference or can be changed to any custom pins layout to suit your needs - custom settings will take priority over board defaults if enabled & detected.

0 commit comments

Comments
 (0)