diff --git a/libraries/AP_HAL_ChibiOS/Util.cpp b/libraries/AP_HAL_ChibiOS/Util.cpp index be69b92479..c430423353 100644 --- a/libraries/AP_HAL_ChibiOS/Util.cpp +++ b/libraries/AP_HAL_ChibiOS/Util.cpp @@ -34,6 +34,7 @@ #endif #if HAL_ENABLE_SAVE_PERSISTENT_PARAMS #include +#include #endif #ifndef HAL_BOOTLOADER_BUILD #include @@ -49,6 +50,7 @@ extern AP_IOMCU iomcu; #include #endif + extern const AP_HAL::HAL& hal; using namespace ChibiOS; @@ -526,6 +528,12 @@ bool Util::get_persistent_params(ExpandingString &str) const if (ins) { ins->get_persistent_params(str); } +#endif +#if AP_OPENDRONEID_ENABLED + const auto *odid = AP_OpenDroneID::get_singleton(); + if (odid) { + odid->get_persistent_params(str); + } #endif if (str.has_failed_allocation() || str.get_length() <= strlen(persistent_header)) { // no data diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-ODID/defaults.parm b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-ODID/defaults.parm index e79aa27e5d..92d6c3ec2a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-ODID/defaults.parm +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-ODID/defaults.parm @@ -13,9 +13,9 @@ SERIAL5_PROTOCOL 1 # enforce OpenDroneID on DroneCAN. Note that we need to lock down key parameters # to ensure the integrity of the RemoteID system DID_ENABLE 1 @READONLY -DID_OPTIONS 1 @READONLY -DID_MAVPORT -1 @READONLY -DID_CANDRIVER 1 @READONLY +DID_OPTIONS 5 @READONLY +DID_MAVPORT 1 @READONLY +DID_CANDRIVER 0 @READONLY AHRS_EKF_TYPE 3 @READONLY GPS_TYPE 1 GPS_TYPE2 0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-ODID/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-ODID/hwdef.dat index edba88a70c..622f08010e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-ODID/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-ODID/hwdef.dat @@ -4,7 +4,28 @@ include ../CubeOrange/hwdef.dat # the firmware without OpenDroneID enabled APJ_BOARD_ID 10140 +# Set the four character UA MFR Code based on the ICAO assigned ID +# rest of the id will be inferred from the unique chip id +define OPENDRONEID_UA_MFR_CODE "MFR1" + +# Set the UA Type, possible values: +# 0: reserved +# 1: Aeroplane +# 2: Helicopter or Multirotor +# 3: Gyroplane +# 4: Hybrid Lift +# 5: Ornithopter +# 6: Glider +# 7: Kite +# 8: Free Balloon +# 9: Captive Balloon +# 10: Airship +# 11: Free Fall/Parachute +# 12: Rocket +# 13: Tethered Powered Aircraft +# 14: Ground Obstacle +# 15: Other +define OPENDRONEID_UA_TYPE 1 + # enable and enforce OpenDroneID define AP_OPENDRONEID_ENABLED 1 - -