1. Unboxing
主打Ultra-low-power with FlexPowerControl
The chip has rich internal resources and peripherals, and powerful graphics resources, including Neo-Chrom GPU (GPU2D),
Chrom-ART Accelerator (DMA2D)、LCD-TFT controller (LTDC)
17 timers, 2 watchdogs and RTC, 7 USARTs; 14 I/Os supporting 1.8V,
Standard nucleo144 universal baseboard, STlink uses the V3 version of STM32F723IEK6, and updates the latest link to M4 firmware;
Six-layer board design, 2nd and 5th layers are GND, layer numbers are marked on each layer, and windows are opened to highlight the corresponding layer numbers;
2. Lights up
Load STM32Cube_FW_U5_V1.2.0 in CubeMX
...\STM32Cube\Repository\STM32Cube_FW_U5_V1.2.0\Projects\NUCLEO-U5A5ZJ-Q\Examples\GPIO\GPIO_IOToggle
There are not many routines for U5A5, you can refer to those for U575, the two should be the same;
Based on STM32CuBeIDE, open the GPIO_IOToggle project:
The project is to alternately reverse LED1 (green) and LED2 (blue). Here, LED3 (red) is added to alternately reverse as well.
The pin corresponding to LED3 is PG2, and the VDDIO where it is located needs to be enabled;
①. First, turn on Enable VddIO2 for Led3:
HAL_PWREx_EnableVddIO2();
②, turn on LED3 clock
LED3_GPIO_CLK_ENABLE();
③. Add the initialization configuration of LED3 under LED1 and LED2
GPIO_InitStruct.Pin = LED3_PIN;
HAL_GPIO_Init(LED3_GPIO_PORT, &GPIO_InitStruct);
④. Add LED flip Toggle instruction in while
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 */
Or use BSP_LED_xxx command to control LED, input corresponding LED1, LED2, LED3 to control corresponding 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);