[STM32H7] STM32H7 环境安装与DEMO测试

[复制链接]
1192|11
 楼主| 昱枫 发表于 2020-10-22 20:22 | 显示全部楼层 |阅读模式


最近收到一块STM32H7A3 NUCLEO

安装MDK 的支持库,下载stm32cubeh7工程实例

1. MDK 支持包下载
keil 支持包
https://keilpack.azureedge.net/pack/Keil.STM32H7xx_DFP.2.6.0.pack

这个下载好费劲,网络特慢,下了第6次才下载完成,下次有空放在百度云上

stm32cubeh7 库以及demo
https://www.st.com/zh/embedded-software/stm32cubeh7.html


环境安装完成



简单的修改工程,LED1 亮状态,LED2 1s钟闪烁一次
  1. [code]int main(void)
  2. {
  3.   /* This sample code shows how to use GPIO HAL API to toggle LED1 and LED2 IOs
  4.     in an infinite loop. */

  5.   /* STM32H7xx HAL library initialization:
  6.        - Systick timer is configured by default as source of time base, but user
  7.          can eventually implement his proper time base source (a general purpose
  8.          timer for example or other time source), keeping in mind that Time base
  9.          duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
  10.          handled in milliseconds basis.
  11.        - Set NVIC Group Priority to 4
  12.        - Low Level Initialization
  13.      */
  14.   HAL_Init();

  15.   /* Configure the system clock to 280 MHz */
  16.   SystemClock_Config();
  17.   
  18.   /* -1- Enable GPIO Clock (to be able to program the configuration registers) */
  19.   LED1_GPIO_CLK_ENABLE();
  20.   LED2_GPIO_CLK_ENABLE();

  21.   /* -2- Configure IO in output push-pull mode to drive external LEDs */
  22.   GPIO_InitStruct.Mode  = GPIO_MODE_OUTPUT_PP;
  23.   GPIO_InitStruct.Pull  = GPIO_PULLUP;
  24.   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;

  25.   GPIO_InitStruct.Pin = LED1_PIN;
  26.   HAL_GPIO_Init(LED1_GPIO_PORT, &GPIO_InitStruct);
  27.   GPIO_InitStruct.Pin = LED2_PIN;
  28.   HAL_GPIO_Init(LED2_GPIO_PORT, &GPIO_InitStruct);
  29.         //HAL_GPIO_TogglePin(LED1_GPIO_PORT, LED1_PIN);
  30.         HAL_GPIO_WritePin(LED1_GPIO_PORT, LED1_PIN,GPIO_PIN_SET);
  31.        
  32.   /* -3- Toggle IO in an infinite loop */
  33.   while (1)
  34.   {
  35.    
  36.     HAL_GPIO_TogglePin(LED2_GPIO_PORT, LED2_PIN);
  37.     /* Insert delay 100 ms */
  38.     HAL_Delay(1000);
  39.   }
  40. }



371745f91793e21408.png


yljon 发表于 2020-10-22 21:17 | 显示全部楼层
板子怎么撸到滴

评论

@昱枫 :牛! 分享下经验啊  发表于 2020-10-23 09:32
收到3块了  发表于 2020-10-22 21:56
香水城 发表于 2020-10-23 09:35 | 显示全部楼层
其实 STM32CubeIDE 也挺好的,你可以试试。

关键还是免费的。
xxdcq 发表于 2020-10-23 10:16 | 显示全部楼层
我也费了好多劲才把开发环境建立起来
不爱说话 发表于 2020-10-23 17:14 | 显示全部楼层
点灯的开箱视频和帖子太多了。

评论

最近收到的板子太多,都有交报告,没的法,得分时开发  发表于 2020-10-23 19:56
isageko 发表于 2020-10-23 22:42 | 显示全部楼层
MDK是官网没有吗 板子是个好板子
远芳侵古道 发表于 2020-10-23 23:58 | 显示全部楼层
STM32CubeIDE在哪里找??免费的吗?@香水城
hjl2832 发表于 2020-10-24 10:00 | 显示全部楼层
我也在活动中获得了一块,找个时间也试试,写个心得贴上来。现在在考虑做一个MIPI转RGB的转接板,手上有7寸的RGB电容屏,然后前段时间有幸获得了电堂送的MP157的开发板,想试试TFT这块的功能(MP157的接口是MIPI,没有RGB)。
 楼主| 昱枫 发表于 2020-10-24 20:11 | 显示全部楼层
hjl2832 发表于 2020-10-24 10:00
我也在活动中获得了一块,找个时间也试试,写个心得贴上来。现在在考虑做一个MIPI转RGB的转接板,手上有7寸 ...

还有送157啊,啥互动
您需要登录后才可以回帖 登录 | 注册

本版积分规则

54

主题

679

帖子

4

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