From 230a817539229c6bbebe14da0eaeee8f320da73b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 19 Oct 2019 21:21:10 +1100 Subject: [PATCH] AP_Bootloader: support ZubaxGNSS --- Tools/AP_Bootloader/AP_Bootloader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tools/AP_Bootloader/AP_Bootloader.cpp b/Tools/AP_Bootloader/AP_Bootloader.cpp index c61e8a2e7c..ec45da6e03 100644 --- a/Tools/AP_Bootloader/AP_Bootloader.cpp +++ b/Tools/AP_Bootloader/AP_Bootloader.cpp @@ -58,6 +58,14 @@ int main(void) bool try_boot = false; uint32_t timeout = HAL_BOOTLOADER_TIMEOUT; +#ifdef HAL_BOARD_AP_PERIPH_ZUBAXGNSS + // setup remapping register for ZubaxGNSS + uint32_t mapr = AFIO->MAPR; + mapr &= ~AFIO_MAPR_SWJ_CFG; + mapr |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + AFIO->MAPR = mapr | AFIO_MAPR_CAN_REMAP_REMAP2 | AFIO_MAPR_SPI3_REMAP; +#endif + #ifndef NO_FASTBOOT enum rtc_boot_magic m = check_fast_reboot(); if (stm32_was_watchdog_reset()) {