From 29a0dde7142dc4f612ab3a3c83c44f868f934269 Mon Sep 17 00:00:00 2001 From: XYX12306 <2669599387@qq.com> Date: Sun, 7 Jun 2020 15:30:50 +0800 Subject: [PATCH 1/3] update README.md and main.c file update template.uvprojx and enable to automatic operate after burning support SPI/I2C/timer/pwm/ADC/RTC/WDG/FLASH/OTGFS/RNG/UDID on-chip peripheral driver take CubeMX_Config.ioc Rename to STM32F413ZH.ioc --- bsp/stm32/stm32f413-st-nucleo/.config | 9 +- bsp/stm32/stm32f413-st-nucleo/README.md | 29 +- .../stm32f413-st-nucleo/applications/main.c | 39 +- .../board/CubeMX_Config/.mxproject | 5 +- .../board/CubeMX_Config/Inc/main.h | 2 + .../CubeMX_Config/Inc/stm32f4xx_hal_conf.h | 12 +- .../{CubeMX_Config.ioc => STM32F413ZH.ioc} | 549 +++++----- .../board/CubeMX_Config/Src/main.c | 413 +++++++- .../CubeMX_Config/Src/stm32f4xx_hal_msp.c | 443 +++++++- bsp/stm32/stm32f413-st-nucleo/board/Kconfig | 106 ++ bsp/stm32/stm32f413-st-nucleo/board/board.c | 6 +- bsp/stm32/stm32f413-st-nucleo/project.ewp | 9 + bsp/stm32/stm32f413-st-nucleo/project.uvopt | 983 +----------------- bsp/stm32/stm32f413-st-nucleo/project.uvoptx | 83 +- bsp/stm32/stm32f413-st-nucleo/project.uvproj | 227 +++- bsp/stm32/stm32f413-st-nucleo/project.uvprojx | 42 +- bsp/stm32/stm32f413-st-nucleo/rtconfig.h | 1 + bsp/stm32/stm32f413-st-nucleo/template.uvoptx | 5 +- .../stm32f413-st-nucleo/template.uvprojx | 23 +- 19 files changed, 1657 insertions(+), 1329 deletions(-) rename bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/{CubeMX_Config.ioc => STM32F413ZH.ioc} (73%) diff --git a/bsp/stm32/stm32f413-st-nucleo/.config b/bsp/stm32/stm32f413-st-nucleo/.config index d8d4619864..ade1a6699f 100644 --- a/bsp/stm32/stm32f413-st-nucleo/.config +++ b/bsp/stm32/stm32f413-st-nucleo/.config @@ -130,7 +130,7 @@ CONFIG_RT_USING_PIN=y # CONFIG_RT_USING_RTC is not set # CONFIG_RT_USING_SDIO is not set # CONFIG_RT_USING_SPI is not set -# CONFIG_RT_USING_WDT is not set +CONFIG_RT_USING_WDT=y # CONFIG_RT_USING_AUDIO is not set # CONFIG_RT_USING_SENSOR is not set # CONFIG_RT_USING_TOUCH is not set @@ -366,6 +366,13 @@ CONFIG_BSP_USING_UART=y # CONFIG_BSP_USING_UART2 is not set CONFIG_BSP_USING_UART3=y # CONFIG_BSP_UART3_RX_USING_DMA is not set +# CONFIG_BSP_USING_SPI is not set +# CONFIG_BSP_USING_I2C1 is not set +# CONFIG_BSP_USING_TIM is not set +# CONFIG_BSP_USING_PWM is not set +# CONFIG_BSP_USING_ADC is not set +# CONFIG_BSP_USING_ONCHIP_RTC is not set +# CONFIG_BSP_USING_WDT is not set # CONFIG_BSP_USING_ON_CHIP_FLASH is not set # CONFIG_BSP_USING_USBD is not set # CONFIG_BSP_USING_RNG is not set diff --git a/bsp/stm32/stm32f413-st-nucleo/README.md b/bsp/stm32/stm32f413-st-nucleo/README.md index 083970d56b..c10c01a879 100644 --- a/bsp/stm32/stm32f413-st-nucleo/README.md +++ b/bsp/stm32/stm32f413-st-nucleo/README.md @@ -24,7 +24,7 @@ - MCU:STM32F413ZH,主频 100MHz,1536KB FLASH ,320KB RAM - 常用外设 - - LED:8个,user LED (绿色,PC9,LD1;蓝色,PB7,LD2;红色,PB14,LD3), USB communication (LD4), over current (LD5), power LED (黄色,LD6), USB FAULT (LD7), VBUS (LD8)。 + - LED:8个,user LED [SB2跳帽需连接](黄色,PB0,LD1;蓝色,PB7,LD2;红色,PB14,LD3), USB communication (LD4), over current (LD5), power LED (黄色,LD6), USB FAULT (LD7), VBUS (LD8)。 - 按键:2个,B1(USER,PC13),B2(RESET) - 常用接口:USB 支持 3 种不同接口:虚拟 COM 端口、大容量存储和调试端口等。 - 调试接口,板载 ST-LINK/V2-1 调试器。 @@ -35,12 +35,27 @@ 本 BSP 目前对外设的支持情况如下: +| **板载外设** | **支持情况** | **备注** | +| :------------ | :----------: | :-----------------------------------: | +|STLINK TO USART| 支持 | UART3 | + | **片上外设** | **支持情况** | **备注** | | :------------ | :----------: | :-----------------------------------: | | GPIO | 支持 | | -| UART | 支持 | UART2,UART3 | -| Onchip Flash | 支持 | | -| USB Device | 支持 | | +| UART | 支持 | UART2/3 | +| SPI | 支持 | SPI2 | +| I2C | 支持 | I2C1(软件模拟) | +| TIMER | 支持 | TIM11/13/14 | +| PWM | 支持 | PWM2_CH4 | +| ADC | 支持 | ADC1_IN5 | +| RTC | 支持 | 支持外部晶振和内部低速时钟 | +| WDT | 支持 | 独立看门狗 | +| Onchip Flash | 支持 | 片上Flash | +| USB OTG_FS | 支持 | OTGFS as USB device | +| Onchip Flash | 支持 | 片上Flash | +| USB Device | 支持 | OTGFS as USB device | +| RNG | 支持 | Random Number Generator | +| UDID | 支持 | Unique Device Identifier | ## 使用说明 @@ -67,11 +82,11 @@ 双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。 -> 工程默认配置使用 xxx 仿真器下载程序,在通过 xxx 连接开发板的基础上,点击下载按钮即可下载程序到开发板 +> 工程默认配置使用 板载ST-LINK 仿真器下载程序,在通过 Micro USB线 连接开发板的基础上,点击下载按钮即可下载程序到开发板 #### 运行结果 -下载程序成功之后,系统会自动运行,观察开发板上 LD2 的运行效果,蓝色 LD2 会周期性闪烁。 +下载程序成功之后,系统会自动运行,在SB2跳帽连接时,当按下用户按键USER KEY时,观察开发板上 LD1、LD2、LD2 的运行效果,三个LED会顺序周期性交替闪烁。 连接开发板对应串口到 PC , 在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息: @@ -84,7 +99,7 @@ msh > ``` ### 进阶使用 -此 BSP 默认只开启了 GPIO 和 串口 3 的功能,更多高级功能需要利用 ENV 工具对 BSP 进行配置,步骤如下: +此 BSP 默认只开启了 GPIO 和 UART3 的功能,更多高级功能需要利用 ENV 工具对 BSP 进行配置,步骤如下: 1. 在 bsp 下打开 env 工具。 diff --git a/bsp/stm32/stm32f413-st-nucleo/applications/main.c b/bsp/stm32/stm32f413-st-nucleo/applications/main.c index 9f63c9a7ff..089d629f1a 100644 --- a/bsp/stm32/stm32f413-st-nucleo/applications/main.c +++ b/bsp/stm32/stm32f413-st-nucleo/applications/main.c @@ -12,21 +12,50 @@ #include #include +/* defined the LED1 pin: PB0 */ +#define LED1_PIN GET_PIN(B, 0) /* defined the LED2 pin: PB7 */ #define LED2_PIN GET_PIN(B, 7) +/* defined the LED3 pin: PB14 */ +#define LED3_PIN GET_PIN(B, 14) +/* defined the USER KEY pin: PC13 */ +#define KEY_PIN GET_PIN(C, 13) int main(void) { int count = 1; - /* set LED0 pin mode to output */ + /* set LED1 pin mode to output */ + rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT); + /* set LED2 pin mode to output */ rt_pin_mode(LED2_PIN, PIN_MODE_OUTPUT); + /* set LED3 pin mode to output */ + rt_pin_mode(LED3_PIN, PIN_MODE_OUTPUT); + /* set USER KEY pin mode to input */ + rt_pin_mode(KEY_PIN, PIN_MODE_INPUT_PULLDOWN); while (count++) { - rt_pin_write(LED2_PIN, PIN_HIGH); - rt_thread_mdelay(500); - rt_pin_write(LED2_PIN, PIN_LOW); - rt_thread_mdelay(500); + if(rt_pin_read(KEY_PIN)) + { + rt_pin_write(LED1_PIN, PIN_HIGH); + rt_pin_write(LED2_PIN, PIN_LOW); + rt_pin_write(LED3_PIN, PIN_LOW); + rt_thread_mdelay(500); + rt_pin_write(LED1_PIN, PIN_LOW); + rt_pin_write(LED2_PIN, PIN_HIGH); + rt_pin_write(LED3_PIN, PIN_LOW); + rt_thread_mdelay(500); + rt_pin_write(LED1_PIN, PIN_LOW); + rt_pin_write(LED2_PIN, PIN_LOW); + rt_pin_write(LED3_PIN, PIN_HIGH); + rt_thread_mdelay(500); + } + else + { + rt_pin_write(LED1_PIN, PIN_LOW); + rt_pin_write(LED2_PIN, PIN_LOW); + rt_pin_write(LED3_PIN, PIN_LOW); + } } return RT_EOK; diff --git a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/.mxproject b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/.mxproject index 373c6cc6de..2bc7e1a3d7 100644 --- a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/.mxproject +++ b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/.mxproject @@ -5,13 +5,14 @@ SourcePath=H:/RT-Thread/rt-thread/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Con SourceFiles=stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c; [PreviousLibFiles] -LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f413xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/tz_context.h; +LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_iwdg.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_iwdg.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f413xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/tz_context.h; [PreviousUsedIarFiles] SourceFiles=..\Src\main.c;..\Src\stm32f4xx_it.c;..\Src\stm32f4xx_hal_msp.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;../\Src/system_stm32f4xx.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;../\Src/system_stm32f4xx.c;../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;null; HeaderPath=..\Drivers\STM32F4xx_HAL_Driver\Inc;..\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F4xx\Include;..\Drivers\CMSIS\Include;..\Inc; [PreviousUsedKeilFiles] -SourceFiles=..\Src\main.c;..\Src\stm32f4xx_it.c;..\Src\stm32f4xx_hal_msp.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;../\Src/system_stm32f4xx.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;../\Src/system_stm32f4xx.c;../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;null; +SourceFiles=..\Src\main.c;..\Src\stm32f4xx_it.c;..\Src\stm32f4xx_hal_msp.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;..\\Src/system_stm32f4xx.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;..\\Src/system_stm32f4xx.c;..\Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;; HeaderPath=..\Drivers\STM32F4xx_HAL_Driver\Inc;..\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F4xx\Include;..\Drivers\CMSIS\Include;..\Inc; +CDefines=USE_HAL_DRIVER;STM32F413xx;USE_HAL_DRIVER;USE_HAL_DRIVER; diff --git a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Inc/main.h b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Inc/main.h index 04267febcc..e0bcb43ae2 100644 --- a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Inc/main.h +++ b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Inc/main.h @@ -70,6 +70,8 @@ extern "C" { /* USER CODE END EM */ +void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); + /* Exported functions prototypes ---------------------------------------------*/ void Error_Handler(void); diff --git a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h index 9fabadb8c3..9b8a5b56b0 100644 --- a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h +++ b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h @@ -49,7 +49,7 @@ */ #define HAL_MODULE_ENABLED -/* #define HAL_ADC_MODULE_ENABLED */ +#define HAL_ADC_MODULE_ENABLED /* #define HAL_CRYP_MODULE_ENABLED */ /* #define HAL_CAN_MODULE_ENABLED */ /* #define HAL_CRC_MODULE_ENABLED */ @@ -64,17 +64,17 @@ /* #define HAL_SRAM_MODULE_ENABLED */ /* #define HAL_SDRAM_MODULE_ENABLED */ /* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED /* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ +#define HAL_IWDG_MODULE_ENABLED /* #define HAL_LTDC_MODULE_ENABLED */ /* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ +#define HAL_RTC_MODULE_ENABLED /* #define HAL_SAI_MODULE_ENABLED */ /* #define HAL_SD_MODULE_ENABLED */ /* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ -/* #define HAL_TIM_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED #define HAL_UART_MODULE_ENABLED /* #define HAL_USART_MODULE_ENABLED */ /* #define HAL_IRDA_MODULE_ENABLED */ diff --git a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/STM32F413ZH.ioc similarity index 73% rename from bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc rename to bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/STM32F413ZH.ioc index a939b37e7b..c266589aab 100644 --- a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc +++ b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/STM32F413ZH.ioc @@ -1,261 +1,326 @@ #MicroXplorer Configuration settings - do not modify -File.Version=6 -KeepUserPlacement=true Mcu.Family=STM32F4 -Mcu.IP0=NVIC -Mcu.IP1=RCC -Mcu.IP2=SYS -Mcu.IP3=USART3 -Mcu.IP4=USB_OTG_FS -Mcu.IPNb=5 -Mcu.Name=STM32F413Z(G-H)Tx -Mcu.Package=LQFP144 +PC3.Mode=Full_Duplex_Master +ProjectManager.MainLocation=Src +RCC.MCOFreq_Value=72000000 +RCC.USART1Freq_Value=72000000 +USART2.IPParameters=VirtualMode +RCC.CortexFreq_Value=96000000 +RCC.TIM17Freq_Value=72000000 +PG6.Signal=GPIO_Output +ProjectManager.KeepUserCode=true +Mcu.UserName=STM32F413ZHTx +PD9.GPIOParameters=GPIO_Label +SPI2.VirtualType=VM_MASTER +PB10.Mode=Full_Duplex_Master +PG6.Locked=true +RCC.PLLCLKFreq_Value=96000000 +PB14.GPIO_Label=LD3 [Red] +VP_IWDG_VS_IWDG.Mode=IWDG_Activate +PG6.GPIO_Label=USB_PowerSwitchOn [STMPS2151STR_EN] +PA14.GPIO_Label=TCK +RCC.PLLQCLKFreq_Value=48000000 +RCC.SYSCLKSourceVirtual=RCC_SYSCLKSOURCE_PLLCLK +PA12.GPIOParameters=GPIO_Label +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART3_UART_Init-USART3-false-HAL-true,4-MX_USB_OTG_FS_PCD_Init-USB_OTG_FS-false-HAL-true,5-MX_ADC1_Init-ADC1-false-HAL-true,6-MX_I2C1_Init-I2C1-false-HAL-true,7-MX_IWDG_Init-IWDG-false-HAL-true,8-MX_RTC_Init-RTC-false-HAL-true,9-MX_SPI2_Init-SPI2-false-HAL-true,10-MX_TIM2_Init-TIM2-false-HAL-true,11-MX_TIM11_Init-TIM11-false-HAL-true,12-MX_TIM13_Init-TIM13-false-HAL-true,13-MX_TIM14_Init-TIM14-false-HAL-true,14-MX_USART2_UART_Init-USART2-false-HAL-true +PA9.GPIOParameters=GPIO_Label +PD8.Locked=true +PA11.GPIOParameters=GPIO_Label +VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled +PA11.Mode=Device_Only +RCC.RTCFreq_Value=32000 +PC9.Locked=true +RCC.PLLI2SRCLKFreq_Value=48000000 +RCC.USART2Freq_Value=36000000 +PC13.GPIO_Label=USER_Btn [B1] +PD9.Mode=Asynchronous +PinOutPanel.RotationAngle=0 +RCC.MCO1PinFreq_Value=16000000 +RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK +ProjectManager.StackSize=0x400 +SH.GPXTI13.0=GPIO_EXTI13 +RCC.I2C3Freq_Value=8000000 +Mcu.IP4=RCC +RCC.FCLKCortexFreq_Value=96000000 +Mcu.IP5=RTC +Mcu.IP2=IWDG +NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:true\:false +Mcu.IP3=NVIC +Mcu.IP0=ADC1 +PA12.Locked=true +Mcu.IP1=I2C1 +PA12.Signal=USB_OTG_FS_DP +Mcu.UserConstants= +PH0\ -\ OSC_IN.Signal=RCC_OSC_IN +SH.GPXTI13.ConfNb=1 +PH0\ -\ OSC_IN.Locked=true +Mcu.ThirdPartyNb=0 +RCC.SDIOFreq_Value=48000000 +RCC.HCLKFreq_Value=96000000 +Mcu.IPNb=15 +RCC.I2SClocksFreq_Value=48000000 +TIM2.IPParameters=Channel-PWM Generation4 CH4 +ProjectManager.PreviousToolchain= +RCC.APB2TimFreq_Value=96000000 +PB6.Signal=I2C1_SCL +RCC.VcooutputI2S=48000000 +RCC.SAI1BFreq_Value=8000000 +RCC.PLLRoutputFreq_Value=192000000 +PD8.GPIOParameters=GPIO_Label +PB6.Mode=I2C +PC3.Signal=SPI2_MOSI +PA8.GPIOParameters=GPIO_Label +Mcu.Pin6=PC3 +Mcu.Pin7=PA2 +PD8.Signal=USART3_TX +VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT +Mcu.Pin8=PA3 +Mcu.Pin9=PA5 +RCC.AHBFreq_Value=96000000 +RCC.TIM2Freq_Value=72000000 Mcu.Pin0=PC13 Mcu.Pin1=PC14-OSC32_IN -Mcu.Pin10=PC9 -Mcu.Pin11=PA8 -Mcu.Pin12=PA9 -Mcu.Pin13=PA10 -Mcu.Pin14=PA11 -Mcu.Pin15=PA12 -Mcu.Pin16=PA13 -Mcu.Pin17=PA14 -Mcu.Pin18=PB3 -Mcu.Pin19=PB7 Mcu.Pin2=PC15-OSC32_OUT -Mcu.Pin20=VP_SYS_VS_Systick Mcu.Pin3=PH0 - OSC_IN +RCC.USART3Freq_Value=36000000 Mcu.Pin4=PH1 - OSC_OUT -Mcu.Pin5=PB14 -Mcu.Pin6=PD8 -Mcu.Pin7=PD9 -Mcu.Pin8=PG6 -Mcu.Pin9=PG7 -Mcu.PinsNb=21 -Mcu.ThirdPartyNb=0 -Mcu.UserConstants= -Mcu.UserName=STM32F413ZHTx -MxCube.Version=5.1.0 -MxDb.Version=DB.5.0.10 -NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false -NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:true\:false -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false -NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:true\:false -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:true\:false -NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:true\:false -NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 -NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:true\:false -NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:true\:true +Mcu.Pin5=PC2 +ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_5 +ProjectManager.ProjectBuild=false +RCC.HSE_VALUE=8000000 NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false -PA10.GPIOParameters=GPIO_Label -PA10.GPIO_Label=USB_ID -PA10.Locked=true -PA10.Signal=USB_OTG_FS_ID -PA11.GPIOParameters=GPIO_Label -PA11.GPIO_Label=USB_DM -PA11.Locked=true -PA11.Mode=Device_Only -PA11.Signal=USB_OTG_FS_DM -PA12.GPIOParameters=GPIO_Label -PA12.GPIO_Label=USB_DP -PA12.Locked=true -PA12.Mode=Device_Only -PA12.Signal=USB_OTG_FS_DP -PA13.GPIOParameters=GPIO_Label -PA13.GPIO_Label=TMS -PA13.Locked=true -PA13.Mode=Serial_Wire -PA13.Signal=SYS_JTMS-SWDIO -PA14.GPIOParameters=GPIO_Label -PA14.GPIO_Label=TCK -PA14.Locked=true -PA14.Mode=Serial_Wire -PA14.Signal=SYS_JTCK-SWCLK -PA8.GPIOParameters=GPIO_Label -PA8.GPIO_Label=USB_SOF [TP1] +NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:true\:false PA8.Locked=true -PA8.Mode=Activate_SOF_FS -PA8.Signal=USB_OTG_FS_SOF -PA9.GPIOParameters=GPIO_Label -PA9.GPIO_Label=USB_VBUS -PA9.Locked=true -PA9.Mode=Activate_VBUS -PA9.Signal=USB_OTG_FS_VBUS -PB14.GPIOParameters=GPIO_Label -PB14.GPIO_Label=LD3 [Red] -PB14.Locked=true -PB14.Signal=GPIO_Output +Mcu.IP10=TIM13 +NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:true\:true +Mcu.IP12=USART2 +RCC.PLLMUL=RCC_PLL_MUL9 +Mcu.IP11=TIM14 +ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.24.2 +MxDb.Version=DB.5.0.10 +Mcu.IP14=USB_OTG_FS +Mcu.IP13=USART3 +ProjectManager.BackupPrevious=false +PC14-OSC32_IN.Mode=LSE-External-Oscillator +RCC.VCOInputFreq_Value=1000000 +PA14.Mode=Serial_Wire +File.Version=6 +PA10.GPIO_Label=USB_ID +SPI2.CalculateBaudRate=24.0 MBits/s PB3.GPIOParameters=GPIO_Label -PB3.GPIO_Label=SWO -PB3.Locked=true -PB3.Signal=SYS_JTDO-SWO -PB7.GPIOParameters=GPIO_Label -PB7.GPIO_Label=LD2 [Blue] -PB7.Locked=true PB7.Signal=GPIO_Output -PC13.GPIOParameters=GPIO_Label -PC13.GPIO_Label=USER_Btn [B1] +PA8.Signal=USB_OTG_FS_SOF +RCC.PLLRCLKFreq_Value=192000000 +NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:true\:false +RCC.PLLI2SoutputFreq_Value=48000000 +ProjectManager.HalAssertFull=false +ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES +ProjectManager.ProjectName=STM32F413ZH +RCC.TIM1Freq_Value=72000000 +PH0\ -\ OSC_IN.GPIOParameters=GPIO_Label +PA13.GPIOParameters=GPIO_Label +RCC.PLLMCOFreq_Value=72000000 +PB7.GPIO_Label=LD2 [Blue] +RCC.MCO2PinFreq_Value=96000000 +Mcu.Package=LQFP144 +PB9.Signal=I2C1_SDA +RCC.TIM15Freq_Value=72000000 +SPI2.Mode=SPI_MODE_MASTER +RCC.I2S2Freq_Value=48000000 +RCC.SAI1AFreq_Value=8000000 +RCC.ADC34outputFreq_Value=72000000 +USART2.VirtualMode=VM_ASYNC +PA14.Locked=true +ProjectManager.ToolChainLocation= +RCC.LSI_VALUE=32000 +VP_SYS_VS_Systick.Signal=SYS_VS_Systick +USART3.IPParameters=VirtualMode +PA10.Signal=USB_OTG_FS_ID +USB_OTG_FS.VirtualMode=Device_Only +VP_TIM11_VS_ClockSourceINT.Signal=TIM11_VS_ClockSourceINT +VP_TIM13_VS_ClockSourceINT.Signal=TIM13_VS_ClockSourceINT +RCC.DFSDMFreq_Value=96000000 +PB14.GPIOParameters=GPIO_Label +RCC.TIM16Freq_Value=72000000 +RCC.APB1TimFreq_Value=96000000 +NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false +SPI2.Direction=SPI_DIRECTION_2LINES +RCC.DFSDM2AudioFreq_Value=48000000 +USB_OTG_FS.IPParameters=VirtualMode +VP_TIM14_VS_ClockSourceINT.Mode=Enable_Timer +RCC.PLLI2SQoutputFreq_Value=48000000 +SH.S_TIM2_CH4.ConfNb=1 +RCC.DFSDMAudioFreq_Value=48000000 +RCC.LPTimerFreq_Value=48000000 +PD6.Signal=USART2_RX +ProjectManager.CustomerFirmwarePackage= +PC14-OSC32_IN.Locked=true +PB3.Locked=true +PA3.Signal=S_TIM2_CH4 +PB3.GPIO_Label=SWO +VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate +PC15-OSC32_OUT.Mode=LSE-External-Oscillator +RCC.PLLQoutputFreq_Value=48000000 +ProjectManager.ProjectFileName=STM32F413ZH.ioc +TIM2.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4 +RCC.ADC12outputFreq_Value=72000000 +PG7.Locked=true +ADC1.Rank-0\#ChannelRegularConversion=1 +PG7.Signal=GPIO_Input +PD9.GPIO_Label=STLK_TX [STM32F103CBT6_PA2] +Mcu.PinsNb=36 +VP_TIM14_VS_ClockSourceINT.Signal=TIM14_VS_ClockSourceINT +PC9.GPIO_Label=LD1 [Green] +ProjectManager.NoMain=false +ADC1.IPParameters=Rank-0\#ChannelRegularConversion,master,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,NbrOfConversionFlag PC13.Locked=true PC13.Signal=GPXTI13 -PC14-OSC32_IN.Locked=true -PC14-OSC32_IN.Mode=LSE-External-Oscillator -PC14-OSC32_IN.Signal=RCC_OSC32_IN -PC15-OSC32_OUT.Locked=true -PC15-OSC32_OUT.Mode=LSE-External-Oscillator -PC15-OSC32_OUT.Signal=RCC_OSC32_OUT -PC9.GPIOParameters=GPIO_Label -PC9.GPIO_Label=LD1 [Green] -PC9.Locked=true -PC9.Signal=GPIO_Output -PCC.Checker=false -PCC.Line=STM32F413/423 -PCC.MCU=STM32F413Z(G-H)Tx -PCC.PartNumber=STM32F413ZHTx -PCC.Seq0=0 -PCC.Series=STM32F4 -PCC.Temperature=25 -PCC.Vdd=null -PD8.GPIOParameters=GPIO_Label -PD8.GPIO_Label=STLK_RX [STM32F103CBT6_PA3] -PD8.Locked=true -PD8.Mode=Asynchronous -PD8.Signal=USART3_TX -PD9.GPIOParameters=GPIO_Label -PD9.GPIO_Label=STLK_TX [STM32F103CBT6_PA2] -PD9.Locked=true -PD9.Mode=Asynchronous -PD9.Signal=USART3_RX -PG6.GPIOParameters=GPIO_Label -PG6.GPIO_Label=USB_PowerSwitchOn [STMPS2151STR_EN] -PG6.Locked=true -PG6.Signal=GPIO_Output -PG7.GPIOParameters=GPIO_Label -PG7.GPIO_Label=USB_OverCurrent [STMPS2151STR_FAULT] -PG7.Locked=true -PG7.Signal=GPIO_Input -PH0\ -\ OSC_IN.GPIOParameters=GPIO_Label -PH0\ -\ OSC_IN.GPIO_Label=MCO -PH0\ -\ OSC_IN.Locked=true -PH0\ -\ OSC_IN.Mode=HSE-External-Clock-Source -PH0\ -\ OSC_IN.Signal=RCC_OSC_IN -PH1\ -\ OSC_OUT.Mode=HSE-External-Clock-Source -PH1\ -\ OSC_OUT.Signal=RCC_OSC_OUT -PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true -ProjectManager.BackupPrevious=false -ProjectManager.CompilerOptimize=6 -ProjectManager.ComputerToolchain=false -ProjectManager.CoupleFile=false -ProjectManager.CustomerFirmwarePackage= -ProjectManager.DefaultFWLocation=true -ProjectManager.DeletePrevious=true -ProjectManager.DeviceId=STM32F413ZHTx -ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.24.2 -ProjectManager.FreePins=false -ProjectManager.HalAssertFull=false -ProjectManager.HeapSize=0x200 -ProjectManager.KeepUserCode=true -ProjectManager.LastFirmware=true -ProjectManager.LibraryCopy=0 -ProjectManager.MainLocation=Src -ProjectManager.NoMain=false -ProjectManager.PreviousToolchain= -ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=CubeMX_Config.ioc -ProjectManager.ProjectName=CubeMX_Config -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_USART3_UART_Init-USART3-false-HAL-true,4-MX_USB_OTG_FS_PCD_Init-USB_OTG_FS-false-HAL-true -RCC.48MHZClocksFreq_Value=24000000 -RCC.ADC12outputFreq_Value=72000000 -RCC.ADC34outputFreq_Value=72000000 -RCC.AHBFreq_Value=96000000 -RCC.APB1CLKDivider=RCC_HCLK_DIV2 -RCC.APB1Freq_Value=48000000 -RCC.APB1TimFreq_Value=96000000 -RCC.APB2Freq_Value=96000000 -RCC.APB2TimFreq_Value=96000000 -RCC.CortexFreq_Value=96000000 -RCC.DFSDM2AudioFreq_Value=48000000 -RCC.DFSDMAudioFreq_Value=48000000 -RCC.DFSDMFreq_Value=96000000 -RCC.EthernetFreq_Value=8000000 -RCC.FCLKCortexFreq_Value=96000000 +PA9.GPIO_Label=USB_VBUS RCC.FMPI2C1Freq_Value=48000000 +RCC.VCOI2SInputFreq_Value=500000 +PH1\ -\ OSC_OUT.Mode=HSE-External-Clock-Source +PC2.Signal=SPI2_MISO +PA11.GPIO_Label=USB_DM +ProjectManager.DefaultFWLocation=true +PC2.Mode=Full_Duplex_Master +PD9.Signal=USART3_RX +ProjectManager.DeletePrevious=true +PB14.Locked=true +RCC.APB1CLKDivider=RCC_HCLK_DIV2 +PC14-OSC32_IN.Signal=RCC_OSC32_IN +boardIOC=true +PD6.Mode=Asynchronous +PA12.GPIO_Label=USB_DP RCC.FamilyName=M -RCC.HCLKFreq_Value=96000000 -RCC.HSE_VALUE=8000000 -RCC.HSI_VALUE=16000000 -RCC.I2C1Freq_Value=8000000 -RCC.I2C2Freq_Value=8000000 -RCC.I2C3Freq_Value=8000000 +VP_TIM11_VS_ClockSourceINT.Mode=Enable_Timer +PD8.GPIO_Label=STLK_RX [STM32F103CBT6_PA3] +RCC.WatchDogFreq_Value=32000 +PA13.Signal=SYS_JTMS-SWDIO +PA11.Locked=true +PA9.Mode=Activate_VBUS +PH0\ -\ OSC_IN.Mode=HSE-External-Clock-Source +PA8.GPIO_Label=USB_SOF [TP1] +PC15-OSC32_OUT.Locked=true +ProjectManager.TargetToolchain=MDK-ARM V5 +PB7.GPIOParameters=GPIO_Label +PB9.Mode=I2C +PA9.Signal=USB_OTG_FS_VBUS RCC.I2S1Freq_Value=48000000 -RCC.I2S2Freq_Value=48000000 -RCC.I2SClocksFreq_Value=48000000 -RCC.IPParameters=48MHZClocksFreq_Value,ADC12outputFreq_Value,ADC34outputFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,DFSDM2AudioFreq_Value,DFSDMAudioFreq_Value,DFSDMFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FMPI2C1Freq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2S1Freq_Value,I2S2Freq_Value,I2SClocksFreq_Value,LPTimerFreq_Value,LSI_VALUE,MCO1PinFreq_Value,MCO2PinFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLI2SPCLKFreq_Value,PLLI2SQCLKFreq_Value,PLLI2SQoutputFreq_Value,PLLI2SRCLKFreq_Value,PLLI2SoutputFreq_Value,PLLM,PLLMCOFreq_Value,PLLMUL,PLLN,PLLP,PLLQ,PLLQCLKFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLRoutputFreq_Value,PRESCALERUSB,PWRFreq_Value,RNGFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SAI1AFreq_Value,SAI1BFreq_Value,SDIOFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,SYSCLKSourceVirtual,TIM15Freq_Value,TIM16Freq_Value,TIM17Freq_Value,TIM1Freq_Value,TIM20Freq_Value,TIM2Freq_Value,TIM3Freq_Value,TIM8Freq_Value,UART4Freq_Value,UART5Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOI2SInputFreq_Value,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOInputMFreq_Value,VCOOutput2Freq_Value,VCOOutputFreq_Value,VcooutputI2S,WatchDogFreq_Value -RCC.LPTimerFreq_Value=48000000 -RCC.LSI_VALUE=32000 -RCC.MCO1PinFreq_Value=16000000 -RCC.MCO2PinFreq_Value=96000000 -RCC.MCOFreq_Value=72000000 -RCC.PLLCLKFreq_Value=96000000 -RCC.PLLI2SPCLKFreq_Value=48000000 -RCC.PLLI2SQCLKFreq_Value=48000000 -RCC.PLLI2SQoutputFreq_Value=48000000 -RCC.PLLI2SRCLKFreq_Value=48000000 -RCC.PLLI2SoutputFreq_Value=48000000 -RCC.PLLM=8 -RCC.PLLMCOFreq_Value=72000000 -RCC.PLLMUL=RCC_PLL_MUL9 -RCC.PLLN=384 -RCC.PLLP=RCC_PLLP_DIV4 -RCC.PLLQ=8 -RCC.PLLQCLKFreq_Value=48000000 -RCC.PLLQoutputFreq_Value=48000000 -RCC.PLLRCLKFreq_Value=192000000 -RCC.PLLRoutputFreq_Value=192000000 -RCC.PRESCALERUSB=RCC_USBCLKSOURCE_PLL_DIV1_5 -RCC.PWRFreq_Value=96000000 -RCC.RNGFreq_Value=48000000 -RCC.RTCFreq_Value=32000 -RCC.RTCHSEDivFreq_Value=4000000 -RCC.SAI1AFreq_Value=8000000 -RCC.SAI1BFreq_Value=8000000 -RCC.SDIOFreq_Value=48000000 -RCC.SYSCLKFreq_VALUE=96000000 -RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK -RCC.SYSCLKSourceVirtual=RCC_SYSCLKSOURCE_PLLCLK -RCC.TIM15Freq_Value=72000000 -RCC.TIM16Freq_Value=72000000 -RCC.TIM17Freq_Value=72000000 -RCC.TIM1Freq_Value=72000000 -RCC.TIM20Freq_Value=72000000 -RCC.TIM2Freq_Value=72000000 -RCC.TIM3Freq_Value=72000000 +SPI2.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate +RCC.VCOInputMFreq_Value=500000 +RCC.USBFreq_Value=48000000 +PC15-OSC32_OUT.Signal=RCC_OSC32_OUT +PD8.Mode=Asynchronous +PB10.Signal=SPI2_SCK +RCC.VCOI2SOutputFreq_Value=96000000 +PB14.Signal=GPIO_Output +PG6.GPIOParameters=GPIO_Label +PA5.Signal=ADCx_IN5 +PH1\ -\ OSC_OUT.Signal=RCC_OSC_OUT +board=NUCLEO-F413ZH +RCC.VCOOutputFreq_Value=384000000 +ProjectManager.LastFirmware=true +RCC.VCOOutput2Freq_Value=8000000 +VP_TIM13_VS_ClockSourceINT.Mode=Enable_Timer +RCC.APB2Freq_Value=96000000 RCC.TIM8Freq_Value=72000000 RCC.UART4Freq_Value=36000000 -RCC.UART5Freq_Value=36000000 -RCC.USART1Freq_Value=72000000 -RCC.USART2Freq_Value=36000000 -RCC.USART3Freq_Value=36000000 -RCC.USBFreq_Value=48000000 -RCC.VCOI2SInputFreq_Value=500000 -RCC.VCOI2SOutputFreq_Value=96000000 -RCC.VCOInputFreq_Value=1000000 -RCC.VCOInputMFreq_Value=500000 -RCC.VCOOutput2Freq_Value=8000000 -RCC.VCOOutputFreq_Value=384000000 -RCC.VcooutputI2S=48000000 -RCC.WatchDogFreq_Value=32000 -SH.GPXTI13.0=GPIO_EXTI13 -SH.GPXTI13.ConfNb=1 -USART3.IPParameters=VirtualMode -USART3.VirtualMode=VM_ASYNC -USB_OTG_FS.IPParameters=VirtualMode -USB_OTG_FS.VirtualMode=Device_Only +MxCube.Version=5.1.0 +RCC.PRESCALERUSB=RCC_USBCLKSOURCE_PLL_DIV1_5 +VP_TIM2_VS_ClockSourceINT.Mode=Internal +Mcu.Pin35=VP_TIM14_VS_ClockSourceINT +RCC.I2C1Freq_Value=8000000 +RCC.PLLI2SPCLKFreq_Value=48000000 +PC13.GPIOParameters=GPIO_Label +PG7.GPIO_Label=USB_OverCurrent [STMPS2151STR_FAULT] +RCC.RNGFreq_Value=48000000 +Mcu.Pin30=VP_RTC_VS_RTC_Activate +PA10.GPIOParameters=GPIO_Label VP_SYS_VS_Systick.Mode=SysTick -VP_SYS_VS_Systick.Signal=SYS_VS_Systick -board=NUCLEO-F413ZH -boardIOC=true +RCC.EthernetFreq_Value=8000000 +Mcu.Pin33=VP_TIM11_VS_ClockSourceINT +Mcu.Pin34=VP_TIM13_VS_ClockSourceINT +Mcu.Pin31=VP_SYS_VS_Systick +Mcu.Pin32=VP_TIM2_VS_ClockSourceINT +PA9.Locked=true +NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:true\:false +RCC.UART5Freq_Value=36000000 +PA13.Mode=Serial_Wire +ProjectManager.FreePins=false +RCC.IPParameters=48MHZClocksFreq_Value,ADC12outputFreq_Value,ADC34outputFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,DFSDM2AudioFreq_Value,DFSDMAudioFreq_Value,DFSDMFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FMPI2C1Freq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2S1Freq_Value,I2S2Freq_Value,I2SClocksFreq_Value,LPTimerFreq_Value,LSI_VALUE,MCO1PinFreq_Value,MCO2PinFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLI2SPCLKFreq_Value,PLLI2SQCLKFreq_Value,PLLI2SQoutputFreq_Value,PLLI2SRCLKFreq_Value,PLLI2SoutputFreq_Value,PLLM,PLLMCOFreq_Value,PLLMUL,PLLN,PLLP,PLLQ,PLLQCLKFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLRoutputFreq_Value,PRESCALERUSB,PWRFreq_Value,RNGFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SAI1AFreq_Value,SAI1BFreq_Value,SDIOFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,SYSCLKSourceVirtual,TIM15Freq_Value,TIM16Freq_Value,TIM17Freq_Value,TIM1Freq_Value,TIM20Freq_Value,TIM2Freq_Value,TIM3Freq_Value,TIM8Freq_Value,UART4Freq_Value,UART5Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOI2SInputFreq_Value,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOInputMFreq_Value,VCOOutput2Freq_Value,VCOOutputFreq_Value,VcooutputI2S,WatchDogFreq_Value +PC9.GPIOParameters=GPIO_Label +ProjectManager.AskForMigrate=true +Mcu.Name=STM32F413Z(G-H)Tx +RCC.PLLI2SQCLKFreq_Value=48000000 +Mcu.Pin26=PB6 +Mcu.Pin27=PB7 +RCC.RTCHSEDivFreq_Value=4000000 +PA2.Signal=USART2_TX +PA13.GPIO_Label=TMS +Mcu.Pin24=PD6 +ProjectManager.UnderRoot=false +Mcu.Pin25=PB3 +Mcu.IP8=TIM2 +Mcu.IP9=TIM11 +Mcu.Pin28=PB9 +Mcu.IP6=SPI2 +Mcu.Pin29=VP_IWDG_VS_IWDG +Mcu.IP7=SYS +ProjectManager.CoupleFile=false +RCC.48MHZClocksFreq_Value=24000000 +PB3.Signal=SYS_JTDO-SWO +RCC.SYSCLKFreq_VALUE=96000000 +Mcu.Pin22=PA13 +Mcu.Pin23=PA14 +Mcu.Pin20=PA11 +ADC1.master=1 +Mcu.Pin21=PA12 +PA12.Mode=Device_Only +PA10.Locked=true +NVIC.ForceEnableDMAVector=true +KeepUserPlacement=true +USART3.VirtualMode=VM_ASYNC +PA14.GPIOParameters=GPIO_Label +NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:true\:false +PA13.Locked=true +ProjectManager.CompilerOptimize=6 +PA11.Signal=USB_OTG_FS_DM +VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG +PA14.Signal=SYS_JTCK-SWCLK +ProjectManager.HeapSize=0x200 +Mcu.Pin15=PG7 +NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false +Mcu.Pin16=PC9 +SH.S_TIM2_CH4.0=TIM2_CH4,PWM Generation4 CH4 +Mcu.Pin13=PD9 +Mcu.Pin14=PG6 +Mcu.Pin19=PA10 +RCC.TIM20Freq_Value=72000000 +ProjectManager.ComputerToolchain=false +Mcu.Pin17=PA8 +RCC.HSI_VALUE=16000000 +Mcu.Pin18=PA9 +RCC.TIM3Freq_Value=72000000 +SH.ADCx_IN5.0=ADC1_IN5,IN5 +RCC.PLLP=RCC_PLLP_DIV4 +RCC.PLLQ=8 +NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 +ADC1.NbrOfConversionFlag=1 +Mcu.Pin11=PB14 +Mcu.Pin12=PD8 +RCC.PLLM=8 +RCC.PLLN=384 +Mcu.Pin10=PB10 +PB7.Locked=true +PA2.Mode=Asynchronous +RCC.PWRFreq_Value=96000000 +PH0\ -\ OSC_IN.GPIO_Label=MCO +PA8.Mode=Activate_SOF_FS +SH.ADCx_IN5.ConfNb=1 +PC9.Signal=GPIO_Output +RCC.I2C2Freq_Value=8000000 +PD9.Locked=true +RCC.APB1Freq_Value=48000000 +ProjectManager.DeviceId=STM32F413ZHTx +PG7.GPIOParameters=GPIO_Label +ProjectManager.LibraryCopy=0 diff --git a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Src/main.c b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Src/main.c index 516049000b..944059e771 100644 --- a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Src/main.c +++ b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Src/main.c @@ -62,6 +62,22 @@ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ +ADC_HandleTypeDef hadc1; + +I2C_HandleTypeDef hi2c1; + +IWDG_HandleTypeDef hiwdg; + +RTC_HandleTypeDef hrtc; + +SPI_HandleTypeDef hspi2; + +TIM_HandleTypeDef htim2; +TIM_HandleTypeDef htim11; +TIM_HandleTypeDef htim13; +TIM_HandleTypeDef htim14; + +UART_HandleTypeDef huart2; UART_HandleTypeDef huart3; PCD_HandleTypeDef hpcd_USB_OTG_FS; @@ -75,6 +91,16 @@ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_USART3_UART_Init(void); static void MX_USB_OTG_FS_PCD_Init(void); +static void MX_ADC1_Init(void); +static void MX_I2C1_Init(void); +static void MX_IWDG_Init(void); +static void MX_RTC_Init(void); +static void MX_SPI2_Init(void); +static void MX_TIM2_Init(void); +static void MX_TIM11_Init(void); +static void MX_TIM13_Init(void); +static void MX_TIM14_Init(void); +static void MX_USART2_UART_Init(void); /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ @@ -114,6 +140,16 @@ int main(void) MX_GPIO_Init(); MX_USART3_UART_Init(); MX_USB_OTG_FS_PCD_Init(); + MX_ADC1_Init(); + MX_I2C1_Init(); + MX_IWDG_Init(); + MX_RTC_Init(); + MX_SPI2_Init(); + MX_TIM2_Init(); + MX_TIM11_Init(); + MX_TIM13_Init(); + MX_TIM14_Init(); + MX_USART2_UART_Init(); /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ @@ -145,8 +181,9 @@ void SystemClock_Config(void) __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); /** Initializes the CPU, AHB and APB busses clocks */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLM = 8; @@ -171,7 +208,8 @@ void SystemClock_Config(void) { Error_Handler(); } - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_CLK48; + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI; PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLQ; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { @@ -179,6 +217,375 @@ void SystemClock_Config(void) } } +/** + * @brief ADC1 Initialization Function + * @param None + * @retval None + */ +static void MX_ADC1_Init(void) +{ + + /* USER CODE BEGIN ADC1_Init 0 */ + + /* USER CODE END ADC1_Init 0 */ + + ADC_ChannelConfTypeDef sConfig = {0}; + + /* USER CODE BEGIN ADC1_Init 1 */ + + /* USER CODE END ADC1_Init 1 */ + /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) + */ + hadc1.Instance = ADC1; + hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4; + hadc1.Init.Resolution = ADC_RESOLUTION_12B; + hadc1.Init.ScanConvMode = DISABLE; + hadc1.Init.ContinuousConvMode = DISABLE; + hadc1.Init.DiscontinuousConvMode = DISABLE; + hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; + hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; + hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; + hadc1.Init.NbrOfConversion = 1; + hadc1.Init.DMAContinuousRequests = DISABLE; + hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; + if (HAL_ADC_Init(&hadc1) != HAL_OK) + { + Error_Handler(); + } + /** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. + */ + sConfig.Channel = ADC_CHANNEL_5; + sConfig.Rank = 1; + sConfig.SamplingTime = ADC_SAMPLETIME_3CYCLES; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN ADC1_Init 2 */ + + /* USER CODE END ADC1_Init 2 */ + +} + +/** + * @brief I2C1 Initialization Function + * @param None + * @retval None + */ +static void MX_I2C1_Init(void) +{ + + /* USER CODE BEGIN I2C1_Init 0 */ + + /* USER CODE END I2C1_Init 0 */ + + /* USER CODE BEGIN I2C1_Init 1 */ + + /* USER CODE END I2C1_Init 1 */ + hi2c1.Instance = I2C1; + hi2c1.Init.ClockSpeed = 100000; + hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2; + hi2c1.Init.OwnAddress1 = 0; + hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; + hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; + hi2c1.Init.OwnAddress2 = 0; + hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; + hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; + if (HAL_I2C_Init(&hi2c1) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN I2C1_Init 2 */ + + /* USER CODE END I2C1_Init 2 */ + +} + +/** + * @brief IWDG Initialization Function + * @param None + * @retval None + */ +static void MX_IWDG_Init(void) +{ + + /* USER CODE BEGIN IWDG_Init 0 */ + + /* USER CODE END IWDG_Init 0 */ + + /* USER CODE BEGIN IWDG_Init 1 */ + + /* USER CODE END IWDG_Init 1 */ + hiwdg.Instance = IWDG; + hiwdg.Init.Prescaler = IWDG_PRESCALER_4; + hiwdg.Init.Reload = 4095; + if (HAL_IWDG_Init(&hiwdg) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN IWDG_Init 2 */ + + /* USER CODE END IWDG_Init 2 */ + +} + +/** + * @brief RTC Initialization Function + * @param None + * @retval None + */ +static void MX_RTC_Init(void) +{ + + /* USER CODE BEGIN RTC_Init 0 */ + + /* USER CODE END RTC_Init 0 */ + + /* USER CODE BEGIN RTC_Init 1 */ + + /* USER CODE END RTC_Init 1 */ + /** Initialize RTC Only + */ + hrtc.Instance = RTC; + hrtc.Init.HourFormat = RTC_HOURFORMAT_24; + hrtc.Init.AsynchPrediv = 127; + hrtc.Init.SynchPrediv = 255; + hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; + hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; + hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; + if (HAL_RTC_Init(&hrtc) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN RTC_Init 2 */ + + /* USER CODE END RTC_Init 2 */ + +} + +/** + * @brief SPI2 Initialization Function + * @param None + * @retval None + */ +static void MX_SPI2_Init(void) +{ + + /* USER CODE BEGIN SPI2_Init 0 */ + + /* USER CODE END SPI2_Init 0 */ + + /* USER CODE BEGIN SPI2_Init 1 */ + + /* USER CODE END SPI2_Init 1 */ + /* SPI2 parameter configuration*/ + hspi2.Instance = SPI2; + hspi2.Init.Mode = SPI_MODE_MASTER; + hspi2.Init.Direction = SPI_DIRECTION_2LINES; + hspi2.Init.DataSize = SPI_DATASIZE_8BIT; + hspi2.Init.CLKPolarity = SPI_POLARITY_LOW; + hspi2.Init.CLKPhase = SPI_PHASE_1EDGE; + hspi2.Init.NSS = SPI_NSS_SOFT; + hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; + hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB; + hspi2.Init.TIMode = SPI_TIMODE_DISABLE; + hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; + hspi2.Init.CRCPolynomial = 10; + if (HAL_SPI_Init(&hspi2) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN SPI2_Init 2 */ + + /* USER CODE END SPI2_Init 2 */ + +} + +/** + * @brief TIM2 Initialization Function + * @param None + * @retval None + */ +static void MX_TIM2_Init(void) +{ + + /* USER CODE BEGIN TIM2_Init 0 */ + + /* USER CODE END TIM2_Init 0 */ + + TIM_ClockConfigTypeDef sClockSourceConfig = {0}; + TIM_MasterConfigTypeDef sMasterConfig = {0}; + TIM_OC_InitTypeDef sConfigOC = {0}; + + /* USER CODE BEGIN TIM2_Init 1 */ + + /* USER CODE END TIM2_Init 1 */ + htim2.Instance = TIM2; + htim2.Init.Prescaler = 0; + htim2.Init.CounterMode = TIM_COUNTERMODE_UP; + htim2.Init.Period = 0; + htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; + if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_PWM_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_PWM1; + sConfigOC.Pulse = 0; + sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; + sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; + if (HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_4) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM2_Init 2 */ + + /* USER CODE END TIM2_Init 2 */ + HAL_TIM_MspPostInit(&htim2); + +} + +/** + * @brief TIM11 Initialization Function + * @param None + * @retval None + */ +static void MX_TIM11_Init(void) +{ + + /* USER CODE BEGIN TIM11_Init 0 */ + + /* USER CODE END TIM11_Init 0 */ + + /* USER CODE BEGIN TIM11_Init 1 */ + + /* USER CODE END TIM11_Init 1 */ + htim11.Instance = TIM11; + htim11.Init.Prescaler = 0; + htim11.Init.CounterMode = TIM_COUNTERMODE_UP; + htim11.Init.Period = 0; + htim11.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim11.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim11) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM11_Init 2 */ + + /* USER CODE END TIM11_Init 2 */ + +} + +/** + * @brief TIM13 Initialization Function + * @param None + * @retval None + */ +static void MX_TIM13_Init(void) +{ + + /* USER CODE BEGIN TIM13_Init 0 */ + + /* USER CODE END TIM13_Init 0 */ + + /* USER CODE BEGIN TIM13_Init 1 */ + + /* USER CODE END TIM13_Init 1 */ + htim13.Instance = TIM13; + htim13.Init.Prescaler = 0; + htim13.Init.CounterMode = TIM_COUNTERMODE_UP; + htim13.Init.Period = 0; + htim13.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim13.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim13) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM13_Init 2 */ + + /* USER CODE END TIM13_Init 2 */ + +} + +/** + * @brief TIM14 Initialization Function + * @param None + * @retval None + */ +static void MX_TIM14_Init(void) +{ + + /* USER CODE BEGIN TIM14_Init 0 */ + + /* USER CODE END TIM14_Init 0 */ + + /* USER CODE BEGIN TIM14_Init 1 */ + + /* USER CODE END TIM14_Init 1 */ + htim14.Instance = TIM14; + htim14.Init.Prescaler = 0; + htim14.Init.CounterMode = TIM_COUNTERMODE_UP; + htim14.Init.Period = 0; + htim14.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim14.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim14) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM14_Init 2 */ + + /* USER CODE END TIM14_Init 2 */ + +} + +/** + * @brief USART2 Initialization Function + * @param None + * @retval None + */ +static void MX_USART2_UART_Init(void) +{ + + /* USER CODE BEGIN USART2_Init 0 */ + + /* USER CODE END USART2_Init 0 */ + + /* USER CODE BEGIN USART2_Init 1 */ + + /* USER CODE END USART2_Init 1 */ + huart2.Instance = USART2; + huart2.Init.BaudRate = 115200; + huart2.Init.WordLength = UART_WORDLENGTH_8B; + huart2.Init.StopBits = UART_STOPBITS_1; + huart2.Init.Parity = UART_PARITY_NONE; + huart2.Init.Mode = UART_MODE_TX_RX; + huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; + huart2.Init.OverSampling = UART_OVERSAMPLING_16; + if (HAL_UART_Init(&huart2) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN USART2_Init 2 */ + + /* USER CODE END USART2_Init 2 */ + +} + /** * @brief USART3 Initialization Function * @param None @@ -260,10 +667,10 @@ static void MX_GPIO_Init(void) /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOB, LD3_Pin|LD2_Pin, GPIO_PIN_RESET); diff --git a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c index d3fdab64dc..b70b0c1c20 100644 --- a/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c +++ b/bsp/stm32/stm32f413-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c @@ -78,7 +78,9 @@ /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ -/** + +void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); + /** * Initializes the Global MSP. */ void HAL_MspInit(void) @@ -97,6 +99,389 @@ void HAL_MspInit(void) /* USER CODE END MspInit 1 */ } +/** +* @brief ADC MSP Initialization +* This function configures the hardware resources used in this example +* @param hadc: ADC handle pointer +* @retval None +*/ +void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc) +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(hadc->Instance==ADC1) + { + /* USER CODE BEGIN ADC1_MspInit 0 */ + + /* USER CODE END ADC1_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_ADC1_CLK_ENABLE(); + + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**ADC1 GPIO Configuration + PA5 ------> ADC1_IN5 + */ + GPIO_InitStruct.Pin = GPIO_PIN_5; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* USER CODE BEGIN ADC1_MspInit 1 */ + + /* USER CODE END ADC1_MspInit 1 */ + } + +} + +/** +* @brief ADC MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param hadc: ADC handle pointer +* @retval None +*/ +void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc) +{ + if(hadc->Instance==ADC1) + { + /* USER CODE BEGIN ADC1_MspDeInit 0 */ + + /* USER CODE END ADC1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_ADC1_CLK_DISABLE(); + + /**ADC1 GPIO Configuration + PA5 ------> ADC1_IN5 + */ + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5); + + /* USER CODE BEGIN ADC1_MspDeInit 1 */ + + /* USER CODE END ADC1_MspDeInit 1 */ + } + +} + +/** +* @brief I2C MSP Initialization +* This function configures the hardware resources used in this example +* @param hi2c: I2C handle pointer +* @retval None +*/ +void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c) +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(hi2c->Instance==I2C1) + { + /* USER CODE BEGIN I2C1_MspInit 0 */ + + /* USER CODE END I2C1_MspInit 0 */ + + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**I2C1 GPIO Configuration + PB6 ------> I2C1_SCL + PB9 ------> I2C1_SDA + */ + GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_9; + GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF4_I2C1; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* Peripheral clock enable */ + __HAL_RCC_I2C1_CLK_ENABLE(); + /* USER CODE BEGIN I2C1_MspInit 1 */ + + /* USER CODE END I2C1_MspInit 1 */ + } + +} + +/** +* @brief I2C MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param hi2c: I2C handle pointer +* @retval None +*/ +void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c) +{ + if(hi2c->Instance==I2C1) + { + /* USER CODE BEGIN I2C1_MspDeInit 0 */ + + /* USER CODE END I2C1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_I2C1_CLK_DISABLE(); + + /**I2C1 GPIO Configuration + PB6 ------> I2C1_SCL + PB9 ------> I2C1_SDA + */ + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_9); + + /* USER CODE BEGIN I2C1_MspDeInit 1 */ + + /* USER CODE END I2C1_MspDeInit 1 */ + } + +} + +/** +* @brief RTC MSP Initialization +* This function configures the hardware resources used in this example +* @param hrtc: RTC handle pointer +* @retval None +*/ +void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc) +{ + if(hrtc->Instance==RTC) + { + /* USER CODE BEGIN RTC_MspInit 0 */ + + /* USER CODE END RTC_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_RTC_ENABLE(); + /* USER CODE BEGIN RTC_MspInit 1 */ + + /* USER CODE END RTC_MspInit 1 */ + } + +} + +/** +* @brief RTC MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param hrtc: RTC handle pointer +* @retval None +*/ +void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc) +{ + if(hrtc->Instance==RTC) + { + /* USER CODE BEGIN RTC_MspDeInit 0 */ + + /* USER CODE END RTC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RTC_DISABLE(); + /* USER CODE BEGIN RTC_MspDeInit 1 */ + + /* USER CODE END RTC_MspDeInit 1 */ + } + +} + +/** +* @brief SPI MSP Initialization +* This function configures the hardware resources used in this example +* @param hspi: SPI handle pointer +* @retval None +*/ +void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi) +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(hspi->Instance==SPI2) + { + /* USER CODE BEGIN SPI2_MspInit 0 */ + + /* USER CODE END SPI2_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_SPI2_CLK_ENABLE(); + + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**SPI2 GPIO Configuration + PC2 ------> SPI2_MISO + PC3 ------> SPI2_MOSI + PB10 ------> SPI2_SCK + */ + GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_10; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN SPI2_MspInit 1 */ + + /* USER CODE END SPI2_MspInit 1 */ + } + +} + +/** +* @brief SPI MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param hspi: SPI handle pointer +* @retval None +*/ +void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi) +{ + if(hspi->Instance==SPI2) + { + /* USER CODE BEGIN SPI2_MspDeInit 0 */ + + /* USER CODE END SPI2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_SPI2_CLK_DISABLE(); + + /**SPI2 GPIO Configuration + PC2 ------> SPI2_MISO + PC3 ------> SPI2_MOSI + PB10 ------> SPI2_SCK + */ + HAL_GPIO_DeInit(GPIOC, GPIO_PIN_2|GPIO_PIN_3); + + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10); + + /* USER CODE BEGIN SPI2_MspDeInit 1 */ + + /* USER CODE END SPI2_MspDeInit 1 */ + } + +} + +/** +* @brief TIM_Base MSP Initialization +* This function configures the hardware resources used in this example +* @param htim_base: TIM_Base handle pointer +* @retval None +*/ +void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base) +{ + if(htim_base->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspInit 0 */ + + /* USER CODE END TIM2_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_TIM2_CLK_ENABLE(); + /* USER CODE BEGIN TIM2_MspInit 1 */ + + /* USER CODE END TIM2_MspInit 1 */ + } + else if(htim_base->Instance==TIM11) + { + /* USER CODE BEGIN TIM11_MspInit 0 */ + + /* USER CODE END TIM11_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_TIM11_CLK_ENABLE(); + /* USER CODE BEGIN TIM11_MspInit 1 */ + + /* USER CODE END TIM11_MspInit 1 */ + } + else if(htim_base->Instance==TIM13) + { + /* USER CODE BEGIN TIM13_MspInit 0 */ + + /* USER CODE END TIM13_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_TIM13_CLK_ENABLE(); + /* USER CODE BEGIN TIM13_MspInit 1 */ + + /* USER CODE END TIM13_MspInit 1 */ + } + else if(htim_base->Instance==TIM14) + { + /* USER CODE BEGIN TIM14_MspInit 0 */ + + /* USER CODE END TIM14_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_TIM14_CLK_ENABLE(); + /* USER CODE BEGIN TIM14_MspInit 1 */ + + /* USER CODE END TIM14_MspInit 1 */ + } + +} + +void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim) +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(htim->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspPostInit 0 */ + + /* USER CODE END TIM2_MspPostInit 0 */ + + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**TIM2 GPIO Configuration + PA3 ------> TIM2_CH4 + */ + GPIO_InitStruct.Pin = GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF1_TIM2; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* USER CODE BEGIN TIM2_MspPostInit 1 */ + + /* USER CODE END TIM2_MspPostInit 1 */ + } + +} +/** +* @brief TIM_Base MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param htim_base: TIM_Base handle pointer +* @retval None +*/ +void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base) +{ + if(htim_base->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspDeInit 0 */ + + /* USER CODE END TIM2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM2_CLK_DISABLE(); + /* USER CODE BEGIN TIM2_MspDeInit 1 */ + + /* USER CODE END TIM2_MspDeInit 1 */ + } + else if(htim_base->Instance==TIM11) + { + /* USER CODE BEGIN TIM11_MspDeInit 0 */ + + /* USER CODE END TIM11_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM11_CLK_DISABLE(); + /* USER CODE BEGIN TIM11_MspDeInit 1 */ + + /* USER CODE END TIM11_MspDeInit 1 */ + } + else if(htim_base->Instance==TIM13) + { + /* USER CODE BEGIN TIM13_MspDeInit 0 */ + + /* USER CODE END TIM13_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM13_CLK_DISABLE(); + /* USER CODE BEGIN TIM13_MspDeInit 1 */ + + /* USER CODE END TIM13_MspDeInit 1 */ + } + else if(htim_base->Instance==TIM14) + { + /* USER CODE BEGIN TIM14_MspDeInit 0 */ + + /* USER CODE END TIM14_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM14_CLK_DISABLE(); + /* USER CODE BEGIN TIM14_MspDeInit 1 */ + + /* USER CODE END TIM14_MspDeInit 1 */ + } + +} + /** * @brief UART MSP Initialization * This function configures the hardware resources used in this example @@ -106,7 +491,39 @@ void HAL_MspInit(void) void HAL_UART_MspInit(UART_HandleTypeDef* huart) { GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(huart->Instance==USART3) + if(huart->Instance==USART2) + { + /* USER CODE BEGIN USART2_MspInit 0 */ + + /* USER CODE END USART2_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_USART2_CLK_ENABLE(); + + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + /**USART2 GPIO Configuration + PA2 ------> USART2_TX + PD6 ------> USART2_RX + */ + GPIO_InitStruct.Pin = GPIO_PIN_2; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF7_USART2; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_6; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF7_USART2; + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + + /* USER CODE BEGIN USART2_MspInit 1 */ + + /* USER CODE END USART2_MspInit 1 */ + } + else if(huart->Instance==USART3) { /* USER CODE BEGIN USART3_MspInit 0 */ @@ -141,7 +558,27 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart) */ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart) { - if(huart->Instance==USART3) + if(huart->Instance==USART2) + { + /* USER CODE BEGIN USART2_MspDeInit 0 */ + + /* USER CODE END USART2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_USART2_CLK_DISABLE(); + + /**USART2 GPIO Configuration + PA2 ------> USART2_TX + PD6 ------> USART2_RX + */ + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2); + + HAL_GPIO_DeInit(GPIOD, GPIO_PIN_6); + + /* USER CODE BEGIN USART2_MspDeInit 1 */ + + /* USER CODE END USART2_MspDeInit 1 */ + } + else if(huart->Instance==USART3) { /* USER CODE BEGIN USART3_MspDeInit 0 */ diff --git a/bsp/stm32/stm32f413-st-nucleo/board/Kconfig b/bsp/stm32/stm32f413-st-nucleo/board/Kconfig index ff025ae50e..6fea77139e 100644 --- a/bsp/stm32/stm32f413-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f413-st-nucleo/board/Kconfig @@ -44,7 +44,113 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART3 && RT_SERIAL_USING_DMA default n endif + + menuconfig BSP_USING_SPI + bool "Enable SPI BUS" + default n + select RT_USING_SPI + if BSP_USING_SPI + config BSP_USING_SPI2 + bool "Enable SPI2 BUS" + default n + + config BSP_SPI2_TX_USING_DMA + bool "Enable SPI2 TX DMA" + depends on BSP_USING_SPI2 + default n + + config BSP_SPI2_RX_USING_DMA + bool "Enable SPI2 RX DMA" + depends on BSP_USING_SPI2 + select BSP_SPI2_TX_USING_DMA + default n + + endif + menuconfig BSP_USING_I2C1 + bool "Enable I2C1 BUS (software simulation)" + default n + select RT_USING_I2C + select RT_USING_I2C_BITOPS + select RT_USING_PIN + if BSP_USING_I2C1 + comment "Notice: PB6 --> 136; PB9 --> 140" + config BSP_I2C1_SCL_PIN + int "I2C1 scl pin number" + range 1 144 + default 136 + config BSP_I2C1_SDA_PIN + int "I2C1 sda pin number" + range 1 144 + default 140 + endif + + menuconfig BSP_USING_TIM + bool "Enable timer" + default n + select RT_USING_HWTIMER + if BSP_USING_TIM + config BSP_USING_TIM11 + bool "Enable TIM11" + default n + + config BSP_USING_TIM13 + bool "Enable TIM13" + default n + + config BSP_USING_TIM14 + bool "Enable TIM14" + default n + endif + + menuconfig BSP_USING_PWM + bool "Enable pwm" + default n + select RT_USING_PWM + if BSP_USING_PWM + menuconfig BSP_USING_PWM2 + bool "Enable timer2 output pwm" + default n + if BSP_USING_PWM2 + config BSP_USING_PWM2_CH4 + bool "Enable PWM2 channel4" + default n + endif + endif + + menuconfig BSP_USING_ADC + bool "Enable ADC" + default n + select RT_USING_ADC + if BSP_USING_ADC + config BSP_USING_ADC1 + bool "Enable ADC1" + default n + endif + + menuconfig BSP_USING_ONCHIP_RTC + bool "Enable RTC" + select RT_USING_RTC + select RT_USING_LIBC + default n + if BSP_USING_ONCHIP_RTC + choice + prompt "Select clock source" + default BSP_RTC_USING_LSE + + config BSP_RTC_USING_LSE + bool "RTC USING LSE" + + config BSP_RTC_USING_LSI + bool "RTC USING LSI" + endchoice + endif + + config BSP_USING_WDT + bool "Enable Watchdog Timer" + select RT_USING_WDT + default n + config BSP_USING_ON_CHIP_FLASH bool "Enable on-chip FLASH" default n diff --git a/bsp/stm32/stm32f413-st-nucleo/board/board.c b/bsp/stm32/stm32f413-st-nucleo/board/board.c index b63870d40c..dffc5bba40 100644 --- a/bsp/stm32/stm32f413-st-nucleo/board/board.c +++ b/bsp/stm32/stm32f413-st-nucleo/board/board.c @@ -26,8 +26,9 @@ void SystemClock_Config(void) __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); /** Initializes the CPU, AHB and APB busses clocks */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLM = 8; @@ -52,7 +53,8 @@ void SystemClock_Config(void) { Error_Handler(); } - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_CLK48; + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI; PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLQ; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { diff --git a/bsp/stm32/stm32f413-st-nucleo/project.ewp b/bsp/stm32/stm32f413-st-nucleo/project.ewp index 1f62f5577d..9fc1c540d2 100644 --- a/bsp/stm32/stm32f413-st-nucleo/project.ewp +++ b/bsp/stm32/stm32f413-st-nucleo/project.ewp @@ -2180,6 +2180,9 @@ $PROJ_DIR$\..\..\..\components\drivers\src\workqueue.c + + $PROJ_DIR$\..\..\..\components\drivers\watchdog\watchdog.c + finsh @@ -2252,5 +2255,11 @@ $PROJ_DIR$\..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_usart.c + + $PROJ_DIR$\..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_iwdg.c + + + $PROJ_DIR$\..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_wwdg.c + diff --git a/bsp/stm32/stm32f413-st-nucleo/project.uvopt b/bsp/stm32/stm32f413-st-nucleo/project.uvopt index 68d5d3a75c..b53d69d5df 100644 --- a/bsp/stm32/stm32f413-st-nucleo/project.uvopt +++ b/bsp/stm32/stm32f413-st-nucleo/project.uvopt @@ -71,21 +71,11 @@ 0 - 1 + 0 0 1 255 - - SARMCM3.DLL - -MPU -REMAP - DCM.DLL - -pCM4 - SARMCM3.DLL - -MPU - TCM.DLL - -pCM4 - 0 1 @@ -104,9 +94,12 @@ 0 1 0 + 1 + 1 + 0 0 0 - 7 + 6 @@ -132,6 +125,9 @@ + + 0 + 0 0 @@ -158,972 +154,9 @@ 0 0 - - 0 - - - Kernel - 0 - 0 - 0 - 0 - - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\clock.c - clock.c - 0 - 0 - - - 1 - 2 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\components.c - components.c - 0 - 0 - - - 1 - 3 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\device.c - device.c - 0 - 0 - - - 1 - 4 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\idle.c - idle.c - 0 - 0 - - - 1 - 5 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\ipc.c - ipc.c - 0 - 0 - - - 1 - 6 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\irq.c - irq.c - 0 - 0 - - - 1 - 7 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\kservice.c - kservice.c - 0 - 0 - - - 1 - 8 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\mem.c - mem.c - 0 - 0 - - - 1 - 9 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\mempool.c - mempool.c - 0 - 0 - - - 1 - 10 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\object.c - object.c - 0 - 0 - - - 1 - 11 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\scheduler.c - scheduler.c - 0 - 0 - - - 1 - 12 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\signal.c - signal.c - 0 - 0 - - - 1 - 13 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\thread.c - thread.c - 0 - 0 - - - 1 - 14 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\src\timer.c - timer.c - 0 - 0 - - - - - Applications - 1 - 0 - 0 - 0 - - 2 - 15 - 1 - 0 - 0 - 0 - 0 - 1 - 1 - 0 - applications\main.c - main.c - 0 - 0 - - - - - Drivers - 0 - 0 - 0 - 0 - - 3 - 16 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - board\board.c - board.c - 0 - 0 - - - 3 - 17 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - board\CubeMX_Config\Src\stm32f4xx_hal_msp.c - stm32f4xx_hal_msp.c - 0 - 0 - - - 3 - 18 - 2 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f413xx.s - startup_stm32f413xx.s - 0 - 0 - - - 3 - 19 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\HAL_Drivers\drv_gpio.c - drv_gpio.c - 0 - 0 - - - 3 - 20 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\HAL_Drivers\drv_usart.c - drv_usart.c - 0 - 0 - - - 3 - 21 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\HAL_Drivers\drv_common.c - drv_common.c - 0 - 0 - - - - - cpu - 0 - 0 - 0 - 0 - - 4 - 22 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\libcpu\arm\common\backtrace.c - backtrace.c - 0 - 0 - - - 4 - 23 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\libcpu\arm\common\div0.c - div0.c - 0 - 0 - - - 4 - 24 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\libcpu\arm\common\showmem.c - showmem.c - 0 - 0 - - - 4 - 25 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\libcpu\arm\cortex-m4\cpuport.c - cpuport.c - 0 - 0 - - - 4 - 26 - 2 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\libcpu\arm\cortex-m4\context_rvds.S - context_rvds.S - 0 - 0 - - - - - DeviceDrivers - 0 - 0 - 0 - 0 - - 5 - 27 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\drivers\misc\pin.c - pin.c - 0 - 0 - - - 5 - 28 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\drivers\serial\serial.c - serial.c - 0 - 0 - - - 5 - 29 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\drivers\src\completion.c - completion.c - 0 - 0 - - - 5 - 30 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\drivers\src\dataqueue.c - dataqueue.c - 0 - 0 - - - 5 - 31 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\drivers\src\pipe.c - pipe.c - 0 - 0 - - - 5 - 32 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\drivers\src\ringblk_buf.c - ringblk_buf.c - 0 - 0 - - - 5 - 33 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\drivers\src\ringbuffer.c - ringbuffer.c - 0 - 0 - - - 5 - 34 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\drivers\src\waitqueue.c - waitqueue.c - 0 - 0 - - - 5 - 35 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\drivers\src\workqueue.c - workqueue.c - 0 - 0 - - - - - finsh - 0 - 0 - 0 - 0 - - 6 - 36 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\finsh\shell.c - shell.c - 0 - 0 - - - 6 - 37 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\finsh\cmd.c - cmd.c - 0 - 0 - - - 6 - 38 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\finsh\msh.c - msh.c - 0 - 0 - - - - - libc - 0 - 0 - 0 - 0 - - 7 - 39 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\..\..\components\libc\compilers\common\time.c - time.c - 0 - 0 - - - - - STM32_HAL - 0 - 0 - 0 - 0 - - 8 - 40 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c - system_stm32f4xx.c - 0 - 0 - - - 8 - 41 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c - stm32f4xx_hal.c - 0 - 0 - - - 8 - 42 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cec.c - stm32f4xx_hal_cec.c - 0 - 0 - - - 8 - 43 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c - stm32f4xx_hal_cortex.c - 0 - 0 - - - 8 - 44 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.c - stm32f4xx_hal_crc.c - 0 - 0 - - - 8 - 45 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cryp.c - stm32f4xx_hal_cryp.c - 0 - 0 - - - 8 - 46 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cryp_ex.c - stm32f4xx_hal_cryp_ex.c - 0 - 0 - - - 8 - 47 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c - stm32f4xx_hal_dma.c - 0 - 0 - - - 8 - 48 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c - stm32f4xx_hal_dma_ex.c - 0 - 0 - - - 8 - 49 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c - stm32f4xx_hal_pwr.c - 0 - 0 - - - 8 - 50 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c - stm32f4xx_hal_pwr_ex.c - 0 - 0 - - - 8 - 51 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c - stm32f4xx_hal_rcc.c - 0 - 0 - - - 8 - 52 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c - stm32f4xx_hal_rcc_ex.c - 0 - 0 - - - 8 - 53 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c - stm32f4xx_hal_rng.c - 0 - 0 - - - 8 - 54 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c - stm32f4xx_hal_gpio.c - 0 - 0 - - - 8 - 55 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c - stm32f4xx_hal_uart.c - 0 - 0 - - - 8 - 56 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_usart.c - stm32f4xx_hal_usart.c - 0 - 0 - - - diff --git a/bsp/stm32/stm32f413-st-nucleo/project.uvoptx b/bsp/stm32/stm32f413-st-nucleo/project.uvoptx index 0253b47b87..0c83936531 100644 --- a/bsp/stm32/stm32f413-st-nucleo/project.uvoptx +++ b/bsp/stm32/stm32f413-st-nucleo/project.uvoptx @@ -73,7 +73,7 @@ 0 - 0 + 1 0 1 @@ -140,7 +140,7 @@ 0 ST-LINKIII-KEIL_SWO - -U-O206 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1536.FLM -FS08000000 -FL0180000 -FP0($$Device:STM32F413ZHTx$CMSIS\Flash\STM32F4xx_1536.FLM) + -U-O206 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1536.FLM -FS08000000 -FL0180000 -FP0($$Device:STM32F413ZHTx$CMSIS\Flash\STM32F4xx_1536.FLM) 0 @@ -198,6 +198,7 @@ 1 + 0 0 2 10000000 @@ -663,6 +664,18 @@ 0 0 + + 5 + 36 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\watchdog\watchdog.c + watchdog.c + 0 + 0 + @@ -673,7 +686,7 @@ 0 6 - 36 + 37 1 0 0 @@ -685,7 +698,7 @@ 6 - 37 + 38 1 0 0 @@ -697,7 +710,7 @@ 6 - 38 + 39 1 0 0 @@ -717,7 +730,7 @@ 0 7 - 39 + 40 1 0 0 @@ -737,7 +750,7 @@ 0 8 - 40 + 41 1 0 0 @@ -749,7 +762,7 @@ 8 - 41 + 42 1 0 0 @@ -761,7 +774,7 @@ 8 - 42 + 43 1 0 0 @@ -773,7 +786,7 @@ 8 - 43 + 44 1 0 0 @@ -785,7 +798,7 @@ 8 - 44 + 45 1 0 0 @@ -797,7 +810,7 @@ 8 - 45 + 46 1 0 0 @@ -809,7 +822,7 @@ 8 - 46 + 47 1 0 0 @@ -821,7 +834,7 @@ 8 - 47 + 48 1 0 0 @@ -833,7 +846,7 @@ 8 - 48 + 49 1 0 0 @@ -845,7 +858,7 @@ 8 - 49 + 50 1 0 0 @@ -857,7 +870,7 @@ 8 - 50 + 51 1 0 0 @@ -869,7 +882,7 @@ 8 - 51 + 52 1 0 0 @@ -881,7 +894,7 @@ 8 - 52 + 53 1 0 0 @@ -893,7 +906,7 @@ 8 - 53 + 54 1 0 0 @@ -905,7 +918,7 @@ 8 - 54 + 55 1 0 0 @@ -917,7 +930,7 @@ 8 - 55 + 56 1 0 0 @@ -929,7 +942,7 @@ 8 - 56 + 57 1 0 0 @@ -939,6 +952,30 @@ 0 0 + + 8 + 58 + 1 + 0 + 0 + 0 + ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_iwdg.c + stm32f4xx_hal_iwdg.c + 0 + 0 + + + 8 + 59 + 1 + 0 + 0 + 0 + ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_wwdg.c + stm32f4xx_hal_wwdg.c + 0 + 0 + diff --git a/bsp/stm32/stm32f413-st-nucleo/project.uvproj b/bsp/stm32/stm32f413-st-nucleo/project.uvproj index 5b4ca2796b..f87c223adc 100644 --- a/bsp/stm32/stm32f413-st-nucleo/project.uvproj +++ b/bsp/stm32/stm32f413-st-nucleo/project.uvproj @@ -1,10 +1,7 @@ - 1.1 -
### uVision Project, (C) Keil Software
- rt-thread @@ -15,25 +12,26 @@ STM32F407ZG STMicroelectronics IRAM(0x20000000-0x2001FFFF) IRAM2(0x10000000-0x1000FFFF) IROM(0x8000000-0x80FFFFF) CLOCK(25000000) CPUTYPE("Cortex-M4") FPU2 - + "Startup\ST\STM32F4xx\startup_stm32f40_41xxx.s" ("STM32F40/41xxx Startup Code") UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000) 6105 stm32f4xx.h - - - - - - + + + + + + -DSTM32F40_41xxx - - + + SFD\ST\STM32F4xx\STM32F40x.sfr + 0 0 - - - + + + ST\STM32F4xx\ ST\STM32F4xx\ @@ -57,8 +55,8 @@ 0 0 - - + + 0 0 0 @@ -67,8 +65,8 @@ 0 0 - - + + 0 0 @@ -76,12 +74,12 @@ 1 0 fromelf --bin !L --output rtthread.bin - + 0 0 0 - + 0 @@ -95,8 +93,9 @@ 0 0 3 - - + + + 1 SARMCM3.DLL @@ -126,6 +125,7 @@ 1 1 0 + 1 1 @@ -137,22 +137,24 @@ 0 1 0 + 1 + 0 0 - 7 + 6 - - - - - + + + + + - - - - - + + + + + Segger\JL2CM3.dll @@ -165,9 +167,14 @@ 1 4096 + 1 BIN\UL2CM3.DLL "" () - + + + + + 0 @@ -199,7 +206,7 @@ 0 0 "Cortex-M4" - + 0 0 0 @@ -330,7 +337,7 @@ 0x10000 - + 1 @@ -346,11 +353,13 @@ 0 0 0 + 1 + 0 - + USE_HAL_DRIVER, STM32F413xx - - .;..\..\..\include;applications;.;board;board\CubeMX_Config\Inc;..\libraries\HAL_Drivers;..\libraries\HAL_Drivers\config;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\finsh;..\..\..\components\libc\compilers\common;..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc;..\libraries\STM32F4xx_HAL\CMSIS\Device\ST\STM32F4xx\Include;..\libraries\STM32F4xx_HAL\CMSIS\Include + + .;..\..\..\include;applications;.;board;board\CubeMX_Config\Inc;..\libraries\HAL_Drivers;..\libraries\HAL_Drivers\config;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\finsh;..\..\..\components\libc\compilers\common;..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc;..\libraries\STM32F4xx_HAL\CMSIS\Device\ST\STM32F4xx\Include;..\libraries\STM32F4xx_HAL\CMSIS\Include @@ -362,11 +371,12 @@ 0 0 0 + 0 - - - - + + + + @@ -378,12 +388,13 @@ 0 0x08000000 0x20000000 + .\board\linker_scripts\link.sct - - - - - + + + + + @@ -396,66 +407,92 @@ 1 ..\..\..\src\clock.c + + components.c 1 ..\..\..\src\components.c + + device.c 1 ..\..\..\src\device.c + + idle.c 1 ..\..\..\src\idle.c + + ipc.c 1 ..\..\..\src\ipc.c + + irq.c 1 ..\..\..\src\irq.c + + kservice.c 1 ..\..\..\src\kservice.c + + mem.c 1 ..\..\..\src\mem.c + + mempool.c 1 ..\..\..\src\mempool.c + + object.c 1 ..\..\..\src\object.c + + scheduler.c 1 ..\..\..\src\scheduler.c + + signal.c 1 ..\..\..\src\signal.c + + thread.c 1 ..\..\..\src\thread.c + + timer.c 1 @@ -481,26 +518,36 @@ 1 board\board.c + + stm32f4xx_hal_msp.c 1 board\CubeMX_Config\Src\stm32f4xx_hal_msp.c + + startup_stm32f413xx.s 2 ..\libraries\STM32F4xx_HAL\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f413xx.s + + drv_gpio.c 1 ..\libraries\HAL_Drivers\drv_gpio.c + + drv_usart.c 1 ..\libraries\HAL_Drivers\drv_usart.c + + drv_common.c 1 @@ -516,21 +563,29 @@ 1 ..\..\..\libcpu\arm\common\backtrace.c + + div0.c 1 ..\..\..\libcpu\arm\common\div0.c + + showmem.c 1 ..\..\..\libcpu\arm\common\showmem.c + + cpuport.c 1 ..\..\..\libcpu\arm\cortex-m4\cpuport.c + + context_rvds.S 2 @@ -546,47 +601,70 @@ 1 ..\..\..\components\drivers\misc\pin.c + + serial.c 1 ..\..\..\components\drivers\serial\serial.c + + completion.c 1 ..\..\..\components\drivers\src\completion.c + + dataqueue.c 1 ..\..\..\components\drivers\src\dataqueue.c + + pipe.c 1 ..\..\..\components\drivers\src\pipe.c + + ringblk_buf.c 1 ..\..\..\components\drivers\src\ringblk_buf.c + + ringbuffer.c 1 ..\..\..\components\drivers\src\ringbuffer.c + + waitqueue.c 1 ..\..\..\components\drivers\src\waitqueue.c + + workqueue.c 1 ..\..\..\components\drivers\src\workqueue.c + + + watchdog.c + 1 + ..\..\..\components\drivers\watchdog\watchdog.c + + finsh @@ -596,11 +674,15 @@ 1 ..\..\..\components\finsh\shell.c + + cmd.c 1 ..\..\..\components\finsh\cmd.c + + msh.c 1 @@ -626,90 +708,135 @@ 1 ..\libraries\STM32F4xx_HAL\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c + + stm32f4xx_hal.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c + + stm32f4xx_hal_cec.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cec.c + + stm32f4xx_hal_cortex.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c + + stm32f4xx_hal_crc.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.c + + stm32f4xx_hal_cryp.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cryp.c + + stm32f4xx_hal_cryp_ex.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cryp_ex.c + + stm32f4xx_hal_dma.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c + + stm32f4xx_hal_dma_ex.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c + + stm32f4xx_hal_pwr.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c + + stm32f4xx_hal_pwr_ex.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c + + stm32f4xx_hal_rcc.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c + + stm32f4xx_hal_rcc_ex.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c + + stm32f4xx_hal_rng.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c + + stm32f4xx_hal_gpio.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c + + stm32f4xx_hal_uart.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c + + stm32f4xx_hal_usart.c 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_usart.c + + + stm32f4xx_hal_iwdg.c + 1 + ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_iwdg.c + + + + + stm32f4xx_hal_wwdg.c + 1 + ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_wwdg.c + + -
diff --git a/bsp/stm32/stm32f413-st-nucleo/project.uvprojx b/bsp/stm32/stm32f413-st-nucleo/project.uvprojx index 162413e210..5069e31cf2 100644 --- a/bsp/stm32/stm32f413-st-nucleo/project.uvprojx +++ b/bsp/stm32/stm32f413-st-nucleo/project.uvprojx @@ -10,14 +10,14 @@ rt-thread 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC + 5060750::V5.06 update 6 (build 750)::.\ARMCC 0 STM32F413ZHTx STMicroelectronics - Keil.STM32F4xx_DFP.2.13.0 - http://www.keil.com/pack + Keil.STM32F4xx_DFP.2.14.0 + http://www.keil.com/pack/ IRAM(0x20000000,0x00050000) IROM(0x08000000,0x00180000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE @@ -184,6 +184,8 @@ 0 0 2 + 0 + 0 0 0 8 @@ -337,7 +339,7 @@ USE_HAL_DRIVER, STM32F413xx - .;..\..\..\include;applications;.;board;board\CubeMX_Config\Inc;..\libraries\HAL_Drivers;..\libraries\HAL_Drivers\config;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\finsh;..\..\..\components\libc\compilers\common;..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc;..\libraries\STM32F4xx_HAL\CMSIS\Device\ST\STM32F4xx\Include;..\libraries\STM32F4xx_HAL\CMSIS\Include + .;..\..\..\include;applications;.;board;board\CubeMX_Config\Inc;..\libraries\HAL_Drivers;..\libraries\HAL_Drivers\config;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\finsh;..\..\..\components\libc\compilers\common;..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc;..\libraries\STM32F4xx_HAL\CMSIS\Device\ST\STM32F4xx\Include;..\libraries\STM32F4xx_HAL\CMSIS\Include @@ -350,7 +352,7 @@ 0 0 0 - 0 + 4 @@ -576,6 +578,11 @@ 1 ..\..\..\components\drivers\src\workqueue.c + + watchdog.c + 1 + ..\..\..\components\drivers\watchdog\watchdog.c + @@ -696,6 +703,16 @@ 1 ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_usart.c + + stm32f4xx_hal_iwdg.c + 1 + ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_iwdg.c + + + stm32f4xx_hal_wwdg.c + 1 + ..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_wwdg.c + @@ -708,4 +725,19 @@ + + + + <Project Info> + + + + + + 0 + 1 + + + + diff --git a/bsp/stm32/stm32f413-st-nucleo/rtconfig.h b/bsp/stm32/stm32f413-st-nucleo/rtconfig.h index 8ddb790c4e..2f81c11ed6 100644 --- a/bsp/stm32/stm32f413-st-nucleo/rtconfig.h +++ b/bsp/stm32/stm32f413-st-nucleo/rtconfig.h @@ -82,6 +82,7 @@ #define RT_SERIAL_USING_DMA #define RT_SERIAL_RB_BUFSZ 64 #define RT_USING_PIN +#define RT_USING_WDT /* Using USB */ diff --git a/bsp/stm32/stm32f413-st-nucleo/template.uvoptx b/bsp/stm32/stm32f413-st-nucleo/template.uvoptx index f170007195..7384c8aaf0 100644 --- a/bsp/stm32/stm32f413-st-nucleo/template.uvoptx +++ b/bsp/stm32/stm32f413-st-nucleo/template.uvoptx @@ -73,7 +73,7 @@ 0 - 0 + 1 0 1 @@ -120,7 +120,7 @@ 0 ST-LINKIII-KEIL_SWO - -U-O206 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1536.FLM -FS08000000 -FL0180000 -FP0($$Device:STM32F413ZHTx$CMSIS\Flash\STM32F4xx_1536.FLM) + -U-O206 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("") -D00(00000000) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1536.FLM -FS08000000 -FL0180000 -FP0($$Device:STM32F413ZHTx$CMSIS\Flash\STM32F4xx_1536.FLM) 0 @@ -178,6 +178,7 @@ 1 + 0 0 2 10000000 diff --git a/bsp/stm32/stm32f413-st-nucleo/template.uvprojx b/bsp/stm32/stm32f413-st-nucleo/template.uvprojx index 6b03ebbbb9..76b1b588e9 100644 --- a/bsp/stm32/stm32f413-st-nucleo/template.uvprojx +++ b/bsp/stm32/stm32f413-st-nucleo/template.uvprojx @@ -16,8 +16,8 @@ STM32F413ZHTx STMicroelectronics - Keil.STM32F4xx_DFP.2.13.0 - http://www.keil.com/pack + Keil.STM32F4xx_DFP.2.14.0 + http://www.keil.com/pack/ IRAM(0x20000000,0x00050000) IROM(0x08000000,0x00180000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE @@ -184,6 +184,8 @@ 0 0 2 + 0 + 0 0 0 8 @@ -350,7 +352,7 @@ 0 0 0 - 0 + 4 @@ -391,4 +393,19 @@ + + + + <Project Info> + + + + + + 0 + 1 + + + + From a2517e4cb5f8c0ea4237221cde69ccfa2e476e80 Mon Sep 17 00:00:00 2001 From: XYX12306 <2669599387@qq.com> Date: Mon, 8 Jun 2020 00:02:33 +0800 Subject: [PATCH 2/3] fixed the serious bug caused by the main function calling the key processing function and the system running error corrected the description of README.md file --- bsp/stm32/stm32f413-st-nucleo/README.md | 4 +-- .../stm32f413-st-nucleo/applications/main.c | 30 ++----------------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/bsp/stm32/stm32f413-st-nucleo/README.md b/bsp/stm32/stm32f413-st-nucleo/README.md index c10c01a879..5461ff7ba9 100644 --- a/bsp/stm32/stm32f413-st-nucleo/README.md +++ b/bsp/stm32/stm32f413-st-nucleo/README.md @@ -24,7 +24,7 @@ - MCU:STM32F413ZH,主频 100MHz,1536KB FLASH ,320KB RAM - 常用外设 - - LED:8个,user LED [SB2跳帽需连接](黄色,PB0,LD1;蓝色,PB7,LD2;红色,PB14,LD3), USB communication (LD4), over current (LD5), power LED (黄色,LD6), USB FAULT (LD7), VBUS (LD8)。 + - LED:8个,user LED (JP5跳帽需连接)(黄色,PB0,LD1;蓝色,PB7,LD2;红色,PB14,LD3), USB communication (LD4), over current (LD5), power LED (黄色,LD6), USB FAULT (LD7), VBUS (LD8)。 - 按键:2个,B1(USER,PC13),B2(RESET) - 常用接口:USB 支持 3 种不同接口:虚拟 COM 端口、大容量存储和调试端口等。 - 调试接口,板载 ST-LINK/V2-1 调试器。 @@ -86,7 +86,7 @@ #### 运行结果 -下载程序成功之后,系统会自动运行,在SB2跳帽连接时,当按下用户按键USER KEY时,观察开发板上 LD1、LD2、LD2 的运行效果,三个LED会顺序周期性交替闪烁。 +下载程序成功之后,系统会自动运行,在JP5跳帽连接时,观察开发板上LD1的运行效果,黄色LED会周期性闪烁。 连接开发板对应串口到 PC , 在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息: diff --git a/bsp/stm32/stm32f413-st-nucleo/applications/main.c b/bsp/stm32/stm32f413-st-nucleo/applications/main.c index 089d629f1a..47f94085cb 100644 --- a/bsp/stm32/stm32f413-st-nucleo/applications/main.c +++ b/bsp/stm32/stm32f413-st-nucleo/applications/main.c @@ -26,36 +26,12 @@ int main(void) int count = 1; /* set LED1 pin mode to output */ rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT); - /* set LED2 pin mode to output */ - rt_pin_mode(LED2_PIN, PIN_MODE_OUTPUT); - /* set LED3 pin mode to output */ - rt_pin_mode(LED3_PIN, PIN_MODE_OUTPUT); - /* set USER KEY pin mode to input */ - rt_pin_mode(KEY_PIN, PIN_MODE_INPUT_PULLDOWN); while (count++) { - if(rt_pin_read(KEY_PIN)) - { - rt_pin_write(LED1_PIN, PIN_HIGH); - rt_pin_write(LED2_PIN, PIN_LOW); - rt_pin_write(LED3_PIN, PIN_LOW); - rt_thread_mdelay(500); - rt_pin_write(LED1_PIN, PIN_LOW); - rt_pin_write(LED2_PIN, PIN_HIGH); - rt_pin_write(LED3_PIN, PIN_LOW); - rt_thread_mdelay(500); - rt_pin_write(LED1_PIN, PIN_LOW); - rt_pin_write(LED2_PIN, PIN_LOW); - rt_pin_write(LED3_PIN, PIN_HIGH); - rt_thread_mdelay(500); - } - else - { - rt_pin_write(LED1_PIN, PIN_LOW); - rt_pin_write(LED2_PIN, PIN_LOW); - rt_pin_write(LED3_PIN, PIN_LOW); - } + rt_pin_write(LED1_PIN, PIN_HIGH); + rt_thread_mdelay(500); + rt_pin_write(LED1_PIN, PIN_LOW); } return RT_EOK; From f9347472cbf8837badfba0f7aa58d6bbae087d43 Mon Sep 17 00:00:00 2001 From: XYX12306 <2669599387@qq.com> Date: Sat, 27 Jun 2020 14:43:39 +0800 Subject: [PATCH 3/3] convert the tab key of some files to four spaces --- bsp/stm32/stm32f413-st-nucleo/README.md | 32 +++++++++---------- .../stm32f413-st-nucleo/applications/main.c | 8 ++--- bsp/stm32/stm32f413-st-nucleo/board/Kconfig | 12 +++---- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/bsp/stm32/stm32f413-st-nucleo/README.md b/bsp/stm32/stm32f413-st-nucleo/README.md index 5461ff7ba9..e795064dba 100644 --- a/bsp/stm32/stm32f413-st-nucleo/README.md +++ b/bsp/stm32/stm32f413-st-nucleo/README.md @@ -37,25 +37,25 @@ | **板载外设** | **支持情况** | **备注** | | :------------ | :----------: | :-----------------------------------: | -|STLINK TO USART| 支持 | UART3 | +|STLINK TO USART| 支持 | UART3 | | **片上外设** | **支持情况** | **备注** | | :------------ | :----------: | :-----------------------------------: | -| GPIO | 支持 | | -| UART | 支持 | UART2/3 | -| SPI | 支持 | SPI2 | -| I2C | 支持 | I2C1(软件模拟) | -| TIMER | 支持 | TIM11/13/14 | -| PWM | 支持 | PWM2_CH4 | -| ADC | 支持 | ADC1_IN5 | -| RTC | 支持 | 支持外部晶振和内部低速时钟 | -| WDT | 支持 | 独立看门狗 | -| Onchip Flash | 支持 | 片上Flash | -| USB OTG_FS | 支持 | OTGFS as USB device | -| Onchip Flash | 支持 | 片上Flash | -| USB Device | 支持 | OTGFS as USB device | -| RNG | 支持 | Random Number Generator | -| UDID | 支持 | Unique Device Identifier | +| GPIO | 支持 | | +| UART | 支持 | UART2/3 | +| SPI | 支持 | SPI2 | +| I2C | 支持 | I2C1(软件模拟) | +| TIMER | 支持 | TIM11/13/14 | +| PWM | 支持 | PWM2_CH4 | +| ADC | 支持 | ADC1_IN5 | +| RTC | 支持 | 支持外部晶振和内部低速时钟 | +| WDT | 支持 | 独立看门狗 | +| Onchip Flash | 支持 | 片上Flash | +| USB OTG_FS | 支持 | OTGFS as USB device | +| Onchip Flash | 支持 | 片上Flash | +| USB Device | 支持 | OTGFS as USB device | +| RNG | 支持 | Random Number Generator | +| UDID | 支持 | Unique Device Identifier | ## 使用说明 diff --git a/bsp/stm32/stm32f413-st-nucleo/applications/main.c b/bsp/stm32/stm32f413-st-nucleo/applications/main.c index 47f94085cb..18b64457a9 100644 --- a/bsp/stm32/stm32f413-st-nucleo/applications/main.c +++ b/bsp/stm32/stm32f413-st-nucleo/applications/main.c @@ -24,14 +24,14 @@ int main(void) { int count = 1; - /* set LED1 pin mode to output */ + /* set LED1 pin mode to output */ rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT); while (count++) { - rt_pin_write(LED1_PIN, PIN_HIGH); - rt_thread_mdelay(500); - rt_pin_write(LED1_PIN, PIN_LOW); + rt_pin_write(LED1_PIN, PIN_HIGH); + rt_thread_mdelay(500); + rt_pin_write(LED1_PIN, PIN_LOW); } return RT_EOK; diff --git a/bsp/stm32/stm32f413-st-nucleo/board/Kconfig b/bsp/stm32/stm32f413-st-nucleo/board/Kconfig index 6fea77139e..d4c25d6175 100644 --- a/bsp/stm32/stm32f413-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f413-st-nucleo/board/Kconfig @@ -35,7 +35,7 @@ menu "On-chip Peripheral Drivers" bool "Enable UART2 RX DMA" depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA default n - + config BSP_USING_UART3 bool "Enable UART3" default y @@ -44,8 +44,8 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART3 && RT_SERIAL_USING_DMA default n endif - - menuconfig BSP_USING_SPI + + menuconfig BSP_USING_SPI bool "Enable SPI BUS" default n select RT_USING_SPI @@ -84,8 +84,8 @@ menu "On-chip Peripheral Drivers" range 1 144 default 140 endif - - menuconfig BSP_USING_TIM + + menuconfig BSP_USING_TIM bool "Enable timer" default n select RT_USING_HWTIMER @@ -150,7 +150,7 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n - + config BSP_USING_ON_CHIP_FLASH bool "Enable on-chip FLASH" default n