You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2018/05/22 10:06:57 UTC
[mynewt-core] 05/05: Add Nucleo-F767ZI TRNG support
This is an automated email from the ASF dual-hosted git repository.
utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 6c9d6b8df31448d1e4e67bdafbae8c8f2eb2d1b3
Author: Fabio Utzig <ut...@apache.org>
AuthorDate: Thu May 17 10:54:06 2018 -0300
Add Nucleo-F767ZI TRNG support
---
.../nucleo-f767zi/include/bsp/stm32f7xx_hal_conf.h | 20 ++++++++++----------
hw/bsp/nucleo-f767zi/src/hal_bsp.c | 15 +++++++++++++++
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/hw/bsp/nucleo-f767zi/include/bsp/stm32f7xx_hal_conf.h b/hw/bsp/nucleo-f767zi/include/bsp/stm32f7xx_hal_conf.h
index da2e39a..28a234e 100644
--- a/hw/bsp/nucleo-f767zi/include/bsp/stm32f7xx_hal_conf.h
+++ b/hw/bsp/nucleo-f767zi/include/bsp/stm32f7xx_hal_conf.h
@@ -72,7 +72,6 @@
#define HAL_MDIOS_MODULE_ENABLED
#define HAL_PCD_MODULE_ENABLED
#define HAL_HCD_MODULE_ENABLED
-#define HAL_RNG_MODULE_ENABLED
#define HAL_SAI_MODULE_ENABLED
#define HAL_SD_MODULE_ENABLED
#define HAL_SPDIFRX_MODULE_ENABLED
@@ -81,22 +80,23 @@
#define HAL_WWDG_MODULE_ENABLED
*/
#define HAL_DMA_MODULE_ENABLED
-#define HAL_ETH_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
+#define HAL_ETH_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
#define HAL_SRAM_MODULE_ENABLED
#define HAL_GPIO_MODULE_ENABLED
#define HAL_I2C_MODULE_ENABLED
-#define HAL_IWDG_MODULE_ENABLED
+#define HAL_IWDG_MODULE_ENABLED
#define HAL_LPTIM_MODULE_ENABLED
#define HAL_PWR_MODULE_ENABLED
-#define HAL_QSPI_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
+#define HAL_QSPI_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
#define HAL_RTC_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_UART_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
+#define HAL_SPI_MODULE_ENABLED
+#define HAL_TIM_MODULE_ENABLED
+#define HAL_UART_MODULE_ENABLED
+#define HAL_USART_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_RNG_MODULE_ENABLED
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/hw/bsp/nucleo-f767zi/src/hal_bsp.c b/hw/bsp/nucleo-f767zi/src/hal_bsp.c
index 1b3523f..b7e0d1e 100644
--- a/hw/bsp/nucleo-f767zi/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f767zi/src/hal_bsp.c
@@ -20,6 +20,11 @@
#include "os/mynewt.h"
+#if MYNEWT_VAL(TRNG)
+#include "trng/trng.h"
+#include "trng_stm32/trng_stm32.h"
+#endif
+
#if MYNEWT_VAL(UART_0)
#include <uart/uart.h>
#include <uart_hal/uart_hal.h>
@@ -49,6 +54,10 @@
#include "bsp/bsp.h"
+#if MYNEWT_VAL(TRNG)
+static struct trng_dev os_bsp_trng;
+#endif
+
#if MYNEWT_VAL(UART_0)
static struct uart_dev hal_uart0;
@@ -175,6 +184,12 @@ hal_bsp_init(void)
hal_system_clock_start();
+#if MYNEWT_VAL(TRNG)
+ rc = os_dev_create(&os_bsp_trng.dev, "trng", OS_DEV_INIT_KERNEL,
+ OS_DEV_INIT_PRIO_DEFAULT, stm32_trng_dev_init, NULL);
+ assert(rc == 0);
+#endif
+
#if MYNEWT_VAL(UART_0)
rc = os_dev_create((struct os_dev *) &hal_uart0, "uart0",
OS_DEV_INIT_PRIMARY, 0, uart_hal_init, (void *)&uart_cfg[0]);
--
To stop receiving notification emails like this one, please contact
utzig@apache.org.