' 'AP_CheckFirmware' was not declared in this scope'

hello @peterbarker @tridge , I am following the steps listed here (ardupilot/Tools/scripts/signing at master · ArduPilot/ardupilot · GitHub).
while running this command: Tools/scripts/build_bootloaders.py BOARDNAME --signing-key=NAME_public_key.dat , I am getting following error.
I checked this file util.cpp, it seems fine. I am not sure why I am getting this error. I also checked recent commits and there is no particular change related to this file. Can anyone please help me here.

../../libraries/AP_HAL_ChibiOS/Util.cpp: In member function 'virtual AP_HAL::Util::FlashBootloader ChibiOS::Util::flash_bootloader()':
../../libraries/AP_HAL_ChibiOS/Util.cpp:287:10: error: 'AP_CheckFirmware' was not declared in this scope
  287 |     if (!AP_CheckFirmware AP_CheckFirmware::check_signed_bootloader(fw, fw_size)) {
      |          ^~~~
compilation terminated due to -Wfatal-errors