diff --git a/Makefile b/Makefile index e61ba1ec7c..f319d6d906 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,8 @@ TARGETS = \ smartap_pro_bl \ tapv1_bl \ uvify_core_bl \ - atl_mantis_edu_bl + atl_mantis_edu_bl \ + pixhawk5x_bl all: $(TARGETS) sizes @@ -198,6 +199,9 @@ aerofcv1_bl: $(MAKEFILE_LIST) $(LIBOPENCM3) atl_mantis_edu_bl: $(MAKEFILE_LIST) $(LIBOPENCM3) ${MAKE} ${MKFLAGS} -f Makefile.f7 TARGET_HW=ATL_MANTIS_EDU LINKER_FILE=stm32f7.ld TARGET_FILE_NAME=$@ +pixhawk5x_bl:$(MAKEFILE_LIST) $(LIBOPENCM3) + ${MAKE} ${MKFLAGS} -f Makefile.f7 TARGET_HW=PIXHAWK5X LINKER_FILE=stm32f7.ld TARGET_FILE_NAME=$@ + # # Show sizes # diff --git a/hw_config.h b/hw_config.h index b992400732..1fd541623a 100644 --- a/hw_config.h +++ b/hw_config.h @@ -1440,6 +1440,51 @@ # define SERIAL_BREAK_DETECT_DISABLED 1 # undef USE_VBUS_PULL_DOWN +/**************************************************************************** + * TARGET_HW_PIXHAWK5X + ****************************************************************************/ +#elif defined(TARGET_HW_PIXHAWK5X) + +# define APP_LOAD_ADDRESS 0x08008000 +# define BOOTLOADER_DELAY 5000 +# define INTERFACE_USB 1 +# define INTERFACE_USART 1 +# define USBDEVICESTRING "Pixhawk5X.x" +# define USBPRODUCTID 0x0033 +# define USBVENDORID 0x3162 +# define USBMFGSTRING "Holybro" +# define BOOT_DELAY_ADDRESS 0x00000200 + +# define BOARD_TYPE 51 +# define _FLASH_KBYTES (*(uint16_t *)0x1ff0f442) +# define BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 7 : 11) +# define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) + +# define OSC_FREQ 16 + +# define BOARD_PIN_LED_ACTIVITY GPIO5 // BLUE +# define BOARD_PIN_LED_BOOTLOADER GPIO4 // GREEN +# define BOARD_PORT_LEDS GPIOE +# define BOARD_CLOCK_LEDS RCC_AHB1ENR_GPIOEEN +# define BOARD_LED_ON gpio_clear +# define BOARD_LED_OFF gpio_set + +# define BOARD_USART UART5 +# define BOARD_USART_CLOCK_REGISTER RCC_APB1ENR +# define BOARD_USART_CLOCK_BIT RCC_APB1ENR_UART5EN + +# define BOARD_PORT_USART_AF_TX GPIO_AF7 +# define BOARD_PORT_USART_TX GPIOB +# define BOARD_PIN_TX GPIO9 +# define BOARD_PORT_USART_AF_RX GPIO_AF8 +# define BOARD_PORT_USART_RX GPIOD +# define BOARD_PIN_RX GPIO2 +# define BOARD_USART_PIN_CLOCK_REGISTER RCC_AHB1ENR +# define BOARD_USART_PIN_CLOCK_BIT_TX RCC_AHB1ENR_GPIOBEN +# define BOARD_USART_PIN_CLOCK_BIT_RX RCC_AHB1ENR_GPIODEN +# define SERIAL_BREAK_DETECT_DISABLED 1 +# define OVERRIDE_USART_BAUDRATE 1500000 + #else # error Undefined Target Hardware #endif