Skip to content

Commit d42eb48

Browse files
authored
Target config cleanup (ExpressLRS#1693)
* One command to configure any binary * Add flashing for ESP32 RXes # Conflicts: # src/python/binary_configurator.py * Seperate out the platform in the json # Conflicts: # src/hardware/targets.json * Build firmware and installer artifacts * Update the binary configurator to work with the firmware artifact * Add aliases from Configurator * Add bootloader info for stm targets * Copy bootloader firmware to the artifact * Add acceptable CPU type for the flasher * Add supported features * Remove printing * Add overlays and update DCDC
1 parent 91fdb67 commit d42eb48

13 files changed

Lines changed: 1116 additions & 432 deletions

.github/workflows/build.yml

Lines changed: 68 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Checkout
4848
uses: actions/checkout@v2
4949
- id: set-targets
50-
run: echo "::set-output name=targets::[$( (grep -r "\[env:.*STLINK\]" src/targets/ ; grep "\[env:.*UART\]" src/targets/unified.ini) | sed 's/.*://' | sed s/.$// | egrep "(STLINK|UART)" | grep -v DEPRECATED | tr '\n' ',' | sed 's/,$/"\n/' | sed 's/,/","/'g | sed 's/^/"/')]"
50+
run: echo "::set-output name=targets::[$( (grep "\[env:.*UART\]" src/targets/unified.ini ; grep -r "\[env:.*STLINK\]" src/targets/) | sed 's/.*://' | sed s/.$// | egrep "(STLINK|UART)" | grep -v DEPRECATED | tr '\n' ',' | sed 's/,$/"\n/' | sed 's/,/","/'g | sed 's/^/"/')]"
5151

5252
build:
5353
needs: targets
@@ -89,35 +89,85 @@ jobs:
8989
run: |
9090
platformio platform update
9191
platformio platform install native
92-
mkdir -p ~/artifacts
92+
mkdir -p ~/artifacts/firmware
9393
cd src
9494
case ${{matrix.target}} in
9595
*2400* | FM30*)
9696
# release builds
97-
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_EU_CE_2400 -DUSE_DIVERSITY" pio run -e ${{ matrix.target }}
98-
mkdir ~/artifacts/LBT/
99-
mv .pio/build/${{ matrix.target }} ~/artifacts/LBT/`echo ${{ matrix.target }} | sed s/_via.*//`
100-
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_ISM_2400 -DUSE_DIVERSITY" pio run -e ${{ matrix.target }}
101-
mkdir ~/artifacts/FCC/
102-
mv .pio/build/${{ matrix.target }} ~/artifacts/FCC/`echo ${{ matrix.target }} | sed s/_via.*//`
97+
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_EU_CE_2400" pio run -e ${{ matrix.target }}
98+
OUTDIR=~/artifacts/firmware/LBT/`echo ${{ matrix.target }} | sed s/_via.*//`
99+
mkdir -p $OUTDIR
100+
mv .pio/build/${{ matrix.target }}/firmware.{elrs,bin} $OUTDIR >& /dev/null || :
101+
102+
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_ISM_2400" pio run -e ${{ matrix.target }}
103+
OUTDIR=~/artifacts/firmware/FCC/`echo ${{ matrix.target }} | sed s/_via.*//`
104+
mkdir -p $OUTDIR
105+
mv .pio/build/${{ matrix.target }}/firmware.{elrs,bin} $OUTDIR >& /dev/null || :
103106
;;
104107
*)
105108
# release build
106-
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_FCC_915 -DUSE_DIVERSITY" pio run -e ${{ matrix.target }}
107-
mkdir ~/artifacts/FCC/
108-
mv .pio/build/${{ matrix.target }} ~/artifacts/FCC/`echo ${{ matrix.target }} | sed s/_via.*//`
109+
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_FCC_915" pio run -e ${{ matrix.target }}
110+
OUTDIR=~/artifacts/firmware/FCC/`echo ${{ matrix.target }} | sed s/_via.*//`
111+
mkdir -p $OUTDIR
112+
mv .pio/build/${{ matrix.target }}/firmware.{elrs,bin} $OUTDIR >& /dev/null || :
109113
;;
110114
esac
111-
if [[ ${{matrix.target}} == *ESP32* ]] ; then
112-
cp ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin ~/artifacts/
113-
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin ~/artifacts/
115+
# copy the common ESP32 files
116+
if [[ ${{matrix.target}} == *ESP32* ]] ; then
117+
cp ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin ~/artifacts/firmware/
118+
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin ~/artifacts/firmware/
119+
mv .pio/build/${{ matrix.target }}/partitions.bin ~/artifacts/firmware/
114120
fi
115121
116122
- name: Store Artifacts
117123
uses: actions/upload-artifact@v2-preview
118124
with:
119-
name: ExpressLRS-${{ env.GITHUB_REF_SLUG_URL }}-${{ github.run_number }}
120-
path: |
121-
~/artifacts/**/*.bin
122-
~/artifacts/**/*.elrs
125+
name: firmware
126+
path: ~/artifacts/**/*
123127
continue-on-error: true
128+
129+
firmware:
130+
needs: build
131+
runs-on: ubuntu-latest
132+
steps:
133+
- name: Checkout code
134+
uses: actions/checkout@v2
135+
136+
- name: Get firmware artifacts
137+
uses: actions/download-artifact@v3
138+
with:
139+
name: firmware
140+
path: dist
141+
142+
- name: Copy hardware files to firmware folder
143+
run: cp -r src/hardware dist/firmware
144+
145+
- name: Copy bootloader files to firmware folder
146+
run: cd src ; find bootloader -name \*.bin -o -name \*.frk | grep -v src/ | cpio -pdm ../dist/firmware
147+
148+
- name: Update firmware artifact
149+
uses: actions/upload-artifact@v2
150+
with:
151+
name: firmware
152+
path: dist/**/*
153+
154+
installer:
155+
strategy:
156+
fail-fast: false
157+
matrix:
158+
os: [windows-latest, ubuntu-latest, macos-latest]
159+
runs-on: ${{ matrix.os }}
160+
steps:
161+
- uses: actions/checkout@v2
162+
- uses: actions/setup-python@v2
163+
with:
164+
python-version: 3.7
165+
166+
- run: pip install pyserial
167+
- run: pip install pyinstaller
168+
- run: pyinstaller -F src/python/binary_configurator.py -n installer-${{ matrix.os }}
169+
170+
- uses: actions/upload-artifact@v2
171+
with:
172+
name: installer
173+
path: dist/*

src/hardware/RX/Generic 2400 PA Diversity.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"radio_nss": 15,
99
"radio_rst": 2,
1010
"radio_sck": 14,
11-
"radio_dcdc": true,
1211
"ant_ctrl": 9,
1312
"power_txen": 10,
1413
"power_min": 0,

src/hardware/RX/Generic 2400 PA.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"radio_nss": 15,
99
"radio_rst": 2,
1010
"radio_sck": 14,
11-
"radio_dcdc": true,
1211
"power_rxen": 9,
1312
"power_txen": 10,
1413
"power_min": 0,

0 commit comments

Comments
 (0)