diff --git a/bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/pins_arduino.h b/bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/pins_arduino.h index 5b55116026..2b80505e24 100644 --- a/bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/pins_arduino.h +++ b/bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/pins_arduino.h @@ -47,7 +47,9 @@ /* i2c1 - PB9-SDA PB8-SCL */ #define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1" -#define SS D7 -#define RTDUINO_DEFAULT_SPI_BUS_NAME "spi1" +#define SS D10 +#define RTDUINO_DEFAULT_SPI_BUS_NAME "spi1" + +#define RTDUINO_TONE_HWTIMER_DEVICE_NAME "timer9" #endif /* Pins_Arduino_h */ diff --git a/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc b/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc index 1c11f0aab8..f174719faa 100644 --- a/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc +++ b/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc @@ -14,7 +14,8 @@ Mcu.CPN=STM32F401RET6 Mcu.Family=STM32F4 Mcu.IP0=ADC1 Mcu.IP1=NVIC -Mcu.IP10=USART2 +Mcu.IP10=TIM11 +Mcu.IP11=USART2 Mcu.IP2=RCC Mcu.IP3=SPI3 Mcu.IP4=SYS @@ -22,8 +23,8 @@ Mcu.IP5=TIM1 Mcu.IP6=TIM2 Mcu.IP7=TIM3 Mcu.IP8=TIM4 -Mcu.IP9=TIM11 -Mcu.IPNb=11 +Mcu.IP9=TIM9 +Mcu.IPNb=12 Mcu.Name=STM32F401R(D-E)Tx Mcu.Package=LQFP64 Mcu.Pin0=PC14-OSC32_IN @@ -52,19 +53,20 @@ Mcu.Pin29=VP_TIM2_VS_ClockSourceINT Mcu.Pin3=PH1 - OSC_OUT Mcu.Pin30=VP_TIM3_VS_ClockSourceINT Mcu.Pin31=VP_TIM4_VS_ClockSourceINT -Mcu.Pin32=VP_TIM11_VS_ClockSourceINT +Mcu.Pin32=VP_TIM9_VS_ClockSourceINT +Mcu.Pin33=VP_TIM11_VS_ClockSourceINT Mcu.Pin4=PC0 Mcu.Pin5=PC1 Mcu.Pin6=PA0-WKUP Mcu.Pin7=PA1 Mcu.Pin8=PA2 Mcu.Pin9=PA3 -Mcu.PinsNb=33 +Mcu.PinsNb=34 Mcu.ThirdPartyNb=0 Mcu.UserConstants= Mcu.UserName=STM32F401RETx -MxCube.Version=6.7.0 -MxDb.Version=DB.6.0.70 +MxCube.Version=6.8.1 +MxDb.Version=DB.6.0.81 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.ForceEnableDMAVector=true @@ -153,12 +155,13 @@ ProjectManager.PreviousToolchain= ProjectManager.ProjectBuild=false ProjectManager.ProjectFileName=CubeMX_Config.ioc ProjectManager.ProjectName=CubeMX_Config +ProjectManager.ProjectStructure= ProjectManager.RegisterCallBack= ProjectManager.StackSize=0x400 ProjectManager.TargetToolchain=MDK-ARM V5 ProjectManager.ToolChainLocation= ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART2_UART_Init-USART2-false-HAL-true,4-MX_ADC1_Init-ADC1-false-HAL-true,5-MX_TIM2_Init-TIM2-false-HAL-true,6-MX_TIM3_Init-TIM3-false-HAL-true,7-MX_TIM11_Init-TIM11-false-HAL-true,8-MX_TIM1_Init-TIM1-false-HAL-true,9-MX_TIM4_Init-TIM4-false-HAL-true +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART2_UART_Init-USART2-false-HAL-true,4-MX_ADC1_Init-ADC1-false-HAL-true,5-MX_TIM2_Init-TIM2-false-HAL-true,6-MX_TIM3_Init-TIM3-false-HAL-true,7-MX_TIM11_Init-TIM11-false-HAL-true,8-MX_TIM1_Init-TIM1-false-HAL-true,9-MX_TIM4_Init-TIM4-false-HAL-true,10-MX_SPI3_Init-SPI3-false-HAL-true RCC.48MHZClocksFreq_Value=84000000 RCC.AHBFreq_Value=84000000 RCC.APB1CLKDivider=RCC_HCLK_DIV2 @@ -246,4 +249,6 @@ VP_TIM3_VS_ClockSourceINT.Mode=Internal VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT VP_TIM4_VS_ClockSourceINT.Mode=Internal VP_TIM4_VS_ClockSourceINT.Signal=TIM4_VS_ClockSourceINT +VP_TIM9_VS_ClockSourceINT.Mode=Internal +VP_TIM9_VS_ClockSourceINT.Signal=TIM9_VS_ClockSourceINT board=custom diff --git a/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h b/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h index 2f2be5660a..cd67cbed83 100644 --- a/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h +++ b/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h @@ -46,6 +46,7 @@ /* #define HAL_DCMI_MODULE_ENABLED */ /* #define HAL_DMA2D_MODULE_ENABLED */ /* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_ETH_LEGACY_MODULE_ENABLED */ /* #define HAL_NAND_MODULE_ENABLED */ /* #define HAL_NOR_MODULE_ENABLED */ /* #define HAL_PCCARD_MODULE_ENABLED */ @@ -326,6 +327,10 @@ #include "stm32f4xx_hal_eth.h" #endif /* HAL_ETH_MODULE_ENABLED */ +#ifdef HAL_ETH_LEGACY_MODULE_ENABLED + #include "stm32f4xx_hal_eth_legacy.h" +#endif /* HAL_ETH_LEGACY_MODULE_ENABLED */ + #ifdef HAL_FLASH_MODULE_ENABLED #include "stm32f4xx_hal_flash.h" #endif /* HAL_FLASH_MODULE_ENABLED */ diff --git a/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c b/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c index 2fe7b52c5b..ba12c890c3 100644 --- a/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c +++ b/bsp/stm32/stm32f401-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c @@ -305,6 +305,17 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base) /* USER CODE END TIM4_MspInit 1 */ } + else if(htim_base->Instance==TIM9) + { + /* USER CODE BEGIN TIM9_MspInit 0 */ + + /* USER CODE END TIM9_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_TIM9_CLK_ENABLE(); + /* USER CODE BEGIN TIM9_MspInit 1 */ + + /* USER CODE END TIM9_MspInit 1 */ + } else if(htim_base->Instance==TIM11) { /* USER CODE BEGIN TIM11_MspInit 0 */ @@ -471,6 +482,17 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base) /* USER CODE END TIM4_MspDeInit 1 */ } + else if(htim_base->Instance==TIM9) + { + /* USER CODE BEGIN TIM9_MspDeInit 0 */ + + /* USER CODE END TIM9_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM9_CLK_DISABLE(); + /* USER CODE BEGIN TIM9_MspDeInit 1 */ + + /* USER CODE END TIM9_MspDeInit 1 */ + } else if(htim_base->Instance==TIM11) { /* USER CODE BEGIN TIM11_MspDeInit 0 */ diff --git a/bsp/stm32/stm32f401-st-nucleo/board/Kconfig b/bsp/stm32/stm32f401-st-nucleo/board/Kconfig index 52ab0291b9..a462e103a9 100644 --- a/bsp/stm32/stm32f401-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f401-st-nucleo/board/Kconfig @@ -19,6 +19,8 @@ menu "Onboard Peripheral Drivers" select PKG_USING_RTDUINO select BSP_USING_STLINK_TO_USART select BSP_USING_GPIO + select BSP_USING_TIM + select BSP_USING_TIM9 select BSP_USING_ADC select BSP_USING_ADC1 select BSP_USING_PWM @@ -81,7 +83,12 @@ menu "On-chip Peripheral Drivers" bool "Enable timer" default n select RT_USING_HWTIMER + if BSP_USING_TIM + config BSP_USING_TIM9 + bool "Enable TIM9" + default n + config BSP_USING_TIM11 bool "Enable TIM11" default n