[STM32U3] 【STM32U385RG 测评】——1.开箱点灯

[复制链接]
 楼主| 龙鳞铁碎牙 发表于 2025-7-10 08:42 | 显示全部楼层 |阅读模式
本帖最后由 龙鳞铁碎牙 于 2025-7-12 10:15 编辑

#申请开发板#  很高兴收到了意法半导体和21IC论坛给予的NUCLEO-STM32U385RG开发板,今天就到公司了,拿到板子,来个开箱评测。1.拆开快递,就是这个盒子

近距离观察
78248686f0d558aa17.jpg 29765686f0d61010bc.jpg 74285686f0d69d5a65.jpg
根据手册上的二维码,进入ST官网
51947686f0de9af6f7.png
先下载原理图
41376686f0e1f94e36.png 80162686f0e37d0b42.png

找到LED引脚PA5
85182686f0f5839829.png
首先要点亮LED,就打开工程,这里我选择GPIO_IOToggle
99545686f0edb1b574.png
核心代码如下:
int main(void)
{

  /* USER CODE BEGIN 1 */
  /* STM32WBAxx HAL library initialization:
       - Systick timer is configured by default as source of time base, but user
             can eventually implement his proper time base source (a general purpose
             timer for example or other time source), keeping in mind that Time base
             duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
             handled in milliseconds basis.
       - Set NVIC Group Priority to 4
       - Low Level Initialization
     */
  /* USER CODE END 1 */

  /* MCU Configuration--------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* USER CODE BEGIN Init */

  /* USER CODE END Init */

  /* Configure the system clock */
  SystemClock_Config();

  /* USER CODE BEGIN SysInit */

  /* USER CODE END SysInit */

  /* Initialize all configured peripherals */
  MX_ICACHE_Init();
  /* USER CODE BEGIN 2 */

   /* -1- Enable GPIO Clock (to be able to program the configuration registers) */
  LED2_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 = LED2_PIN;
  HAL_GPIO_Init(LED2_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(LED2_GPIO_PORT, LED2_PIN);
    /* Insert delay 100 ms */
    HAL_Delay(100);

  }
  /* USER CODE END 3 */
}

LED每隔100ms闪烁一下
编译烧录开发板
详情看视频

43071686f103030838.jpg

18354686f0d2953021.jpg
71649686f0d3880656.jpg
44968686f0d409f702.jpg
63389686f0ea88a43b.png
小小蚂蚁举千斤 发表于 2025-7-28 22:39 | 显示全部楼层
原理图才是关键的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

17

主题

47

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部

17

主题

47

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部