Browse Source

HAL_ChibiOS: support bootloaders with no uarts

mission-4.1.18
Andrew Tridgell 7 years ago
parent
commit
f71d2a7417
  1. 10
      libraries/AP_HAL_ChibiOS/hwdef/cube-orange/hwdef-bl.dat
  2. 11
      libraries/AP_HAL_ChibiOS/hwdef/fmuv5/hwdef-bl.dat
  3. 5
      libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py

10
libraries/AP_HAL_ChibiOS/hwdef/cube-orange/hwdef-bl.dat

@ -31,7 +31,15 @@ USB_STRING_PRODUCT "ProfiCNC CUBE Orange BL" @@ -31,7 +31,15 @@ USB_STRING_PRODUCT "ProfiCNC CUBE Orange BL"
USB_STRING_SERIAL "%SERIAL%"
# order of UARTs (and USB)
UART_ORDER OTG1
UART_ORDER OTG1 USART2 UART7
PD5 USART2_TX USART2
PD6 USART2_RX USART2
PD3 USART2_CTS USART2
PD4 USART2_RTS USART2
PE7 UART7_RX UART7
PE8 UART7_TX UART7
# now we define the pins that USB is connected on
PA11 OTG_FS_DM OTG1

11
libraries/AP_HAL_ChibiOS/hwdef/fmuv5/hwdef-bl.dat

@ -34,7 +34,16 @@ define HAL_LED_ON 0 @@ -34,7 +34,16 @@ define HAL_LED_ON 0
STM32_VDD 330U
# order of UARTs (and USB)
UART_ORDER OTG1
UART_ORDER OTG1 USART2 UART7
# USART2 is telem1
PD6 USART2_RX USART2
PD5 USART2_TX USART2
PD3 USART2_CTS USART2
PD4 USART2_RTS USART2
PF6 UART7_RX UART7 NODMA
PE8 UART7_TX UART7 NODMA
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1

5
libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py

@ -446,7 +446,6 @@ def write_mcu_config(f): @@ -446,7 +446,6 @@ def write_mcu_config(f):
#define HAL_NO_PRINTF
#define HAL_NO_CCM
#define CH_DBG_STATISTICS FALSE
#define SERIAL_ADVANCED_BUFFERING_SUPPORT FALSE
#define CH_CFG_USE_TM FALSE
#define CH_CFG_USE_REGISTRY FALSE
#define CH_CFG_USE_WAITEXIT FALSE
@ -655,13 +654,17 @@ def write_UART_config_bootloader(f): @@ -655,13 +654,17 @@ def write_UART_config_bootloader(f):
uart_list = config['UART_ORDER']
f.write('\n// UART configuration\n')
devlist = []
have_uart = False
for u in uart_list:
if u.startswith('OTG'):
devlist.append('(BaseChannel *)&SDU1')
else:
unum = int(u[-1])
devlist.append('(BaseChannel *)&SD%u' % unum)
have_uart = True
f.write('#define BOOTLOADER_DEV_LIST %s\n' % ','.join(devlist))
if not have_uart:
f.write('#define HAL_USE_SERIAL FALSE\n')
def write_I2C_config(f):
'''write I2C config defines'''

Loading…
Cancel
Save