diff --git a/README.md b/README.md index 76786d59..c0379d3c 100644 --- a/README.md +++ b/README.md @@ -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! diff --git a/meson.build b/meson.build index f0fb439a..04ad7b0f 100644 --- a/meson.build +++ b/meson.build @@ -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@'])