添加H5的包
![微信截图_20240817221902.png 微信截图_20240817221902.png](data/attachment/forum/202408/17/232937nolnyjheech6l8lx.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
![微信截图_20240817221910.png 微信截图_20240817221910.png](data/attachment/forum/202408/17/232937o6wgwxvobyfu5550.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
![微信截图_20240817222304.png 微信截图_20240817222304.png](data/attachment/forum/202408/17/232937lzupy0pzzsvcu5vv.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
点击Finish安装
![微信截图_20240817222141.png 微信截图_20240817222141.png](data/attachment/forum/202408/17/232937q0k3g1nvzoo20yxz.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
点击主界面的ACCESS TO BOARD SELECTOR,从板卡创建工程
![微信截图_20240817222356.png 微信截图_20240817222356.png](data/attachment/forum/202408/17/232937ptfrmv10mfomf98u.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
查找并选择H533
![微信截图_20240817222752.png 微信截图_20240817222752.png](data/attachment/forum/202408/17/232941myqwtlzlosi04rrl.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
这里暂时不开启TrustZone
![微信截图_20240817222815.png 微信截图_20240817222815.png](data/attachment/forum/202408/17/232935fl3jwgclggc9ig8c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
配置默认即可
![微信截图_20240817232724.png 微信截图_20240817232724.png](data/attachment/forum/202408/17/232938idafdo6c6fdgz6sc.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
设置生成工程和目录
![微信截图_20240817232718.png 微信截图_20240817232718.png](data/attachment/forum/202408/17/232941ls6lcsaccz4ojfoh.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
编写代码
int main(void)
{
/* USER CODE BEGIN 1 */
/* 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_GPIO_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Initialize leds */
BSP_LED_Init(LED_GREEN);
/* Initialize USER push-button, will be used to trigger an interrupt each time it's pressed.*/
BSP_PB_Init(BUTTON_USER, BUTTON_MODE_EXTI);
/* Initialize COM1 port (115200, 8 bits (7-bit data + 1 stop bit), no parity */
BspCOMInit.BaudRate = 115200;
BspCOMInit.WordLength = COM_WORDLENGTH_8B;
BspCOMInit.StopBits = COM_STOPBITS_1;
BspCOMInit.Parity = COM_PARITY_NONE;
BspCOMInit.HwFlowCtl = COM_HWCONTROL_NONE;
if (BSP_COM_Init(COM1, &BspCOMInit) != BSP_ERROR_NONE)
{
Error_Handler();
}
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
BSP_LED_On(LED_GREEN);
HAL_Delay(500);
BSP_LED_Off(LED_GREEN);
HAL_Delay(500);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
下载可见小灯闪烁
![微信截图_20240817232145.png 微信截图_20240817232145.png](data/attachment/forum/202408/17/232942z1a1ex6akg1esi1r.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
|