From 44c374ec4606ad3fc42464536016ff8079ff455c Mon Sep 17 00:00:00 2001 From: Lokesh-Ramina Date: Mon, 8 Jan 2024 16:57:02 -0800 Subject: [PATCH 1/4] hwdef: Removal of Custom Firmware define from Carbonix boards This is been handled now in AP_CarbonixCustom.h SW-51 --- libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/hwdef.dat | 2 -- libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef.dat | 2 -- libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef.dat | 2 -- 3 files changed, 6 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/hwdef.dat index e51c834226..21e3c6315d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/hwdef.dat @@ -2,8 +2,6 @@ include ../CubeOrange/hwdef.dat -define AP_CUSTOM_FIRMWARE_STRING "CarboPilot V5.0.0-beta3" - undef HAL_NAVEKF3_AVAILABLE undef HAL_NAVEKF2_AVAILABLE undef HAL_EXTERNAL_AHRS_ENABLED diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef.dat index 458186bed6..f46e5137da 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef.dat @@ -19,8 +19,6 @@ env AP_PERIPH 1 # crystal frequency set to 0 to use internal clock; currently configured for external crystal 12MHZ OSCILLATOR_HZ 12000000 -define AP_CUSTOM_FIRMWARE_STRING "CarboPilot V5.0.0-beta3" - #MCU F405 Flash 1024 FLASH_SIZE_KB 1024 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef.dat index 563a8981da..58795571f5 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef.dat @@ -21,8 +21,6 @@ env AP_PERIPH 1 # crystal frequency OSCILLATOR_HZ 12000000 -define AP_CUSTOM_FIRMWARE_STRING "CarboPilot V5.0.0-beta3" - # assume the 256k flash part FLASH_SIZE_KB 256 From a002e7912374e81aa041d445adb981305c1ef992 Mon Sep 17 00:00:00 2001 From: Lokesh-Ramina Date: Mon, 8 Jan 2024 20:57:31 -0800 Subject: [PATCH 2/4] AP_Common: AP_FWVersion Added define for CarboPilot firmware version In this commit, a preprocessor directive has been added to the AP_FWVersionDefine.h file. This directive checks if the CARBOPILOT macro is defined. If it is, the AP_CUSTOM_FIRMWARE_STRING macro is defined as mentiones. This allows for custom firmware versioning when building the CarboPilot project. Going forward we will modify the Custom Firmware name at only one location. And to use it need to compile the code with the #define eg below: ./waf configure --board CarbonixCubeOrange --define=CARBOPILOT=1 SW-51 --- libraries/AP_Common/AP_FWVersionDefine.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_Common/AP_FWVersionDefine.h b/libraries/AP_Common/AP_FWVersionDefine.h index 481f1cbdcd..c34ab2412a 100644 --- a/libraries/AP_Common/AP_FWVersionDefine.h +++ b/libraries/AP_Common/AP_FWVersionDefine.h @@ -23,6 +23,10 @@ #include #include +#ifdef CARBOPILOT +#define AP_CUSTOM_FIRMWARE_STRING "CarboPilot V5.0.0-beta3" +#endif + /* allow vendors to set AP_CUSTOM_FIRMWARE_STRING in hwdef.dat */ From dbfeaf034588536b9b8265531db3d8c3d1e9e804 Mon Sep 17 00:00:00 2001 From: Lokesh-Ramina Date: Mon, 8 Jan 2024 21:02:04 -0800 Subject: [PATCH 3/4] Tools: Carbonix waf build update to add define CARBOPILOT=1 SW-51 --- Tools/Carbonix_scripts/carbonix_waf_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/Carbonix_scripts/carbonix_waf_build.sh b/Tools/Carbonix_scripts/carbonix_waf_build.sh index 1185489599..75448f716a 100755 --- a/Tools/Carbonix_scripts/carbonix_waf_build.sh +++ b/Tools/Carbonix_scripts/carbonix_waf_build.sh @@ -26,7 +26,7 @@ main_boards=("CarbonixCubeOrange" "CubeOrange" "sitl") for board in "${main_boards[@]}"; do echo "Compiling Plane for $board..." ./Tools/scripts/build_bootloaders.py "$board" - ./waf configure --board "$board" + ./waf configure --board "$board" --define=CARBOPILOT=1 ./waf plane done @@ -35,7 +35,7 @@ periph_boards=("CarbonixF405" "Volanti-M1" "Volanti-M2" "Volanti-M3" "Volanti-M4 for board in "${periph_boards[@]}"; do echo "Compiling AP_Periph for $board..." ./Tools/scripts/build_bootloaders.py "$board" - ./waf configure --board "$board" + ./waf configure --board "$board" --define=CARBOPILOT=1 ./waf AP_Periph done From 0e51f86b802fbe7b4aa1b834ad9ba48528de2804 Mon Sep 17 00:00:00 2001 From: Lokesh-Ramina Date: Mon, 8 Jan 2024 21:02:35 -0800 Subject: [PATCH 4/4] workflow: Carbonix CI build update to add define CARBOPILOT=1 SW-51 --- .github/workflows/carbonix_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/carbonix_build.yml b/.github/workflows/carbonix_build.yml index d73ab4d136..d5e591dac8 100644 --- a/.github/workflows/carbonix_build.yml +++ b/.github/workflows/carbonix_build.yml @@ -172,7 +172,7 @@ jobs: for board in "${boards[@]}"; do echo "Compiling AP_Periph for $board..." ./Tools/scripts/build_bootloaders.py "$board" - ./waf configure --board "$board" + ./waf configure --board "$board" --define=CARBOPILOT=1 ./waf plane done echo "Script completed successfully." @@ -183,7 +183,7 @@ jobs: for board in "${boards[@]}"; do echo "Compiling AP_Periph for $board..." ./Tools/scripts/build_bootloaders.py "$board" - ./waf configure --board "$board" + ./waf configure --board "$board" --define=CARBOPILOT=1 ./waf AP_Periph done echo "Script completed successfully."