Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new target Pixhawk5X #215

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 "PX4 BL 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