[STM32U5]【NUCLEO-U5A5ZJ-Q测评】-2-Keil开发环境搭建

在Keil官网下载固件包:

 



双击安装:
 





安装完成后新建工程,可以选择芯片:STM32U5A5ZJT6Q


 



先运行一个最简单的GPIO翻转,初始化GPIO

 

  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);



延迟一定时间后,翻转LED状态
 

  while (1)

  {

    /* USER CODE END WHILE */



    /* USER CODE BEGIN 3 */

    HAL_GPIO_TogglePin(LED1_GPIO_PORT, LED1_PIN);

    /* Insert delay 1000 ms */

    HAL_Delay(1000);

    HAL_GPIO_TogglePin(LED2_GPIO_PORT, LED2_PIN);

    /* Insert delay 1000 ms */

    HAL_Delay(1000);



  }





编译:

Rebuild started: Project: GPIO_IOToggle

*** Using Compiler 'V6.16', folder: 'D:\ProgramFiles\Keil_v5\ARM\ARMCLANG\Bin'

Rebuild target 'GPIO_IOToggle'

assembling startup_stm32u5a5xx.s...

compiling main.c...

compiling stm32u5xx_hal_exti.c...

compiling stm32u5xx_hal_cortex.c...

compiling stm32u5xx_hal.c...

compiling stm32u5xx_hal_msp.c...

compiling stm32u5xx_hal_dma.c...

compiling stm32u5xx_hal_gtzc.c...

compiling stm32u5xx_hal_icache.c...

compiling stm32u5xx_hal_pwr_ex.c...

compiling stm32u5xx_hal_i2c.c...

compiling stm32u5xx_hal_tim.c...

compiling stm32u5xx_it.c...

compiling stm32u5xx_hal_pwr.c...

compiling stm32u5xx_hal_i2c_ex.c...

compiling stm32u5xx_hal_flash_ex.c...

compiling stm32u5xx_nucleo.c...

compiling stm32u5xx_hal_gpio.c...

compiling stm32u5xx_hal_tim_ex.c...

compiling stm32u5xx_hal_dma_ex.c...

compiling stm32u5xx_hal_flash.c...

compiling system_stm32u5xx.c...

compiling stm32u5xx_hal_rcc.c...

compiling stm32u5xx_hal_rcc_ex.c...

linking...

Program Size: Code=6448 RO-data=832 RW-data=12 ZI-data=1660  

FromELF: creating hex file...

"GPIO_IOToggle\GPIO_IOToggle.axf" - 0 Error(s), 0 Warning(s).

Build Time Elapsed:  00:00:03

Load "GPIO_IOToggle\\GPIO_IOToggle.axf" 

Erase Done.

Programming Done.

Verify OK.

Flash Load finished at 13:40:15


还有一个选项需要注意:“RESET AND RUN”,这样下载后程序会自动运行。


 


 

---------------------
作者:YangTwo
链接:https://bbs.21ic.com/icview-3339894-1-1.html
来源:21ic.com
此文章已获得原创/原创奖标签,著作权归21ic所有,任何人未经允许禁止转载。 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值