Add wrapping and flashing capabilities to build system

Now the meson build system is able to wrap and flash supported radios,
wrapping targets will be called openrtx_MODEL_wrap and flashing targets
will be called openrtx_MODEL_flash.
replace/1826ab23dd9a0aa1e61d7afc3f2e4f1bb390383d
Niccolò Izzo 2020-10-19 15:02:18 +02:00
rodzic 9b26c2d71b
commit 8e92a81115
2 zmienionych plików z 52 dodań i 8 usunięć

Wyświetl plik

@ -55,15 +55,15 @@ sudo apt install gcc-arm-none-eabi
You can then proceed in building the firmware:
```
meson setup --cross-file cross_arm.txt build_md380
meson compile -C builddir openrtx-md380
meson setup --cross-file cross_arm.txt build_arm
meson compile -C build_arm openrtx_md380
```
If you are using a version of Meson older than v0.55.0, the above command will fail, compile with:
```
meson setup --cross-file cross_arm.txt build_md380
ninja -C build_md380 openrtx-md380 -jN
meson setup --cross-file cross_arm.txt build_arm
ninja -C build_arm openrtx_md380 -jN
```
Where N is the number of cores that you want to allocate to the build process.
@ -73,7 +73,7 @@ put it in recovery mode (by powering it on with the PTT and the button
above it pressed), and flash the firmware:
```
make flash
meson compile -C build_arm openrtx_md380_flash
```
Now you can power cycle your radio and enjoy the new breath of freedom!

Wyświetl plik

@ -144,6 +144,50 @@ md380 = {'sources': md380_src,
##
## Select your radio model among the supported ones: MD-380, MD-UV380
##
executable('openrtx-linux', kwargs:linux)
executable('openrtx-md380', kwargs:md380)
executable('openrtx-mduv380', kwargs:md380)
openrtx_linux = executable('openrtx_linux.bin', kwargs:linux)
openrtx_md380 = executable('openrtx_md380.bin', kwargs:md380)
openrtx_mduv380g = executable('openrtx_mduv380g.bin', kwargs:md380)
radio_tool = find_program('radio_tool')
openrtx_md380_wrap = custom_target('openrtx_md380_wrap',
output : 'openrtx_md380_wrap.bin',
input : openrtx_md380,
command : [radio_tool,
'--wrap',
'-o', '@OUTPUT@',
'-r', 'MD380',
'-s', '0x0800C000:@INPUT@'])
openrtx_md380_flash = custom_target('openrtx_md380_flash',
input : openrtx_md380_wrap,
output : 'openrtx_md380_flash',
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])
openrtx_md390_wrap = custom_target('openrtx_md390_wrap',
output : 'openrtx_md390_wrap.bin',
input : openrtx_md380,
command : [radio_tool,
'--wrap',
'-o', '@OUTPUT@',
'-r', 'MD390',
'-s', '0x0800C000:@INPUT@'])
openrtx_md390_flash = custom_target('openrtx_md390_flash',
input : openrtx_md390_wrap,
output : 'openrtx_md390_flash',
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])
openrtx_mduv380g_wrap = custom_target('openrtx_mduv380g_wrap',
output : 'openrtx_mduv380g_wrap.bin',
input : openrtx_mduv380g,
command : [radio_tool,
'--wrap',
'-o', '@OUTPUT@',
'-r', 'UV3X0',
'-s', '0x0800C000:@INPUT@'])
openrtx_mduv380g_flash = custom_target('openrtx_mduv380g_flash',
input : openrtx_mduv380g_wrap,
output : 'openrtx_mduv380g_flash',
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])