Skip to content

Commit

Permalink
Add a new target Pixhawk5X
Browse files Browse the repository at this point in the history
  • Loading branch information
jamming committed Nov 29, 2021
1 parent d487c4c commit d0c2b65
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
#
Expand Down
45 changes: 45 additions & 0 deletions hw_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d0c2b65

Please sign in to comment.