Skip to content

Commit

Permalink
Add THEPeach K1/R1
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePeach-kr authored and davids5 committed Oct 27, 2022
1 parent 58fac9a commit b859d47
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ pipeline {
"smartap_pro_bl",
"tapv1_bl",
"uvify_core_bl",
"thepeach_k1_bl",
"thepeach_r1_bl",
],
image: docker_images.nuttx,
archive: true
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ TARGETS = \
smartap_pro_bl \
tapv1_bl \
uvify_core_bl \
atl_mantis_edu_bl
atl_mantis_edu_bl \
thepeach_k1_bl \
thepeach_r1_bl

all: $(TARGETS) sizes

Expand Down Expand Up @@ -183,6 +185,12 @@ modalai_voxl2_io_bl: $(MAKEFILE_LIST) $(LIBOPENCM3)
uvify_core_bl:$(MAKEFILE_LIST) $(LIBOPENCM3)
${MAKE} ${MKFLAGS} -f Makefile.f4 TARGET_HW=UVIFY_CORE LINKER_FILE=stm32f4.ld TARGET_FILE_NAME=$@

thepeach_k1_bl: $(MAKEFILE_LIST) $(LIBOPENCM3)
${MAKE} ${MKFLAGS} -f Makefile.f4 TARGET_HW=THE_PEACH_K1 LINKER_FILE=stm32f4.ld TARGET_FILE_NAME=$@

thepeach_r1_bl: $(MAKEFILE_LIST) $(LIBOPENCM3)
${MAKE} ${MKFLAGS} -f Makefile.f4 TARGET_HW=THE_PEACH_R1 LINKER_FILE=stm32f4.ld TARGET_FILE_NAME=$@

# Default bootloader delay is *very* short, just long enough to catch
# the board for recovery but not so long as to make restarting after a
# brownout problematic.
Expand Down
114 changes: 113 additions & 1 deletion hw_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,118 @@
# define SERIAL_BREAK_DETECT_DISABLED 1
# undef USE_VBUS_PULL_DOWN

/****************************************************************************
* TARGET_HW_THE_PEACH_K1
****************************************************************************/

#elif defined(TARGET_HW_THE_PEACH_K1)

# define APP_LOAD_ADDRESS 0x08004000
# define BOOTLOADER_DELAY 5000
# define BOARD_FMUV2
# define INTERFACE_USB 1
# define INTERFACE_USART 1
# define USBDEVICESTRING "THE PEACH K1 BL .."
# define USBPRODUCTID 0x0001
# define USBVENDORID 0x35a7
# define BOOT_DELAY_ADDRESS 0x000001a0

# define BOARD_TYPE 212
# define _FLASH_KBYTES (*(uint16_t *)0x1fff7a22)
# define BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23)
# define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024)

# define OSC_FREQ 24

# define BOARD_PIN_LED_ACTIVITY 0 // no activity LED
# define BOARD_PIN_LED_BOOTLOADER GPIO12
# define BOARD_PORT_LEDS GPIOE
# define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPEEN
# define BOARD_LED_ON gpio_clear
# define BOARD_LED_OFF gpio_set

# define BOARD_USART USART2
# define BOARD_USART_CLOCK_REGISTER RCC_APB1ENR
# define BOARD_USART_CLOCK_BIT RCC_APB1ENR_USART2EN

# define BOARD_PORT_USART GPIOD
# define BOARD_PORT_USART_AF GPIO_AF7
# define BOARD_PIN_TX GPIO5
# define BOARD_PIN_RX GPIO6
# define BOARD_USART_PIN_CLOCK_REGISTER RCC_AHB1ENR
# define BOARD_USART_PIN_CLOCK_BIT RCC_AHB1ENR_IOPDEN
# define SERIAL_BREAK_DETECT_DISABLED 1

/*
* Uncommenting this allows to force the bootloader through
* a PWM output pin. As this can accidentally initialize
* an ESC prematurely, it is not recommended. This feature
* has not been used and hence defaults now to off.
*
* # define BOARD_FORCE_BL_PIN_OUT GPIO14
* # define BOARD_FORCE_BL_PIN_IN GPIO11
* # define BOARD_FORCE_BL_PORT GPIOE
* # define BOARD_FORCE_BL_CLOCK_REGISTER RCC_AHB1ENR
* # define BOARD_FORCE_BL_CLOCK_BIT RCC_AHB1ENR_IOPEEN
* # define BOARD_FORCE_BL_PULL GPIO_PUPD_PULLUP
*/

/****************************************************************************
* TARGET_HW_THE_PEACH_R1
****************************************************************************/

#elif defined(TARGET_HW_THE_PEACH_R1)

# define APP_LOAD_ADDRESS 0x08004000
# define BOOTLOADER_DELAY 5000
# define BOARD_FMUV2
# define INTERFACE_USB 1
# define INTERFACE_USART 1
# define USBDEVICESTRING "THE PEACH R1 BL .."
# define USBPRODUCTID 0x0002
# define USBVENDORID 0x35a7
# define BOOT_DELAY_ADDRESS 0x000001a0

# define BOARD_TYPE 213
# define _FLASH_KBYTES (*(uint16_t *)0x1fff7a22)
# define BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23)
# define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024)

# define OSC_FREQ 24

# define BOARD_PIN_LED_ACTIVITY 0 // no activity LED
# define BOARD_PIN_LED_BOOTLOADER GPIO12
# define BOARD_PORT_LEDS GPIOE
# define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPEEN
# define BOARD_LED_ON gpio_clear
# define BOARD_LED_OFF gpio_set

# define BOARD_USART USART2
# define BOARD_USART_CLOCK_REGISTER RCC_APB1ENR
# define BOARD_USART_CLOCK_BIT RCC_APB1ENR_USART2EN

# define BOARD_PORT_USART GPIOD
# define BOARD_PORT_USART_AF GPIO_AF7
# define BOARD_PIN_TX GPIO5
# define BOARD_PIN_RX GPIO6
# define BOARD_USART_PIN_CLOCK_REGISTER RCC_AHB1ENR
# define BOARD_USART_PIN_CLOCK_BIT RCC_AHB1ENR_IOPDEN
# define SERIAL_BREAK_DETECT_DISABLED 1

/*
* Uncommenting this allows to force the bootloader through
* a PWM output pin. As this can accidentally initialize
* an ESC prematurely, it is not recommended. This feature
* has not been used and hence defaults now to off.
*
* # define BOARD_FORCE_BL_PIN_OUT GPIO14
* # define BOARD_FORCE_BL_PIN_IN GPIO11
* # define BOARD_FORCE_BL_PORT GPIOE
* # define BOARD_FORCE_BL_CLOCK_REGISTER RCC_AHB1ENR
* # define BOARD_FORCE_BL_CLOCK_BIT RCC_AHB1ENR_IOPEEN
* # define BOARD_FORCE_BL_PULL GPIO_PUPD_PULLUP
*/

#else
# error Undefined Target Hardware
#endif
Expand Down Expand Up @@ -1538,4 +1650,4 @@
# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV
#endif

#endif /* HW_CONFIG_H_ */
#endif /* HW_CONFIG_H_ */

0 comments on commit b859d47

Please sign in to comment.