diff options
| -rw-r--r-- | os/hal/boards/ST_NUCLEO144_F746ZG/board.c | 5 | ||||
| -rw-r--r-- | os/hal/boards/ST_NUCLEO144_F746ZG/board.h | 365 | ||||
| -rw-r--r-- | os/hal/boards/ST_NUCLEO144_F746ZG/cfg/board.chcfg | 3 | ||||
| -rw-r--r-- | os/hal/boards/ST_NUCLEO144_F767ZI/board.h | 2 | ||||
| -rw-r--r-- | os/hal/boards/ST_NUCLEO144_F767ZI/cfg/board.chcfg | 3 | ||||
| -rw-r--r-- | os/hal/boards/ST_STM32F746G_DISCOVERY/board.h | 2 | ||||
| -rw-r--r-- | os/hal/boards/ST_STM32F746G_DISCOVERY/cfg/board.chcfg | 3 | ||||
| -rw-r--r-- | os/hal/boards/ST_STM32F769I_DISCOVERY/board.h | 2 | ||||
| -rw-r--r-- | os/hal/boards/ST_STM32F769I_DISCOVERY/cfg/board.chcfg | 3 | ||||
| -rw-r--r-- | os/hal/ports/STM32/STM32F7xx/hal_lld.c | 4 | ||||
| -rw-r--r-- | os/hal/ports/STM32/STM32F7xx/hal_lld.h | 25 | 
11 files changed, 232 insertions, 185 deletions
diff --git a/os/hal/boards/ST_NUCLEO144_F746ZG/board.c b/os/hal/boards/ST_NUCLEO144_F746ZG/board.c index 89e8c2319..65b74d0c6 100644 --- a/os/hal/boards/ST_NUCLEO144_F746ZG/board.c +++ b/os/hal/boards/ST_NUCLEO144_F746ZG/board.c @@ -14,6 +14,11 @@      limitations under the License.
  */
 +/*
 + * This file has been automatically generated using ChibiStudio board
 + * generator plugin. Do not edit manually.
 + */
 +
  #include "hal.h"
  #if HAL_USE_PAL || defined(__DOXYGEN__)
 diff --git a/os/hal/boards/ST_NUCLEO144_F746ZG/board.h b/os/hal/boards/ST_NUCLEO144_F746ZG/board.h index 1314e7bbb..388c98986 100644 --- a/os/hal/boards/ST_NUCLEO144_F746ZG/board.h +++ b/os/hal/boards/ST_NUCLEO144_F746ZG/board.h @@ -14,8 +14,13 @@      limitations under the License.
  */
 -#ifndef _BOARD_H_
 -#define _BOARD_H_
 +/*
 + * This file has been automatically generated using ChibiStudio board
 + * generator plugin. Do not edit manually.
 + */
 +
 +#ifndef BOARD_H
 +#define BOARD_H
  /*
   * Setup for STMicroelectronics STM32 Nucleo144-F746ZG board.
 @@ -40,6 +45,8 @@  #define STM32_LSECLK                32768U
  #endif
 +#define STM32_LSEDRV                (3U << 3U)
 +
  #if !defined(STM32_HSECLK)
  #define STM32_HSECLK                8000000U
  #endif
 @@ -641,22 +648,22 @@                                       PIN_ODR_HIGH(GPIOA_SWDIO) |            \
                                       PIN_ODR_HIGH(GPIOA_SWCLK) |            \
                                       PIN_ODR_HIGH(GPIOA_ZIO_D20))
 -#define VAL_GPIOA_AFRL              (PIN_AFIO_AF(GPIOA_ZIO_D32, 0) |        \
 -                                     PIN_AFIO_AF(GPIOA_RMII_REF_CLK, 11) |  \
 -                                     PIN_AFIO_AF(GPIOA_RMII_MDIO, 11) |     \
 -                                     PIN_AFIO_AF(GPIOA_ARD_A0, 0) |         \
 -                                     PIN_AFIO_AF(GPIOA_ZIO_D24, 0) |        \
 -                                     PIN_AFIO_AF(GPIOA_ARD_D13, 0) |        \
 -                                     PIN_AFIO_AF(GPIOA_ARD_D12, 0) |        \
 -                                     PIN_AFIO_AF(GPIOA_ARD_D11, 11))
 -#define VAL_GPIOA_AFRH              (PIN_AFIO_AF(GPIOA_USB_SOF, 10) |       \
 -                                     PIN_AFIO_AF(GPIOA_USB_VBUS, 0) |       \
 -                                     PIN_AFIO_AF(GPIOA_USB_ID, 10) |        \
 -                                     PIN_AFIO_AF(GPIOA_USB_DM, 10) |        \
 -                                     PIN_AFIO_AF(GPIOA_USB_DP, 10) |        \
 -                                     PIN_AFIO_AF(GPIOA_SWDIO, 0) |          \
 -                                     PIN_AFIO_AF(GPIOA_SWCLK, 0) |          \
 -                                     PIN_AFIO_AF(GPIOA_ZIO_D20, 0))
 +#define VAL_GPIOA_AFRL              (PIN_AFIO_AF(GPIOA_ZIO_D32, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOA_RMII_REF_CLK, 11U) | \
 +                                     PIN_AFIO_AF(GPIOA_RMII_MDIO, 11U) |    \
 +                                     PIN_AFIO_AF(GPIOA_ARD_A0, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOA_ZIO_D24, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOA_ARD_D13, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOA_ARD_D12, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOA_ARD_D11, 11U))
 +#define VAL_GPIOA_AFRH              (PIN_AFIO_AF(GPIOA_USB_SOF, 10U) |      \
 +                                     PIN_AFIO_AF(GPIOA_USB_VBUS, 0U) |      \
 +                                     PIN_AFIO_AF(GPIOA_USB_ID, 10U) |       \
 +                                     PIN_AFIO_AF(GPIOA_USB_DM, 10U) |       \
 +                                     PIN_AFIO_AF(GPIOA_USB_DP, 10U) |       \
 +                                     PIN_AFIO_AF(GPIOA_SWDIO, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOA_SWCLK, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOA_ZIO_D20, 0U))
  /*
   * GPIOB setup:
 @@ -758,22 +765,22 @@                                       PIN_ODR_HIGH(GPIOB_ZIO_D18) |          \
                                       PIN_ODR_LOW(GPIOB_LED3) |              \
                                       PIN_ODR_HIGH(GPIOB_ZIO_D17))
 -#define VAL_GPIOB_AFRL              (PIN_AFIO_AF(GPIOB_ZIO_D33, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_A6, 0) |         \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_D27, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_D23, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_D25, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_D22, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_D26, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_LED2, 0))
 -#define VAL_GPIOB_AFRH              (PIN_AFIO_AF(GPIOB_ARD_D15, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_ARD_D14, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_D36, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_D35, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_D19, 0) |        \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_D18, 11) |       \
 -                                     PIN_AFIO_AF(GPIOB_LED3, 0) |           \
 -                                     PIN_AFIO_AF(GPIOB_ZIO_D17, 0))
 +#define VAL_GPIOB_AFRL              (PIN_AFIO_AF(GPIOB_ZIO_D33, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_A6, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_D27, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_D23, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_D25, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_D22, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_D26, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_LED2, 0U))
 +#define VAL_GPIOB_AFRH              (PIN_AFIO_AF(GPIOB_ARD_D15, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_ARD_D14, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_D36, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_D35, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_D19, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_D18, 11U) |      \
 +                                     PIN_AFIO_AF(GPIOB_LED3, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOB_ZIO_D17, 0U))
  /*
   * GPIOC setup:
 @@ -875,22 +882,22 @@                                       PIN_ODR_HIGH(GPIOC_BUTTON) |           \
                                       PIN_ODR_HIGH(GPIOC_OSC32_IN) |         \
                                       PIN_ODR_HIGH(GPIOC_OSC32_OUT))
 -#define VAL_GPIOC_AFRL              (PIN_AFIO_AF(GPIOC_ARD_A1, 0) |         \
 -                                     PIN_AFIO_AF(GPIOC_RMII_MDC, 11) |      \
 -                                     PIN_AFIO_AF(GPIOC_ZIO_A7, 0) |         \
 -                                     PIN_AFIO_AF(GPIOC_ARD_A2, 0) |         \
 -                                     PIN_AFIO_AF(GPIOC_RMII_RXD0, 11) |     \
 -                                     PIN_AFIO_AF(GPIOC_RMII_RXD1, 11) |     \
 -                                     PIN_AFIO_AF(GPIOC_ZIO_D16, 0) |        \
 -                                     PIN_AFIO_AF(GPIOC_ZIO_D21, 0))
 -#define VAL_GPIOC_AFRH              (PIN_AFIO_AF(GPIOC_ZIO_D43, 0) |        \
 -                                     PIN_AFIO_AF(GPIOC_ZIO_D44, 0) |        \
 -                                     PIN_AFIO_AF(GPIOC_ZIO_D45, 0) |        \
 -                                     PIN_AFIO_AF(GPIOC_ZIO_D46, 0) |        \
 -                                     PIN_AFIO_AF(GPIOC_ZIO_D47, 0) |        \
 -                                     PIN_AFIO_AF(GPIOC_BUTTON, 0) |         \
 -                                     PIN_AFIO_AF(GPIOC_OSC32_IN, 0) |       \
 -                                     PIN_AFIO_AF(GPIOC_OSC32_OUT, 0))
 +#define VAL_GPIOC_AFRL              (PIN_AFIO_AF(GPIOC_ARD_A1, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOC_RMII_MDC, 11U) |     \
 +                                     PIN_AFIO_AF(GPIOC_ZIO_A7, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOC_ARD_A2, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOC_RMII_RXD0, 11U) |    \
 +                                     PIN_AFIO_AF(GPIOC_RMII_RXD1, 11U) |    \
 +                                     PIN_AFIO_AF(GPIOC_ZIO_D16, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOC_ZIO_D21, 0U))
 +#define VAL_GPIOC_AFRH              (PIN_AFIO_AF(GPIOC_ZIO_D43, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOC_ZIO_D44, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOC_ZIO_D45, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOC_ZIO_D46, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOC_ZIO_D47, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOC_BUTTON, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) |      \
 +                                     PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
  /*
   * GPIOD setup:
 @@ -992,22 +999,22 @@                                       PIN_ODR_HIGH(GPIOD_ZIO_D28) |          \
                                       PIN_ODR_HIGH(GPIOD_ARD_D10) |          \
                                       PIN_ODR_HIGH(GPIOD_ARD_D9))
 -#define VAL_GPIOD_AFRL              (PIN_AFIO_AF(GPIOD_ZIO_D67, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ZIO_D66, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ZIO_D48, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ZIO_D55, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ZIO_D54, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ZIO_D53, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ZIO_D52, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ZIO_D51, 0))
 -#define VAL_GPIOD_AFRH              (PIN_AFIO_AF(GPIOD_USART3_RX, 7) |      \
 -                                     PIN_AFIO_AF(GPIOD_USART3_TX, 7) |      \
 -                                     PIN_AFIO_AF(GPIOD_PIN10, 0) |          \
 -                                     PIN_AFIO_AF(GPIOD_ZIO_D30, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ZIO_D29, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ZIO_D28, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ARD_D10, 0) |        \
 -                                     PIN_AFIO_AF(GPIOD_ARD_D9, 0))
 +#define VAL_GPIOD_AFRL              (PIN_AFIO_AF(GPIOD_ZIO_D67, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ZIO_D66, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ZIO_D48, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ZIO_D55, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ZIO_D54, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ZIO_D53, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ZIO_D52, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ZIO_D51, 0U))
 +#define VAL_GPIOD_AFRH              (PIN_AFIO_AF(GPIOD_USART3_RX, 7U) |     \
 +                                     PIN_AFIO_AF(GPIOD_USART3_TX, 7U) |     \
 +                                     PIN_AFIO_AF(GPIOD_PIN10, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOD_ZIO_D30, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ZIO_D29, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ZIO_D28, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ARD_D10, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOD_ARD_D9, 0U))
  /*
   * GPIOE setup:
 @@ -1109,22 +1116,22 @@                                       PIN_ODR_HIGH(GPIOE_ARD_D3) |           \
                                       PIN_ODR_HIGH(GPIOE_ZIO_D38) |          \
                                       PIN_ODR_HIGH(GPIOE_ZIO_D37))
 -#define VAL_GPIOE_AFRL              (PIN_AFIO_AF(GPIOE_ZIO_D34, 0) |        \
 -                                     PIN_AFIO_AF(GPIOE_PIN1, 0) |           \
 -                                     PIN_AFIO_AF(GPIOE_ZIO_D31, 0) |        \
 -                                     PIN_AFIO_AF(GPIOE_ZIO_D60, 0) |        \
 -                                     PIN_AFIO_AF(GPIOE_ZIO_D57, 0) |        \
 -                                     PIN_AFIO_AF(GPIOE_ZIO_D58, 0) |        \
 -                                     PIN_AFIO_AF(GPIOE_ZIO_D59, 0) |        \
 -                                     PIN_AFIO_AF(GPIOE_ZIO_D41, 0))
 -#define VAL_GPIOE_AFRH              (PIN_AFIO_AF(GPIOE_ZIO_D42, 0) |        \
 -                                     PIN_AFIO_AF(GPIOE_ARD_D6, 0) |         \
 -                                     PIN_AFIO_AF(GPIOE_ZIO_D40, 0) |        \
 -                                     PIN_AFIO_AF(GPIOE_ARD_D5, 0) |         \
 -                                     PIN_AFIO_AF(GPIOE_ZIO_D39, 0) |        \
 -                                     PIN_AFIO_AF(GPIOE_ARD_D3, 0) |         \
 -                                     PIN_AFIO_AF(GPIOE_ZIO_D38, 0) |        \
 -                                     PIN_AFIO_AF(GPIOE_ZIO_D37, 0))
 +#define VAL_GPIOE_AFRL              (PIN_AFIO_AF(GPIOE_ZIO_D34, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOE_PIN1, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOE_ZIO_D31, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOE_ZIO_D60, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOE_ZIO_D57, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOE_ZIO_D58, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOE_ZIO_D59, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOE_ZIO_D41, 0U))
 +#define VAL_GPIOE_AFRH              (PIN_AFIO_AF(GPIOE_ZIO_D42, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOE_ARD_D6, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOE_ZIO_D40, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOE_ARD_D5, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOE_ZIO_D39, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOE_ARD_D3, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOE_ZIO_D38, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOE_ZIO_D37, 0U))
  /*
   * GPIOF setup:
 @@ -1226,22 +1233,22 @@                                       PIN_ODR_HIGH(GPIOF_ARD_D7) |           \
                                       PIN_ODR_HIGH(GPIOF_ARD_D4) |           \
                                       PIN_ODR_HIGH(GPIOF_ARD_D2))
 -#define VAL_GPIOF_AFRL              (PIN_AFIO_AF(GPIOF_ZIO_D68, 0) |        \
 -                                     PIN_AFIO_AF(GPIOF_ZIO_D69, 0) |        \
 -                                     PIN_AFIO_AF(GPIOF_ZIO_D70, 0) |        \
 -                                     PIN_AFIO_AF(GPIOF_ARD_A3, 0) |         \
 -                                     PIN_AFIO_AF(GPIOF_ZIO_A8, 0) |         \
 -                                     PIN_AFIO_AF(GPIOF_ARD_A4, 0) |         \
 -                                     PIN_AFIO_AF(GPIOF_PIN6, 0) |           \
 -                                     PIN_AFIO_AF(GPIOF_ZIO_D62, 0))
 -#define VAL_GPIOF_AFRH              (PIN_AFIO_AF(GPIOF_ZIO_D61, 0) |        \
 -                                     PIN_AFIO_AF(GPIOF_ZIO_D63, 0) |        \
 -                                     PIN_AFIO_AF(GPIOF_ARD_A5, 0) |         \
 -                                     PIN_AFIO_AF(GPIOF_PIN11, 0) |          \
 -                                     PIN_AFIO_AF(GPIOF_ARD_D8, 0) |         \
 -                                     PIN_AFIO_AF(GPIOF_ARD_D7, 0) |         \
 -                                     PIN_AFIO_AF(GPIOF_ARD_D4, 0) |         \
 -                                     PIN_AFIO_AF(GPIOF_ARD_D2, 0))
 +#define VAL_GPIOF_AFRL              (PIN_AFIO_AF(GPIOF_ZIO_D68, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOF_ZIO_D69, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOF_ZIO_D70, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOF_ARD_A3, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOF_ZIO_A8, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOF_ARD_A4, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOF_PIN6, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOF_ZIO_D62, 0U))
 +#define VAL_GPIOF_AFRH              (PIN_AFIO_AF(GPIOF_ZIO_D61, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOF_ZIO_D63, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOF_ARD_A5, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOF_PIN11, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOF_ARD_D8, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOF_ARD_D7, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOF_ARD_D4, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOF_ARD_D2, 0U))
  /*
   * GPIOG setup:
 @@ -1343,22 +1350,22 @@                                       PIN_ODR_HIGH(GPIOG_RMII_TXD0) |        \
                                       PIN_ODR_HIGH(GPIOG_ARD_D1) |           \
                                       PIN_ODR_HIGH(GPIOG_PIN15))
 -#define VAL_GPIOG_AFRL              (PIN_AFIO_AF(GPIOG_ZIO_D65, 0) |        \
 -                                     PIN_AFIO_AF(GPIOG_ZIO_D64, 0) |        \
 -                                     PIN_AFIO_AF(GPIOG_ZIO_D49, 0) |        \
 -                                     PIN_AFIO_AF(GPIOG_ZIO_D50, 0) |        \
 -                                     PIN_AFIO_AF(GPIOG_PIN4, 0) |           \
 -                                     PIN_AFIO_AF(GPIOG_PIN5, 0) |           \
 -                                     PIN_AFIO_AF(GPIOG_USB_GPIO_OUT, 0) |   \
 -                                     PIN_AFIO_AF(GPIOG_USB_GPIO_IN, 0))
 -#define VAL_GPIOG_AFRH              (PIN_AFIO_AF(GPIOG_PIN8, 0) |           \
 -                                     PIN_AFIO_AF(GPIOG_ARD_D0, 0) |         \
 -                                     PIN_AFIO_AF(GPIOG_PIN10, 0) |          \
 -                                     PIN_AFIO_AF(GPIOG_RMII_TX_EN, 11) |    \
 -                                     PIN_AFIO_AF(GPIOG_PIN12, 0) |          \
 -                                     PIN_AFIO_AF(GPIOG_RMII_TXD0, 11) |     \
 -                                     PIN_AFIO_AF(GPIOG_ARD_D1, 0) |         \
 -                                     PIN_AFIO_AF(GPIOG_PIN15, 0))
 +#define VAL_GPIOG_AFRL              (PIN_AFIO_AF(GPIOG_ZIO_D65, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOG_ZIO_D64, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOG_ZIO_D49, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOG_ZIO_D50, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOG_PIN4, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOG_PIN5, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOG_USB_GPIO_OUT, 0U) |  \
 +                                     PIN_AFIO_AF(GPIOG_USB_GPIO_IN, 0U))
 +#define VAL_GPIOG_AFRH              (PIN_AFIO_AF(GPIOG_PIN8, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOG_ARD_D0, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOG_PIN10, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOG_RMII_TX_EN, 11U) |   \
 +                                     PIN_AFIO_AF(GPIOG_PIN12, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOG_RMII_TXD0, 11U) |    \
 +                                     PIN_AFIO_AF(GPIOG_ARD_D1, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOG_PIN15, 0U))
  /*
   * GPIOH setup:
 @@ -1460,22 +1467,22 @@                                       PIN_ODR_HIGH(GPIOH_PIN13) |            \
                                       PIN_ODR_HIGH(GPIOH_PIN14) |            \
                                       PIN_ODR_HIGH(GPIOH_PIN15))
 -#define VAL_GPIOH_AFRL              (PIN_AFIO_AF(GPIOH_OSC_IN, 0) |         \
 -                                     PIN_AFIO_AF(GPIOH_OSC_OUT, 0) |        \
 -                                     PIN_AFIO_AF(GPIOH_PIN2, 0) |           \
 -                                     PIN_AFIO_AF(GPIOH_PIN3, 0) |           \
 -                                     PIN_AFIO_AF(GPIOH_PIN4, 0) |           \
 -                                     PIN_AFIO_AF(GPIOH_PIN5, 0) |           \
 -                                     PIN_AFIO_AF(GPIOH_PIN6, 0) |           \
 -                                     PIN_AFIO_AF(GPIOH_PIN7, 0))
 -#define VAL_GPIOH_AFRH              (PIN_AFIO_AF(GPIOH_PIN8, 0) |           \
 -                                     PIN_AFIO_AF(GPIOH_PIN9, 0) |           \
 -                                     PIN_AFIO_AF(GPIOH_PIN10, 0) |          \
 -                                     PIN_AFIO_AF(GPIOH_PIN11, 0) |          \
 -                                     PIN_AFIO_AF(GPIOH_PIN12, 0) |          \
 -                                     PIN_AFIO_AF(GPIOH_PIN13, 0) |          \
 -                                     PIN_AFIO_AF(GPIOH_PIN14, 0) |          \
 -                                     PIN_AFIO_AF(GPIOH_PIN15, 0))
 +#define VAL_GPIOH_AFRL              (PIN_AFIO_AF(GPIOH_OSC_IN, 0U) |        \
 +                                     PIN_AFIO_AF(GPIOH_OSC_OUT, 0U) |       \
 +                                     PIN_AFIO_AF(GPIOH_PIN2, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOH_PIN3, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOH_PIN4, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOH_PIN5, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOH_PIN6, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOH_PIN7, 0U))
 +#define VAL_GPIOH_AFRH              (PIN_AFIO_AF(GPIOH_PIN8, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOH_PIN9, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOH_PIN10, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOH_PIN11, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOH_PIN12, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOH_PIN13, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOH_PIN14, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOH_PIN15, 0U))
  /*
   * GPIOI setup:
 @@ -1577,22 +1584,22 @@                                       PIN_ODR_HIGH(GPIOI_PIN13) |            \
                                       PIN_ODR_HIGH(GPIOI_PIN14) |            \
                                       PIN_ODR_HIGH(GPIOI_PIN15))
 -#define VAL_GPIOI_AFRL              (PIN_AFIO_AF(GPIOI_PIN0, 0) |           \
 -                                     PIN_AFIO_AF(GPIOI_PIN1, 0) |           \
 -                                     PIN_AFIO_AF(GPIOI_PIN2, 0) |           \
 -                                     PIN_AFIO_AF(GPIOI_PIN3, 0) |           \
 -                                     PIN_AFIO_AF(GPIOI_PIN4, 0) |           \
 -                                     PIN_AFIO_AF(GPIOI_PIN5, 0) |           \
 -                                     PIN_AFIO_AF(GPIOI_PIN6, 0) |           \
 -                                     PIN_AFIO_AF(GPIOI_PIN7, 0))
 -#define VAL_GPIOI_AFRH              (PIN_AFIO_AF(GPIOI_PIN8, 0) |           \
 -                                     PIN_AFIO_AF(GPIOI_PIN9, 0) |           \
 -                                     PIN_AFIO_AF(GPIOI_PIN10, 0) |          \
 -                                     PIN_AFIO_AF(GPIOI_PIN11, 0) |          \
 -                                     PIN_AFIO_AF(GPIOI_PIN12, 0) |          \
 -                                     PIN_AFIO_AF(GPIOI_PIN13, 0) |          \
 -                                     PIN_AFIO_AF(GPIOI_PIN14, 0) |          \
 -                                     PIN_AFIO_AF(GPIOI_PIN15, 0))
 +#define VAL_GPIOI_AFRL              (PIN_AFIO_AF(GPIOI_PIN0, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOI_PIN1, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOI_PIN2, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOI_PIN3, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOI_PIN4, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOI_PIN5, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOI_PIN6, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOI_PIN7, 0U))
 +#define VAL_GPIOI_AFRH              (PIN_AFIO_AF(GPIOI_PIN8, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOI_PIN9, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOI_PIN10, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOI_PIN11, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOI_PIN12, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOI_PIN13, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOI_PIN14, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOI_PIN15, 0U))
  /*
   * GPIOJ setup:
 @@ -1694,22 +1701,22 @@                                       PIN_ODR_HIGH(GPIOJ_PIN13) |            \
                                       PIN_ODR_HIGH(GPIOJ_PIN14) |            \
                                       PIN_ODR_HIGH(GPIOJ_PIN15))
 -#define VAL_GPIOJ_AFRL              (PIN_AFIO_AF(GPIOJ_PIN0, 0) |           \
 -                                     PIN_AFIO_AF(GPIOJ_PIN1, 0) |           \
 -                                     PIN_AFIO_AF(GPIOJ_PIN2, 0) |           \
 -                                     PIN_AFIO_AF(GPIOJ_PIN3, 0) |           \
 -                                     PIN_AFIO_AF(GPIOJ_PIN4, 0) |           \
 -                                     PIN_AFIO_AF(GPIOJ_PIN5, 0) |           \
 -                                     PIN_AFIO_AF(GPIOJ_PIN6, 0) |           \
 -                                     PIN_AFIO_AF(GPIOJ_PIN7, 0))
 -#define VAL_GPIOJ_AFRH              (PIN_AFIO_AF(GPIOJ_PIN8, 0) |           \
 -                                     PIN_AFIO_AF(GPIOJ_PIN9, 0) |           \
 -                                     PIN_AFIO_AF(GPIOJ_PIN10, 0) |          \
 -                                     PIN_AFIO_AF(GPIOJ_PIN11, 0) |          \
 -                                     PIN_AFIO_AF(GPIOJ_PIN12, 0) |          \
 -                                     PIN_AFIO_AF(GPIOJ_PIN13, 0) |          \
 -                                     PIN_AFIO_AF(GPIOJ_PIN14, 0) |          \
 -                                     PIN_AFIO_AF(GPIOJ_PIN15, 0))
 +#define VAL_GPIOJ_AFRL              (PIN_AFIO_AF(GPIOJ_PIN0, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOJ_PIN1, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOJ_PIN2, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOJ_PIN3, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOJ_PIN4, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOJ_PIN5, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOJ_PIN6, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOJ_PIN7, 0U))
 +#define VAL_GPIOJ_AFRH              (PIN_AFIO_AF(GPIOJ_PIN8, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOJ_PIN9, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOJ_PIN10, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOJ_PIN11, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOJ_PIN12, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOJ_PIN13, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOJ_PIN14, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOJ_PIN15, 0U))
  /*
   * GPIOK setup:
 @@ -1811,22 +1818,22 @@                                       PIN_ODR_HIGH(GPIOK_PIN13) |            \
                                       PIN_ODR_HIGH(GPIOK_PIN14) |            \
                                       PIN_ODR_HIGH(GPIOK_PIN15))
 -#define VAL_GPIOK_AFRL              (PIN_AFIO_AF(GPIOK_PIN0, 0) |           \
 -                                     PIN_AFIO_AF(GPIOK_PIN1, 0) |           \
 -                                     PIN_AFIO_AF(GPIOK_PIN2, 0) |           \
 -                                     PIN_AFIO_AF(GPIOK_PIN3, 0) |           \
 -                                     PIN_AFIO_AF(GPIOK_PIN4, 0) |           \
 -                                     PIN_AFIO_AF(GPIOK_PIN5, 0) |           \
 -                                     PIN_AFIO_AF(GPIOK_PIN6, 0) |           \
 -                                     PIN_AFIO_AF(GPIOK_PIN7, 0))
 -#define VAL_GPIOK_AFRH              (PIN_AFIO_AF(GPIOK_PIN8, 0) |           \
 -                                     PIN_AFIO_AF(GPIOK_PIN9, 0) |           \
 -                                     PIN_AFIO_AF(GPIOK_PIN10, 0) |          \
 -                                     PIN_AFIO_AF(GPIOK_PIN11, 0) |          \
 -                                     PIN_AFIO_AF(GPIOK_PIN12, 0) |          \
 -                                     PIN_AFIO_AF(GPIOK_PIN13, 0) |          \
 -                                     PIN_AFIO_AF(GPIOK_PIN14, 0) |          \
 -                                     PIN_AFIO_AF(GPIOK_PIN15, 0))
 +#define VAL_GPIOK_AFRL              (PIN_AFIO_AF(GPIOK_PIN0, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOK_PIN1, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOK_PIN2, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOK_PIN3, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOK_PIN4, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOK_PIN5, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOK_PIN6, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOK_PIN7, 0U))
 +#define VAL_GPIOK_AFRH              (PIN_AFIO_AF(GPIOK_PIN8, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOK_PIN9, 0U) |          \
 +                                     PIN_AFIO_AF(GPIOK_PIN10, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOK_PIN11, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOK_PIN12, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOK_PIN13, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOK_PIN14, 0U) |         \
 +                                     PIN_AFIO_AF(GPIOK_PIN15, 0U))
  #if !defined(_FROM_ASM_)
 @@ -1839,4 +1846,4 @@ extern "C" {  #endif
  #endif /* _FROM_ASM_ */
 -#endif /* _BOARD_H_ */
 +#endif /* BOARD_H */
 diff --git a/os/hal/boards/ST_NUCLEO144_F746ZG/cfg/board.chcfg b/os/hal/boards/ST_NUCLEO144_F746ZG/cfg/board.chcfg index 91d9558bb..906be3df2 100644 --- a/os/hal/boards/ST_NUCLEO144_F746ZG/cfg/board.chcfg +++ b/os/hal/boards/ST_NUCLEO144_F746ZG/cfg/board.chcfg @@ -22,7 +22,8 @@      HSEBypass="true"
      LSEFrequency="32768"
      LSEBypass="false"
 -    VDD="300" />
 +    VDD="300"
 +    LSEDrive="3 High Drive (default)" />
    <ports>
      <GPIOA>
        <pin0
 diff --git a/os/hal/boards/ST_NUCLEO144_F767ZI/board.h b/os/hal/boards/ST_NUCLEO144_F767ZI/board.h index bab4c8686..deeff5e3b 100644 --- a/os/hal/boards/ST_NUCLEO144_F767ZI/board.h +++ b/os/hal/boards/ST_NUCLEO144_F767ZI/board.h @@ -45,6 +45,8 @@  #define STM32_LSECLK                32768U
  #endif
 +#define STM32_LSEDRV                (3U << 3U)
 +
  #if !defined(STM32_HSECLK)
  #define STM32_HSECLK                8000000U
  #endif
 diff --git a/os/hal/boards/ST_NUCLEO144_F767ZI/cfg/board.chcfg b/os/hal/boards/ST_NUCLEO144_F767ZI/cfg/board.chcfg index 73f2fb0cb..9587d60fc 100644 --- a/os/hal/boards/ST_NUCLEO144_F767ZI/cfg/board.chcfg +++ b/os/hal/boards/ST_NUCLEO144_F767ZI/cfg/board.chcfg @@ -22,7 +22,8 @@      HSEBypass="true"
      LSEFrequency="32768"
      LSEBypass="false"
 -    VDD="300" />
 +    VDD="300"
 +    LSEDrive="3 High Drive (default)" />
    <ports>
      <GPIOA>
        <pin0
 diff --git a/os/hal/boards/ST_STM32F746G_DISCOVERY/board.h b/os/hal/boards/ST_STM32F746G_DISCOVERY/board.h index 3e45e9101..cc26ca1f4 100644 --- a/os/hal/boards/ST_STM32F746G_DISCOVERY/board.h +++ b/os/hal/boards/ST_STM32F746G_DISCOVERY/board.h @@ -50,6 +50,8 @@  #define STM32_LSECLK                32768U
  #endif
 +#define STM32_LSEDRV                (3U << 3U)
 +
  #if !defined(STM32_HSECLK)
  #define STM32_HSECLK                25000000U
  #endif
 diff --git a/os/hal/boards/ST_STM32F746G_DISCOVERY/cfg/board.chcfg b/os/hal/boards/ST_STM32F746G_DISCOVERY/cfg/board.chcfg index 83b877072..9fa7a8563 100644 --- a/os/hal/boards/ST_STM32F746G_DISCOVERY/cfg/board.chcfg +++ b/os/hal/boards/ST_STM32F746G_DISCOVERY/cfg/board.chcfg @@ -30,7 +30,8 @@      HSEBypass="true"
      LSEFrequency="32768"
      LSEBypass="false"
 -    VDD="300" />
 +    VDD="300"
 +    LSEDrive="3 High Drive (default)" />
    <ports>
      <GPIOA>
        <pin0
 diff --git a/os/hal/boards/ST_STM32F769I_DISCOVERY/board.h b/os/hal/boards/ST_STM32F769I_DISCOVERY/board.h index 51735aa52..0653fa583 100644 --- a/os/hal/boards/ST_STM32F769I_DISCOVERY/board.h +++ b/os/hal/boards/ST_STM32F769I_DISCOVERY/board.h @@ -50,6 +50,8 @@  #define STM32_LSECLK                32768U
  #endif
 +#define STM32_LSEDRV                (3U << 3U)
 +
  #if !defined(STM32_HSECLK)
  #define STM32_HSECLK                25000000U
  #endif
 diff --git a/os/hal/boards/ST_STM32F769I_DISCOVERY/cfg/board.chcfg b/os/hal/boards/ST_STM32F769I_DISCOVERY/cfg/board.chcfg index 748014c8a..d7dcc9f31 100644 --- a/os/hal/boards/ST_STM32F769I_DISCOVERY/cfg/board.chcfg +++ b/os/hal/boards/ST_STM32F769I_DISCOVERY/cfg/board.chcfg @@ -30,7 +30,8 @@      HSEBypass="true"
      LSEFrequency="32768"
      LSEBypass="false"
 -    VDD="300" />
 +    VDD="300"
 +    LSEDrive="3 High Drive (default)" />
    <ports>
      <GPIOA>
        <pin0
 diff --git a/os/hal/ports/STM32/STM32F7xx/hal_lld.c b/os/hal/ports/STM32/STM32F7xx/hal_lld.c index 8dbf62a0d..09bb780a6 100644 --- a/os/hal/ports/STM32/STM32F7xx/hal_lld.c +++ b/os/hal/ports/STM32/STM32F7xx/hal_lld.c @@ -66,10 +66,10 @@ static void hal_lld_backup_domain_init(void) {  #if STM32_LSE_ENABLED
  #if defined(STM32_LSE_BYPASS)
    /* LSE Bypass.*/
 -  RCC->BDCR |= RCC_BDCR_LSEON | RCC_BDCR_LSEBYP;
 +  RCC->BDCR |= STM32_LSEDRV | RCC_BDCR_LSEON | RCC_BDCR_LSEBYP;
  #else
    /* No LSE Bypass.*/
 -  RCC->BDCR |= RCC_BDCR_LSEON;
 +  RCC->BDCR |= STM32_LSEDRV | RCC_BDCR_LSEON;
  #endif
    while ((RCC->BDCR & RCC_BDCR_LSERDY) == 0)
      ;                                       /* Waits until LSE is stable.   */
 diff --git a/os/hal/ports/STM32/STM32F7xx/hal_lld.h b/os/hal/ports/STM32/STM32F7xx/hal_lld.h index a77be0f2c..7fbf8fe9d 100644 --- a/os/hal/ports/STM32/STM32F7xx/hal_lld.h +++ b/os/hal/ports/STM32/STM32F7xx/hal_lld.h @@ -20,6 +20,7 @@   * @pre     This module requires the following macros to be defined in the
   *          @p board.h file:
   *          - STM32_LSECLK.
 + *          - STM32_LSEDRV.
   *          - STM32_LSE_BYPASS (optionally).
   *          - STM32_HSECLK.
   *          - STM32_HSE_BYPASS (optionally).
 @@ -872,6 +873,22 @@  #error "Using a wrong mcuconf.h file, STM32F7xx_MCUCONF not defined"
  #endif
 +/*
 + * Board file checks.
 + */
 +#if !defined(STM32_LSECLK)
 +#error "STM32_LSECLK not defined in board.h"
 +#endif
 +#if !defined(STM32_LSEDRV)
 +#error "STM32_LSEDRV not defined in board.h"
 +#endif
 +#if !defined(STM32_HSECLK)
 +#error "STM32_HSECLK not defined in board.h"
 +#endif
 +#if !defined(STM32_VDD)
 +#error "STM32_VDD not defined in board.h"
 +#endif
 +
  /**
   * @brief   Maximum frequency thresholds and wait states for flash access.
   * @note    The values are valid for 2.7V to 3.6V supply range.
 @@ -1066,6 +1083,14 @@  #error "STM32_LSECLK outside acceptable range (STM32_LSECLK_MIN...STM32_LSECLK_MAX)"
  #endif
 +#if !defined(STM32_LSEDRV)
 +#error "STM32_LSEDRV not defined"
 +#endif
 +
 +#if (STM32_LSEDRV >> 3) > 3
 +#error "STM32_LSEDRV outside acceptable range ((0<<3)...(3<<3))"
 +#endif
 +
  #else /* !STM32_LSE_ENABLED */
  #if STM32_RTCSEL == STM32_RTCSEL_LSE
  | 
