diff --git a/bsp/stm32/stm32h750-artpi-h750/.config b/bsp/stm32/stm32h750-artpi-h750/.config index 38d0bf68b8..c31157512a 100644 --- a/bsp/stm32/stm32h750-artpi-h750/.config +++ b/bsp/stm32/stm32h750-artpi-h750/.config @@ -115,7 +115,7 @@ CONFIG_RT_USING_DEVICE_IPC=y CONFIG_RT_PIPE_BUFSZ=512 # CONFIG_RT_USING_SYSTEM_WORKQUEUE is not set CONFIG_RT_USING_SERIAL=y -CONFIG_RT_SERIAL_USING_DMA=y +# CONFIG_RT_SERIAL_USING_DMA is not set CONFIG_RT_SERIAL_RB_BUFSZ=64 # CONFIG_RT_USING_CAN is not set # CONFIG_RT_USING_HWTIMER is not set @@ -442,7 +442,7 @@ CONFIG_SOC_SERIES_STM32H7=y # # Hardware Drivers Config # -CONFIG_SOC_STM32H750IB=y +CONFIG_SOC_STM32H750XB=y # # Onboard Peripheral Drivers @@ -454,7 +454,7 @@ CONFIG_SOC_STM32H750IB=y # CONFIG_BSP_USING_GPIO=y CONFIG_BSP_USING_UART=y -CONFIG_BSP_USING_UART1=y +CONFIG_BSP_USING_UART3=y CONFIG_BSP_USING_UART4=y # CONFIG_BSP_USING_SDIO is not set # CONFIG_BSP_USING_CRC is not set diff --git a/bsp/stm32/stm32h750-artpi-h750/README.md b/bsp/stm32/stm32h750-artpi-h750/README.md index 6d736073b6..fd7c920579 100644 --- a/bsp/stm32/stm32h750-artpi-h750/README.md +++ b/bsp/stm32/stm32h750-artpi-h750/README.md @@ -45,7 +45,7 @@ STM32H750 是RTTHREAD推出的一款基于 ARM Cortex-M7 内核的开发板, | LCD RG888 | 待支持 | 显示屏接口 | | **片上外设** | **支持情况** | **备注** | | GPIO | 支持 | | -| UART | 支持 | UART1 | +| UART | 支持 | UART4 UART3 | | SPI | 支持 | SPI | | QSPI | 支持 | | | | | | diff --git a/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/Core/Src/stm32h7xx_hal_msp.c b/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/Core/Src/stm32h7xx_hal_msp.c index 1e241b9160..77a19bb14b 100644 --- a/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/Core/Src/stm32h7xx_hal_msp.c +++ b/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/Core/Src/stm32h7xx_hal_msp.c @@ -113,6 +113,9 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart) GPIO_InitStruct.Alternate = GPIO_AF8_UART4; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + /* UART4 interrupt Init */ + HAL_NVIC_SetPriority(UART4_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(UART4_IRQn); /* USER CODE BEGIN UART4_MspInit 1 */ /* USER CODE END UART4_MspInit 1 */ @@ -147,6 +150,11 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart) GPIO_InitStruct.Alternate = GPIO_AF7_USART3; HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + /* USART3 interrupt Init */ + HAL_NVIC_SetPriority(USART3_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(USART3_IRQn); + + NVIC_EnableIRQ(USART3_IRQn); /* USER CODE BEGIN USART3_MspInit 1 */ /* USER CODE END USART3_MspInit 1 */ @@ -178,6 +186,8 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart) HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0); + /* UART4 interrupt DeInit */ + HAL_NVIC_DisableIRQ(UART4_IRQn); /* USER CODE BEGIN UART4_MspDeInit 1 */ /* USER CODE END UART4_MspDeInit 1 */ @@ -200,6 +210,8 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart) HAL_GPIO_DeInit(GPIOD, GPIO_PIN_11|GPIO_PIN_12); + /* USART3 interrupt DeInit */ + HAL_NVIC_DisableIRQ(USART3_IRQn); /* USER CODE BEGIN USART3_MspDeInit 1 */ /* USER CODE END USART3_MspDeInit 1 */ diff --git a/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/Core/Src/stm32h7xx_it.c b/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/Core/Src/stm32h7xx_it.c index 20d2455bb8..01b01ae206 100644 --- a/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/Core/Src/stm32h7xx_it.c +++ b/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/Core/Src/stm32h7xx_it.c @@ -56,7 +56,8 @@ /* USER CODE END 0 */ /* External variables --------------------------------------------------------*/ - +extern UART_HandleTypeDef huart4; +extern UART_HandleTypeDef huart3; /* USER CODE BEGIN EV */ /* USER CODE END EV */ @@ -197,6 +198,34 @@ void SysTick_Handler(void) /* please refer to the startup file (startup_stm32h7xx.s). */ /******************************************************************************/ +/** + * @brief This function handles USART3 global interrupt. + */ +void USART3_IRQHandler(void) +{ + /* USER CODE BEGIN USART3_IRQn 0 */ + + /* USER CODE END USART3_IRQn 0 */ + HAL_UART_IRQHandler(&huart3); + /* USER CODE BEGIN USART3_IRQn 1 */ + + /* USER CODE END USART3_IRQn 1 */ +} + +/** + * @brief This function handles UART4 global interrupt. + */ +void UART4_IRQHandler(void) +{ + /* USER CODE BEGIN UART4_IRQn 0 */ + + /* USER CODE END UART4_IRQn 0 */ + HAL_UART_IRQHandler(&huart4); + /* USER CODE BEGIN UART4_IRQn 1 */ + + /* USER CODE END UART4_IRQn 1 */ +} + /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ diff --git a/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/CubeMX_Config.ioc b/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/CubeMX_Config.ioc index 068dfa869e..a71fd18402 100644 --- a/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/CubeMX_Config.ioc +++ b/bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/CubeMX_Config.ioc @@ -14,15 +14,16 @@ Mcu.Name=STM32H750XBHx Mcu.Package=TFBGA240 Mcu.Pin0=PI9 Mcu.Pin1=PI8 -Mcu.Pin2=PH1-OSC_OUT (PH1) -Mcu.Pin3=PH0-OSC_IN (PH0) -Mcu.Pin4=PA0 -Mcu.Pin5=PB10 -Mcu.Pin6=PB11 -Mcu.Pin7=PD11 -Mcu.Pin8=PD12 -Mcu.Pin9=VP_SYS_VS_Systick -Mcu.PinsNb=10 +Mcu.Pin10=VP_SYS_VS_Systick +Mcu.Pin2=PI11 +Mcu.Pin3=PH1-OSC_OUT (PH1) +Mcu.Pin4=PH0-OSC_IN (PH0) +Mcu.Pin5=PA0 +Mcu.Pin6=PB10 +Mcu.Pin7=PB11 +Mcu.Pin8=PD11 +Mcu.Pin9=PD12 +Mcu.PinsNb=11 Mcu.ThirdPartyNb=0 Mcu.UserConstants= Mcu.UserName=STM32H750XBHx @@ -38,6 +39,8 @@ NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true +NVIC.UART4_IRQn=true\:0\:0\:false\:false\:true\:true\:true +NVIC.USART3_IRQn=true\:0\:0\:false\:false\:true\:true\:true NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false PA0.Locked=true PA0.Mode=Asynchronous @@ -56,6 +59,8 @@ PH0-OSC_IN\ (PH0).Mode=HSE-External-Oscillator PH0-OSC_IN\ (PH0).Signal=RCC_OSC_IN PH1-OSC_OUT\ (PH1).Mode=HSE-External-Oscillator PH1-OSC_OUT\ (PH1).Signal=RCC_OSC_OUT +PI11.Locked=true +PI11.Signal=GPIO_Output PI8.Locked=true PI8.Signal=GPIO_Output PI9.Locked=true diff --git a/bsp/stm32/stm32h750-artpi-h750/board/Kconfig b/bsp/stm32/stm32h750-artpi-h750/board/Kconfig index 18fc3b4603..2d07f8c8e3 100644 --- a/bsp/stm32/stm32h750-artpi-h750/board/Kconfig +++ b/bsp/stm32/stm32h750-artpi-h750/board/Kconfig @@ -10,7 +10,7 @@ config SOC_STM32H750XB menu "Onboard Peripheral Drivers" config BSP_USING_QSPI_FLASH - bool "Enable QSPI FLASH (W25Q256)" + bool "Enable QSPI FLASH (W25Q64)" select BSP_USING_QSPI select RT_USING_SFUD select RT_SFUD_USING_QSPI @@ -29,8 +29,8 @@ menu "On-chip Peripheral Drivers" default y select RT_USING_SERIAL if BSP_USING_UART - config BSP_USING_UART1 - bool "Enable UART1" + config BSP_USING_UART3 + bool "Enable UART3" default y config BSP_USING_UART4 diff --git a/bsp/stm32/stm32h750-artpi-h750/project.uvoptx b/bsp/stm32/stm32h750-artpi-h750/project.uvoptx index 49a4577940..32aea0646d 100644 --- a/bsp/stm32/stm32h750-artpi-h750/project.uvoptx +++ b/bsp/stm32/stm32h750-artpi-h750/project.uvoptx @@ -117,6 +117,26 @@ STLink\ST-LINKIII-KEIL_SWO.dll + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + (105=-1,-1,-1,-1,0) + 0 UL2CM3 @@ -128,19 +148,159 @@ -U066BFF393732484257162540 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(6BA02477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32H7x_128k -FS08000000 -FL020000 - + + + 0 + 0 + 516 + 1 +
134238434
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\libraries\HAL_Drivers\drv_usart.c + + \\rt_thread\../libraries/HAL_Drivers/drv_usart.c\516 +
+ + 1 + 0 + 105 + 1 +
134264914
+ 0 + 0 + 0 + 0 + 0 + 1 + applications\main.c + + \\rt_thread\applications/main.c\105 +
+ + 2 + 0 + 108 + 1 +
134262562
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\libraries\HAL_Drivers\drv_usart.c + + \\rt_thread\../libraries/HAL_Drivers/drv_usart.c\108 +
+ + 3 + 0 + 115 + 1 +
134262586
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\libraries\HAL_Drivers\drv_usart.c + + \\rt_thread\../libraries/HAL_Drivers/drv_usart.c\115 +
+ + 4 + 0 + 164 + 1 +
134262714
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\libraries\HAL_Drivers\drv_usart.c + + \\rt_thread\../libraries/HAL_Drivers/drv_usart.c\164 +
+ + 5 + 0 + 222 + 1 +
134262916
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\libraries\HAL_Drivers\drv_usart.c + + \\rt_thread\../libraries/HAL_Drivers/drv_usart.c\222 +
+ + 6 + 0 + 224 + 1 +
134262950
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\libraries\HAL_Drivers\drv_usart.c + + \\rt_thread\../libraries/HAL_Drivers/drv_usart.c\224 +
+
+ + + 0 + 1 + uart + + + 1 + 1 + baud_rate + + + 2 + 1 + cfg->baud_rate,0x0A + + + 3 + 1 + huart + + + 4 + 1 + uart->handle + + 0 0 0 - 0 + 1 0 0 0 0 - 0 + 1 0 0 0 @@ -171,6 +331,12 @@ + + + System Viewer\USART3 + 35905 + + 1 1 @@ -203,7 +369,7 @@ cpu - 0 + 1 0 0 0 @@ -479,7 +645,7 @@ finsh - 0 + 1 0 0 0 @@ -523,7 +689,7 @@ Kernel - 0 + 1 0 0 0 @@ -699,7 +865,7 @@ libc - 0 + 1 0 0 0 @@ -719,7 +885,7 @@ STM32_HAL - 0 + 1 0 0 0 diff --git a/bsp/stm32/stm32h750-artpi-h750/rtconfig.h b/bsp/stm32/stm32h750-artpi-h750/rtconfig.h index af67cf3d40..8d75171203 100644 --- a/bsp/stm32/stm32h750-artpi-h750/rtconfig.h +++ b/bsp/stm32/stm32h750-artpi-h750/rtconfig.h @@ -78,7 +78,6 @@ #define RT_USING_DEVICE_IPC #define RT_PIPE_BUFSZ 512 #define RT_USING_SERIAL -#define RT_SERIAL_USING_DMA #define RT_SERIAL_RB_BUFSZ 64 #define RT_USING_PIN @@ -153,7 +152,7 @@ /* Hardware Drivers Config */ -#define SOC_STM32H750IB +#define SOC_STM32H750XB /* Onboard Peripheral Drivers */ @@ -162,7 +161,7 @@ #define BSP_USING_GPIO #define BSP_USING_UART -#define BSP_USING_UART1 +#define BSP_USING_UART3 #define BSP_USING_UART4 /* Board extended module Drivers */