123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095 |
- /*
- * hw_config.h
- *
- * Created on: May 17, 2015
- * Author: david_s5
- */
- #ifndef HW_CONFIG_H_
- #define HW_CONFIG_H_
- /****************************************************************************
- * 10-8--2016:
- * To simplify the ripple effect on the tools, we will be using
- * /dev/serial/by-id/<asterisk>PX4<asterisk> to locate PX4 devices. Therefore
- * moving forward all Bootloaders must contain the prefix "PX4 BL "
- * in the USBDEVICESTRING
- * This Change will be made in an upcoming BL release
- ****************************************************************************/
- /*
- * Define usage to configure a bootloader
- *
- *
- * Constant example Usage
- * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed
- * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request
- * BOARD_FMUV2
- * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading
- * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading
- * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string
- * USBPRODUCTID 0x0011 - PID Should match defconfig
- * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom
- * delay provided by an APP FW
- * BOARD_TYPE 9 - Must match .prototype boad_id
- * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection
- * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector
- * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector
- * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time.
- * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted
- * programmatically
- *
- * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing.
- * This is to allow sectors to be reserved for app fw usage. That will NOT be erased
- * during a FW upgrade.
- * The default is 0, and selects the first sector to be erased, as the 0th entry in the
- * flash_sectors table. Which is the second physical sector of FLASH in the device.
- * The first physical sector of FLASH is used by the bootloader, and is not defined
- * in the table.
- *
- * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus
- * BOOTLOADER_RESERVATION_SIZE will be deducted from
- * BOARD_FLASH_SIZE to determine the size of the App FW
- * and hence the address space of FLASH to erase and program.
- * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.)
- * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL
- *
- * * Other defines are somewhat self explanatory.
- */
- /* Boot device selection list*/
- #define USB0_DEV 0x01
- #define SERIAL0_DEV 0x02
- #define SERIAL1_DEV 0x04
- #if defined(TARGET_HW_PX4_FMU_V1)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_FMU
- # define INTERFACE_USB 1
- # define INTERFACE_USART 1
- # define USBDEVICESTRING "PX4 BL FMU v1.x"
- # define USBPRODUCTID 0x0010
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 5
- # define BOARD_FLASH_SECTORS 11
- # define BOARD_FLASH_SIZE (1024 * 1024)
- # define OSC_FREQ 24
- # define BOARD_PIN_LED_ACTIVITY GPIO15
- # define BOARD_PIN_LED_BOOTLOADER GPIO14
- # define BOARD_PORT_LEDS GPIOB
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPBEN
- # define BOARD_LED_ON gpio_clear
- # define BOARD_LED_OFF gpio_set
- # define BOARD_USART USART1
- # define BOARD_USART_CLOCK_REGISTER RCC_APB2ENR
- # define BOARD_USART_CLOCK_BIT RCC_APB2ENR_USART1EN
- # define BOARD_PORT_USART GPIOB
- # define BOARD_PORT_USART_AF GPIO_AF7
- # define BOARD_PIN_TX GPIO6
- # define BOARD_PIN_RX GPIO7
- # define BOARD_USART_PIN_CLOCK_REGISTER RCC_AHB1ENR
- # define BOARD_USART_PIN_CLOCK_BIT RCC_AHB1ENR_IOPBEN
- # define SERIAL_BREAK_DETECT_DISABLED 1
- /*
- * Uncommenting this allows to force the bootloader through
- * the PPM-in pin. Some receivers pull their PPM output low
- * when the transmitter is off, resulting in a stuck bootup,
- * so this feature is best disabled.
- *
- * # define BOARD_FORCE_BL_PIN GPIO10
- * # define BOARD_FORCE_BL_PORT GPIOA
- * # define BOARD_FORCE_BL_CLOCK_REGISTER RCC_AHB1ENR
- * # define BOARD_FORCE_BL_CLOCK_BIT RCC_AHB1ENR_IOPAEN
- * # define BOARD_FORCE_BL_PULL GPIO_PUPD_PULLUP
- * # define BOARD_FORCE_BL_STATE 0
- */
- /****************************************************************************
- * TARGET_HW_PX4_FMU_V2
- ****************************************************************************/
- #elif defined(TARGET_HW_PX4_FMU_V2)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_FMUV2
- # define INTERFACE_USB 1
- # define INTERFACE_USART 1
- # define USBDEVICESTRING "PX4 BL FMU v2.x"
- # define USBPRODUCTID 0x0011
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 9
- # 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_PX4_FMU_V3
- ****************************************************************************/
- #elif defined(TARGET_HW_PX4_FMU_V3)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_FMUV2
- # define INTERFACE_USB 1
- # define INTERFACE_USART 1
- # define USBDEVICESTRING "PX4 BL FMU v3.x"
- # define USBPRODUCTID 0x0011
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 9
- # 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_PX4_FMU_V4
- ****************************************************************************/
- #elif defined(TARGET_HW_PX4_FMU_V4)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_FMUV2
- # define INTERFACE_USB 1
- # define INTERFACE_USART 1
- # define USBDEVICESTRING "PX4 BL FMU v4.x"
- # define USBPRODUCTID 0x0012
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 11
- # 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 GPIO3
- # define BOARD_PIN_LED_BOOTLOADER GPIO11|GPIO1
- # define BOARD_PORT_LEDS GPIOB
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPBEN
- # define BOARD_LED_ON gpio_clear
- # define BOARD_LED_OFF gpio_set
- # define BOARD_USART USART1
- # define BOARD_USART_CLOCK_REGISTER RCC_APB2ENR
- # define BOARD_USART_CLOCK_BIT RCC_APB2ENR_USART1EN
- # define BOARD_PORT_USART GPIOB
- # define BOARD_PORT_USART_AF GPIO_AF7
- # define BOARD_PIN_TX GPIO6
- # define BOARD_PIN_RX GPIO7
- # define BOARD_USART_PIN_CLOCK_REGISTER RCC_AHB1ENR
- # define BOARD_USART_PIN_CLOCK_BIT RCC_AHB1ENR_IOPBEN
- # 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_PX4_FMU_V4_PRO
- ****************************************************************************/
- #elif defined(TARGET_HW_PX4_FMU_V4_PRO)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_FMUV2
- # define INTERFACE_USB 1
- # define INTERFACE_USART 1
- # define USBDEVICESTRING "PX4 BL FMU v4.x PRO"
- # define USBPRODUCTID 0x0013
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 13
- # 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 GPIO3
- # define BOARD_PIN_LED_BOOTLOADER GPIO11|GPIO1
- # define BOARD_PORT_LEDS GPIOB
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPBEN
- # 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_PX4_FMU_V5
- ****************************************************************************/
- #elif defined(TARGET_HW_PX4_FMU_V5)
- # define APP_LOAD_ADDRESS 0x08008000
- # define BOOTLOADER_DELAY 5000
- # define INTERFACE_USB 1
- # define INTERFACE_USART 1
- # define USBDEVICESTRING "PX4 BL FMU v5.x"
- # define USBPRODUCTID 0x0032
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 50
- # 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 GPIO7 // BLUE
- # define BOARD_PIN_LED_BOOTLOADER GPIO6 // GREEN
- # define BOARD_PORT_LEDS GPIOC
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_GPIOCEN
- # 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_GPIODEN
- # 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_MINDPX_V2
- ****************************************************************************/
- #elif defined(TARGET_HW_MINDPX_V2)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_FMUV2
- # define INTERFACE_USB 1
- # define INTERFACE_USART 1
- # define USBDEVICESTRING "MindPX BL FMU v2.x"
- # define USBPRODUCTID 0x0030
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 88
- # 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 8
- # define BOARD_PIN_LED_ACTIVITY 0 // no activity LED
- # define BOARD_PIN_LED_BOOTLOADER GPIO8
- # define BOARD_PORT_LEDS GPIOA
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPAEN
- # 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_PX4_FLOW_V1
- ****************************************************************************/
- #elif defined(TARGET_HW_PX4_FLOW_V1)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_FLOW
- # define INTERFACE_USB 1
- # define INTERFACE_USART 0
- # define USBDEVICESTRING "PX4 BL FLOW v1.3"
- # define USBPRODUCTID 0x0015
- # define BOARD_TYPE 6
- # define BOARD_FLASH_SECTORS 11
- # define BOARD_FLASH_SIZE (1024 * 1024)
- # define OSC_FREQ 24
- # define BOARD_PIN_LED_ACTIVITY GPIO3
- # define BOARD_PIN_LED_BOOTLOADER GPIO2
- # define BOARD_PORT_LEDS GPIOE
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPEEN
- # define BOARD_LED_ON gpio_clear
- # define BOARD_LED_OFF gpio_set
- /****************************************************************************
- * TARGET_HW_PX4_DISCOVERY_V1
- ****************************************************************************/
- #elif defined(TARGET_HW_PX4_DISCOVERY_V1)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_DISCOVERY
- # define INTERFACE_USB 1
- # define INTERFACE_USART 0
- # define USBDEVICESTRING "PX4 BL DISCOVERY"
- # define USBPRODUCTID 0x0001
- # define BOARD_TYPE 99
- # define BOARD_FLASH_SECTORS 11
- # define BOARD_FLASH_SIZE (1024 * 1024)
- # define OSC_FREQ 8
- # define BOARD_PIN_LED_ACTIVITY GPIO12
- # define BOARD_PIN_LED_BOOTLOADER GPIO13
- # define BOARD_PORT_LEDS GPIOD
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPDEN
- # define BOARD_LED_ON gpio_set
- # define BOARD_LED_OFF gpio_clear
- /****************************************************************************
- * TARGET_HW_PX4_PIO_V1 or TARGET_HW_PX4_PIO_V2
- ****************************************************************************/
- #elif defined(TARGET_HW_PX4_PIO_V1) || defined(TARGET_HW_PX4_PIO_V2)
- # define APP_LOAD_ADDRESS 0x08001000
- # define APP_SIZE_MAX 0xf000
- # define BOOTLOADER_DELAY 200
- # define BOARD_PIO
- # define INTERFACE_USB 0
- # define INTERFACE_USART 1
- # define USBDEVICESTRING ""
- # define USBPRODUCTID -1
- # define OSC_FREQ 24
- # define BOARD_PIN_LED_ACTIVITY GPIO14
- # define BOARD_PIN_LED_BOOTLOADER GPIO15
- # define BOARD_PORT_LEDS GPIOB
- # define BOARD_CLOCK_LEDS_REGISTER RCC_APB2ENR
- # define BOARD_CLOCK_LEDS RCC_APB2ENR_IOPBEN
- # 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 GPIOA
- # define BOARD_PIN_TX GPIO_USART2_TX
- # define BOARD_PIN_RX GPIO_USART2_RX
- # define BOARD_USART_PIN_CLOCK_REGISTER RCC_APB2ENR
- # define BOARD_USART_PIN_CLOCK_BIT RCC_APB2ENR_IOPAEN
- # define BOARD_FORCE_BL_PIN GPIO5
- # define BOARD_FORCE_BL_PORT GPIOB
- # define BOARD_FORCE_BL_CLOCK_REGISTER RCC_APB2ENR
- # define BOARD_FORCE_BL_CLOCK_BIT RCC_APB2ENR_IOPBEN
- # define BOARD_FORCE_BL_PULL GPIO_CNF_INPUT_FLOAT // depend on external pull
- # define BOARD_FORCE_BL_VALUE BOARD_FORCE_BL_PIN
- # define BOARD_FLASH_SECTORS 60
- # define BOARD_TYPE 10
- # define FLASH_SECTOR_SIZE 0x400
- /****************************************************************************
- * TARGET_HW_PX4_PIO_V3
- ****************************************************************************/
- #elif defined(TARGET_HW_PX4_PIO_V3)
- # define APP_LOAD_ADDRESS 0x08001000
- # define APP_SIZE_MAX 0x3f000
- # define BOOTLOADER_DELAY 200
- # define BOARD_PIO
- # define INTERFACE_USB 0
- # define INTERFACE_USART 1
- # define USBDEVICESTRING ""
- # define USBPRODUCTID -1
- # define OSC_FREQ 24
- # define BOARD_PIN_LED_ACTIVITY 0
- # define BOARD_PIN_LED_BOOTLOADER GPIO13
- # define BOARD_PORT_LEDS GPIOB
- # define BOARD_CLOCK_LEDS_REGISTER RCC_AHBENR
- # define BOARD_CLOCK_LEDS RCC_AHBENR_IOPBEN
- # 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 GPIOA
- # define BOARD_PORT_USART_AF GPIO_AF7
- # define BOARD_PIN_TX GPIO2
- # define BOARD_PIN_RX GPIO3
- # define BOARD_USART_PIN_CLOCK_REGISTER RCC_AHBENR
- # define BOARD_USART_PIN_CLOCK_BIT RCC_AHBENR_IOPAEN
- # define BOARD_FORCE_BL_PIN GPIO5
- # define BOARD_FORCE_BL_PORT GPIOB
- # define BOARD_FORCE_BL_CLOCK_REGISTER RCC_AHBENR
- # define BOARD_FORCE_BL_CLOCK_BIT RCC_AHBENR_IOPBEN
- # define BOARD_FORCE_BL_PULL GPIO_PUPD_NONE // depend on external pull
- # define BOARD_FORCE_BL_VALUE BOARD_FORCE_BL_PIN
- # define BOARD_FLASH_SECTORS (128-4) /* application #sec - bootloader - sec */
- # define BOARD_TYPE 13
- # define FLASH_SECTOR_SIZE 0x800
- /****************************************************************************
- * TARGET_HW_PX4_AEROCORE_V1
- ****************************************************************************/
- #elif defined(TARGET_HW_PX4_AEROCORE_V1)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_AEROCORE
- # define INTERFACE_USB 1
- # define INTERFACE_USART 0
- # define USBDEVICESTRING "Gumstix BL AEROCORE"
- # define USBPRODUCTID 0x1001
- # define BOARD_TYPE 98
- # define BOARD_FLASH_SECTORS 23
- # define BOARD_FLASH_SIZE (2048 * 1024)
- # define OSC_FREQ 24
- # define BOARD_PIN_LED_ACTIVITY GPIO10 // Yellow
- # define BOARD_PIN_LED_BOOTLOADER GPIO9 // Blue
- # 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_FORCE_BL_PIN_OUT GPIO0 // J11 header, pin 1
- # define BOARD_FORCE_BL_PIN_IN GPIO1 // J11 header, pin 3
- # define BOARD_FORCE_BL_PORT GPIOB
- # define BOARD_FORCE_BL_CLOCK_REGISTER RCC_AHB1ENR
- # define BOARD_FORCE_BL_CLOCK_BIT RCC_AHB1ENR_IOPBEN
- # define BOARD_FORCE_BL_PULL GPIO_PUPD_PULLUP
- /****************************************************************************
- * TARGET_HW_TAP_V1
- ****************************************************************************/
- #elif defined(TARGET_HW_TAP_V1)
- # define APP_LOAD_ADDRESS 0x0800C000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_TAP
- # define INTERFACE_USB 1
- # define INTERFACE_USART 1
- # define USBDEVICESTRING "PX4 BL TAP v1.x"
- # define USBPRODUCTID 0x0040
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 64
- # define BOARD_FLASH_SECTORS 11
- # define BOARD_FLASH_SIZE (1024 * 1024)
- # define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2
- # define APP_RESERVATION_SIZE (2 * 16 * 1024) /* 2 16 Kib Sectors */
- # define OSC_FREQ 16
- # define BOARD_USART USART2
- # define BOARD_USART_CLOCK_REGISTER RCC_APB1ENR
- # define BOARD_USART_CLOCK_BIT RCC_APB1ENR_USART2EN
- # define BOARD_PORT_USART GPIOA
- # define BOARD_PORT_USART_AF GPIO_AF7
- # define BOARD_PIN_TX GPIO2
- # define BOARD_PIN_RX GPIO3
- # define BOARD_USART_PIN_CLOCK_REGISTER RCC_AHB1ENR
- # define BOARD_USART_PIN_CLOCK_BIT RCC_AHB1ENR_IOPAEN
- # define BOARD_PIN_LED_ACTIVITY GPIO4
- # define BOARD_PIN_LED_BOOTLOADER GPIO5
- # define BOARD_PORT_LEDS GPIOC
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPCEN
- # define BOARD_LED_ON gpio_clear
- # define BOARD_LED_OFF gpio_set
- # define BOARD_POWER_PIN_OUT GPIO4
- # define BOARD_POWER_PORT GPIOA
- # define BOARD_POWER_CLOCK_REGISTER RCC_AHB1ENR
- # define BOARD_POWER_CLOCK_BIT RCC_AHB1ENR_IOPAEN
- # define BOARD_POWER_ON gpio_set
- # define BOARD_POWER_OFF gpio_clear
- # undef BOARD_POWER_PIN_RELEASE /* Leave pin enabling Power - un comment to release (disable power)*/
- # define USBMFGSTRING "The Autopilot"
- # define USB_FORCE_DISCONNECT 1
- #define SERIAL_BREAK_DETECT_DISABLED 1
- /****************************************************************************
- * TARGET_HW_CRAZYFLIE
- ****************************************************************************/
- #elif defined(TARGET_HW_CRAZYFLIE)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_CRAZYFLIE
- # define INTERFACE_USB 1
- # define INTERFACE_USART 0
- # define USBDEVICESTRING "Crazyflie BL"
- # define USBPRODUCTID 0x0016
- # define BOARD_TYPE 12
- # define BOARD_FLASH_SECTORS 11
- # define BOARD_FLASH_SIZE (1024 * 1024)
- # define OSC_FREQ 8
- # define BOARD_PIN_LED_ACTIVITY GPIO0
- # define BOARD_PIN_LED_BOOTLOADER GPIO2
- # define BOARD_PORT_LEDS GPIOC
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPCEN
- # define BOARD_LED_ON gpio_clear
- # define BOARD_LED_OFF gpio_set
- # define BOARD_USB_VBUS_SENSE_DISABLED
- # define USBMFGSTRING "Bitcraze AB"
- /****************************************************************************
- * TARGET_HW_OMNIBUS_NXT
- ****************************************************************************/
- #elif defined(TARGET_HW_OMNIBUSF4SD)
- # define APP_LOAD_ADDRESS 0x08008000
- # define BOOTLOADER_DELAY 5000
- # define INTERFACE_USB 1
- # define INTERFACE_USART 0
- # define USBDEVICESTRING "PX4 OmnibusF4SD"
- # define USBPRODUCTID 0x0016
- # define BOARD_TYPE 42
- # define BOARD_FLASH_SECTORS 11
- # define BOARD_FLASH_SIZE (1024 * 1024)
- # define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1
- # define APP_RESERVATION_SIZE (1 * 16 * 1024) /* 1 16 Kib Sectors */
- # define OSC_FREQ 8
- # define BOARD_PIN_LED_ACTIVITY GPIO5
- # define BOARD_PIN_LED_BOOTLOADER GPIO4
- # define BOARD_PORT_LEDS GPIOB
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_IOPBEN
- # define BOARD_LED_ON gpio_clear
- # define BOARD_LED_OFF gpio_set
- # define BOARD_USB_VBUS_SENSE_DISABLED
- # define USBMFGSTRING "Vertile"
- /****************************************************************************
- * TARGET_HW_KAKUTEF7
- ****************************************************************************/
- #elif defined(TARGET_HW_KAKUTEF7)
- # define APP_LOAD_ADDRESS 0x08018000
- # define BOOTLOADER_DELAY 5000
- # define INTERFACE_USB 1
- # define INTERFACE_USART 0
- # define USBDEVICESTRING "PX4 KakuteF7"
- # define USBPRODUCTID 0x0016
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 123
- # define BOARD_FLASH_SECTORS 7
- # define BOARD_FLASH_SIZE (1024 * 1024)
- # define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2
- # define APP_RESERVATION_SIZE (2 * 32 * 1024) /* 2 32 Kib Sectors */
- # define OSC_FREQ 8
- # define BOARD_PIN_LED_ACTIVITY 0
- # define BOARD_PIN_LED_BOOTLOADER GPIO2 // BLUE
- # define BOARD_PORT_LEDS GPIOA
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_GPIOAEN
- # define BOARD_LED_ON gpio_clear
- # define BOARD_LED_OFF gpio_set
- # define USBMFGSTRING "Holybro"
- // VBUS sense is connected to PA8 instead of PA9
- # define BOARD_USB_VBUS_SENSE_DISABLED
- # define BOARD_PORT_VBUS GPIOA
- # define BOARD_PIN_VBUS GPIO8
- # define BOARD_USART USART3 // labeled as UART3
- # define BOARD_USART_CLOCK_REGISTER RCC_APB1ENR
- # define BOARD_USART_CLOCK_BIT RCC_APB1ENR_USART3EN
- # define BOARD_PORT_USART GPIOB
- # define BOARD_PORT_USART_AF GPIO_AF7
- # define BOARD_PIN_TX GPIO10
- # define BOARD_PIN_RX GPIO11
- # define BOARD_USART_PIN_CLOCK_REGISTER RCC_AHB1ENR
- # define BOARD_USART_PIN_CLOCK_BIT RCC_AHB1ENR_GPIOBEN
- # define SERIAL_BREAK_DETECT_DISABLED 1
- /****************************************************************************
- * TARGET_HW_AUAV_X2V1
- ****************************************************************************/
- #elif defined(TARGET_HW_AUAV_X2V1)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_FMUV2
- # define INTERFACE_USB 1
- # define INTERFACE_USART 1
- # define USBDEVICESTRING "PX4 BL AUAV X2.1"
- # define USBPRODUCTID 0x0021
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 33
- # 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
- */
- # define USBMFGSTRING "AUAV"
- /****************************************************************************
- * TARGET_HW_PX4_AEROFC_V1
- ****************************************************************************/
- #elif defined(TARGET_HW_AEROFC_V1)
- # define APP_LOAD_ADDRESS 0x0800C000
- # define BOOTLOADER_DELAY 5000
- # define INTERFACE_USB 0
- # define USBDEVICESTRING ""
- # define USBPRODUCTID 0
- # define INTERFACE_USART 1
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 65
- # define BOARD_FLASH_SECTORS 11
- # define BOARD_FLASH_SIZE (1024 * 1024)
- # define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2
- # define APP_RESERVATION_SIZE (2 * 16 * 1024) /* 2 16 Kib Sectors */
- # define OSC_FREQ 16
- # define BOARD_PIN_LED_ACTIVITY GPIO12
- # define BOARD_PIN_LED_BOOTLOADER GPIO9 | GPIO10 | GPIO11 | GPIO13 | GPIO14 | GPIO15
- # 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 GPIOA
- # define BOARD_PORT_USART_AF GPIO_AF7
- # define BOARD_PIN_TX GPIO2
- # define BOARD_PIN_RX GPIO3
- # define BOARD_USART_PIN_CLOCK_REGISTER RCC_AHB1ENR
- # define BOARD_USART_PIN_CLOCK_BIT RCC_AHB1ENR_IOPAEN
- # define BOARD_FORCE_BL_PIN GPIO11
- # define BOARD_FORCE_BL_PORT GPIOA
- # define BOARD_FORCE_BL_CLOCK_REGISTER RCC_AHB1ENR
- # define BOARD_FORCE_BL_CLOCK_BIT RCC_AHB1ENR_IOPAEN
- # define BOARD_FORCE_BL_PULL GPIO_PUPD_PULLDOWN
- # define BOARD_FORCE_BL_STATE 1
- /****************************************************************************
- * TARGET_HW_FMUK66_V3
- ****************************************************************************/
- #elif defined(TARGET_HW_FMUK66_V3)
- # define APP_LOAD_ADDRESS 0x00006000 // Reserve 24K for BL
- # define BOOTLOADER_DELAY 5000
- # define BOARD_NXPHLITEV3
- # define INTERFACE_USB 1
- # define INTERFACE_USART 0
- # define USBDEVICESTRING "PX4 BL FMUK66 v3.x"
- # define USBPRODUCTID 0x001c
- # define USBVENDORID 0x1fc9
- # define BOARD_TYPE 28
- # define _FLASH_KBYTES 2048
- # define FLASH_SECTOR_SIZE 4096
- # define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024)
- # define BOARD_FLASH_SECTORS ((BOARD_FLASH_SIZE / FLASH_SECTOR_SIZE)- \
- (BOOTLOADER_RESERVATION_SIZE/FLASH_SECTOR_SIZE))
- # define OSC_FREQ 16
- # define BOARD_PIN_LED_ACTIVITY 14 // green LED
- # define BOARD_PIN_LED_BOOTLOADER 13 // Amber LED
- # define BOARD_PORT_LEDS D
- # define BOARD_LED_ON GPIO_ClearPinsOutput
- # define BOARD_LED_OFF GPIO_SetPinsOutput
- # define BOARD_USART 4
- # define BOARD_PORT_USART C
- # define BOARD_PORT_USART_AF kPORT_MuxAlt3
- # define BOARD_PIN_TX 15
- # define BOARD_PIN_RX 14
- # define BOARD_PORT_VBUS E
- # define BOARD_PIN_VBUS 8
- # define SERIAL_BREAK_DETECT_DISABLED 1
- # define USB_DATA_ALIGN __attribute__((aligned(2)))
- /****************************************************************************
- * TARGET_HW_CUBE_F4
- ****************************************************************************/
- #elif defined(TARGET_HW_CUBE_F4)
- # define APP_LOAD_ADDRESS 0x08004000
- # define BOOTLOADER_DELAY 5000
- # define BOARD_FMUV2
- # define INTERFACE_USB 1
- # define INTERFACE_USART 1
- # define USBDEVICESTRING "ProfiCNC CUBE F4 BL"
- # define USBPRODUCTID 0x0001
- # define USBMFGSTRING "Hex Technology Limited"
- # define USBVENDORID 0x2DAE
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 9
- # 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_AV_V1
- ****************************************************************************/
- #elif defined(TARGET_HW_AV_X_V1)
- # define APP_LOAD_ADDRESS 0x08008000
- # define BOOTLOADER_DELAY 5000
- # define INTERFACE_USB 0
- # define INTERFACE_USART 1
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 29
- # 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_USART UART8
- # define BOARD_USART_CLOCK_REGISTER RCC_APB1ENR
- # define BOARD_USART_CLOCK_BIT RCC_APB1ENR_UART8EN
- # define BOARD_PORT_USART GPIOE
- # define BOARD_PORT_USART_AF GPIO_AF7
- # define BOARD_PIN_TX GPIO1
- # define BOARD_PIN_RX GPIO0
- # define BOARD_USART_PIN_CLOCK_REGISTER RCC_AHB1ENR
- # define BOARD_USART_PIN_CLOCK_BIT RCC_AHB1ENR_GPIODEN
- # define SERIAL_BREAK_DETECT_DISABLED 1
- /****************************************************************************
- * TARGET_HW_SMARTAP_PRO
- ****************************************************************************/
- #elif defined(TARGET_HW_SMARTAP_PRO)
- # define APP_LOAD_ADDRESS 0x08008000
- # define BOOTLOADER_DELAY 5000
- # define INTERFACE_USB 1
- # define INTERFACE_USART 0
- # define USBDEVICESTRING "PX4 BL SmartAP PRO"
- # define USBPRODUCTID 0x0020
- # define BOOT_DELAY_ADDRESS 0x000001a0
- # define BOARD_TYPE 32
- # 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 8
- # define BOARD_PIN_LED_ACTIVITY GPIO3
- # define BOARD_PIN_LED_BOOTLOADER GPIO2
- # define BOARD_PORT_LEDS GPIOH
- # define BOARD_CLOCK_LEDS RCC_AHB1ENR_GPIOHEN
- # define BOARD_LED_ON gpio_set
- # define BOARD_LED_OFF gpio_clear
- #else
- # error Undefined Target Hardware
- #endif
- #if !defined(USBMFGSTRING)
- # define USBMFGSTRING "3D Robotics"
- #endif
- #if !defined(USBVENDORID)
- # define USBVENDORID 0x26AC
- #endif
- #if !defined(APP_RESERVATION_SIZE)
- # define APP_RESERVATION_SIZE 0
- #endif
- #if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE)
- # define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 0
- #endif
- #if defined(OVERRIDE_USART_BAUDRATE)
- # define USART_BAUDRATE OVERRIDE_USART_BAUDRATE
- #else
- # define USART_BAUDRATE 115200
- #endif
- #if INTERFACE_USART
- # if !defined(BOARD_PORT_USART_TX)
- # define BOARD_PORT_USART_TX BOARD_PORT_USART
- # define BOARD_PORT_USART_RX BOARD_PORT_USART
- # endif
- # if !defined(BOARD_USART_PIN_CLOCK_BIT_TX)
- # define BOARD_USART_PIN_CLOCK_BIT_TX BOARD_USART_PIN_CLOCK_BIT
- # define BOARD_USART_PIN_CLOCK_BIT_RX BOARD_USART_PIN_CLOCK_BIT
- # endif
- #endif
- #if !defined(USB_DATA_ALIGN)
- # define USB_DATA_ALIGN
- #endif
- #ifndef BOOT_DEVICES_SELECTION
- # define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV
- #endif
- #ifndef BOOT_DEVICES_FILTER_ONUSB
- # define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV
- #endif
- #endif /* HW_CONFIG_H_ */
|