3939#define USE_PLL_HSE_XTAL 0x4 // Use external xtal (X3 on board - not provided by default)
4040#define USE_PLL_HSI 0x2 // Use HSI internal clock
4141
42+ extern " C" uint8_t SetSysClock_PLL_HSE (uint8_t bypass, bool lowspeed);
43+
4244volatile const uint8_t bootloader_data[] __attribute__ ((section (" .bootloader_version" ), used)) = {
4345 BOOTLOADER_CONFIG_MAGIC,
4446 BOOTLOADER_VERSION,
@@ -55,6 +57,10 @@ volatile const uint8_t bootloader_data[] __attribute__ ((section (".bootloader_v
5557
5658volatile const uint8_t bootloader_identifier[] __attribute__ ((section (" .bootloader_identification" ), used)) = " MCUboot Arduino" ;
5759
60+ #if MCUBOOT_APPLICATION_DFU
61+ USBD_HandleTypeDef USBD_Device;
62+ #endif
63+
5864DigitalOut red (BOARD_RED_LED, 1 );
5965DigitalOut green (BOARD_GREEN_LED, 1 );
6066DigitalOut blue (BOARD_BLUE_LED, 1 );
@@ -118,15 +124,6 @@ static int debug_init(void) {
118124 return 0 ;
119125}
120126
121- #if MCUBOOT_APPLICATION_DFU
122- USBD_HandleTypeDef USBD_Device;
123- extern PCD_HandleTypeDef hpcd;
124- #endif
125-
126- extern " C" {
127- uint8_t SetSysClock_PLL_HSE (uint8_t bypass, bool lowspeed);
128- }
129-
130127static int start_dfu (void ) {
131128 RTCSetBKPRegister (RTC_BKP_DR0, 0 );
132129
@@ -168,7 +165,7 @@ static int start_dfu(void) {
168165#else // USE_USB_FS
169166 if (USB_OTG_FS->GINTSTS & USB_OTG_FS->GINTMSK ) {
170167#endif
171- HAL_PCD_IRQHandler (&hpcd );
168+ HAL_PCD_IRQHandler (HAL_PCD_GetHandle () );
172169 }
173170#endif
174171 led_pulse (&green);
0 commit comments