1、开箱
主打Ultra-low-power with FlexPowerControl
芯片内部资源及外设相当丰富,图形资源也很强大,含有Neo-Chrom GPU (GPU2D) 、
Chrom-ART Accelerator (DMA2D) 、LCD-TFT controller (LTDC)
17 timers、2 watchdogs and RTC、7 USARTs;14个支持1.8V的I/O、
标准的nucleo144通用底板,STlink用的是STM32F723IEK6的V3版本,更新最新link到M4固件;
六层板设计,2、5层为GND,在每层标识了层号,开窗把对应的层号给凸显了出来;
2、点灯
在CubeMX中装载STM32Cube_FW_U5_V1.2.0
...\STM32Cube\Repository\STM32Cube_FW_U5_V1.2.0\Projects\NUCLEO-U5A5ZJ-Q\Examples\GPIO\GPIO_IOToggle
U5A5的例程不是很多,可以参考U575的,两个应该是一样的;
基于STM32CuBeIDE,打开GPIO_IOToggle工程:
工程是LED1(green)、LED2(blue)交替反转,这里添加LED3(red)一并交替反转
LED3对应的引脚为PG2,需要使能所在的VDDIO;
①、首先打开Enable VddIO2 for Led3:
HAL_PWREx_EnableVddIO2();
②、开启LED3时钟
LED3_GPIO_CLK_ENABLE();
③、在LED1、LED2下添加LED3的初始化配置
GPIO_InitStruct.Pin = LED3_PIN;
HAL_GPIO_Init(LED3_GPIO_PORT, &GPIO_InitStruct);
④、在while中添加LED翻转Toggle指令
HAL_GPIO_TogglePin(LED3_GPIO_PORT, LED3_PIN);
HAL_Delay(500);
/* USER CODE BEGIN 2 */
/* -1- Enable GPIO Clock (to be able to program the configuration registers) */
LED1_GPIO_CLK_ENABLE();
LED2_GPIO_CLK_ENABLE();
HAL_PWREx_EnableVddIO2();
LED3_GPIO_CLK_ENABLE();
/* -2- Configure IO in output push-pull mode to drive external LEDs */
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
GPIO_InitStruct.Pin = LED1_PIN;
HAL_GPIO_Init(LED1_GPIO_PORT, &GPIO_InitStruct);
GPIO_InitStruct.Pin = LED2_PIN;
HAL_GPIO_Init(LED2_GPIO_PORT, &GPIO_InitStruct);
GPIO_InitStruct.Pin = LED3_PIN;
HAL_GPIO_Init(LED3_GPIO_PORT, &GPIO_InitStruct);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_GPIO_TogglePin(LED1_GPIO_PORT, LED1_PIN);
/* Insert delay 100 ms */
HAL_Delay(500);
HAL_GPIO_TogglePin(LED2_GPIO_PORT, LED2_PIN);
/* Insert delay 100 ms */
HAL_Delay(500);
HAL_GPIO_TogglePin(LED3_GPIO_PORT, LED3_PIN);
/* Insert delay 100 ms */
HAL_Delay(500);
}
/* USER CODE END 3 */
或者使用BSP_LED_xxx指令控制LED,输入对应的LED1、LED2、LED3控制对应的LED
int32_t BSP_LED_Init(Led_TypeDef Led);
int32_t BSP_LED_DeInit(Led_TypeDef Led);
int32_t BSP_LED_On(Led_TypeDef Led);
int32_t BSP_LED_Off(Led_TypeDef Led);
int32_t BSP_LED_Toggle(Led_TypeDef Led);