STM32F4XX/APM32F4XX USB OTA升级

news2024/10/7 8:22:16

近期在研究USB CDC协议,使用USB Virtual Port Com功能与上位机通讯做了OTA功能。开发平台:MDK529
开发硬件:APM32F411
首先看下手册Flash分布,Flash总共8个扇区。


接下来进行Flash分区。


扇区 0 和 扇区 1做Boo区。


扇区 2做APP跳转判断区。



扇区 3到扇区 7做APP程序区。
既然分区已经分好,接下来就进行Boot代码编写。使用Virtual Port Com SDK。
打开MDK工程,进行Flash大小设置,Flash空间占用32k。勾选使用Use Micro LIB。
对main.c文件进行修改

#include "main.h"
#include "usb_device.h"
#include "gpio.h"
#include "Update.h"

void SystemClock_Config(void);
typedef void (*pFunction)(void);
pFunction Jump_To_Application;
uint32_t JumpAddress;

void Jump_To_App(uint32_t address)
{
    if (((*(__IO uint32_t*)address) & 0x2FFE0000) == 0x20000000)
    {
        JumpAddress = *(__IO uint32_t*) (address + 4);
        
		Jump_To_Application = (pFunction) JumpAddress;
			
        __set_MSP(*(__IO uint32_t*) address);
		
        Jump_To_Application();
    }
}

void USB_Disconnected(void) 
{
	__HAL_RCC_USB_OTG_FS_FORCE_RESET();
	HAL_Delay(200);
	__HAL_RCC_USB_OTG_FS_RELEASE_RESET();
	
	GPIO_InitTypeDef GPIO_Initure;
	__HAL_RCC_GPIOA_CLK_ENABLE();

	GPIO_Initure.Pin = GPIO_PIN_11 | GPIO_PIN_12;
	GPIO_Initure.Mode = GPIO_MODE_OUTPUT_PP;
	GPIO_Initure.Pull = GPIO_PULLDOWN;
	GPIO_Initure.Speed = GPIO_SPEED_FREQ_HIGH;
	HAL_GPIO_Init(GPIOA, &GPIO_Initure);

	HAL_GPIO_WritePin(GPIOA, GPIO_PIN_11, GPIO_PIN_RESET);
	HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_RESET);
	HAL_Delay(300);
}
int main(void)
{
	uint8_t R_Buff[1] = {0};
	HAL_Init();
	SystemClock_Config();

	Read_Flash_Data(R_Buff, 1, FLASH_Updata_Flag_ADDR);
	
	if(R_Buff[0] != 0x55)
	{
		USB_Disconnected();
		MX_GPIO_Init();
		MX_USB_DEVICE_Init();
		printf("Boot Code Start\r\n");
		printf("%s\r\n", Device_Version_Info_Str);
	}
	else
	{

	}
	
	while (1)
	{	
		if(R_Buff[0] == 0x55)
		{
			Jump_To_App(FLASH_APP_ADDR);
		}
		else
		{
			Data_Handler();
		}
	}
}

/**
  * @brief System Clock Configuration
  * @retval None
  */
void SystemClock_Config(void)
{
  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

  /** Configure the main internal regulator output voltage
  */
  __HAL_RCC_PWR_CLK_ENABLE();
  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

  /** Initializes the RCC Oscillators according to the specified parameters
  * in the RCC_OscInitTypeDef structure.
  */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLM = 4;
  RCC_OscInitStruct.PLL.PLLN = 96;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  RCC_OscInitStruct.PLL.PLLQ = 4;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  {
    Error_Handler();
  }

  /** Initializes the CPU, AHB and APB buses clocks
  */
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
  {
    Error_Handler();
  }
}

/* USER CODE BEGIN 4 */

/* USER CODE END 4 */

/**
  * @brief  This function is executed in case of error occurrence.
  * @retval None
  */
void Error_Handler(void)
{
  /* USER CODE BEGIN Error_Handler_Debug */
  /* User can add his own implementation to report the HAL error return state */
  __disable_irq();
  while (1)
  {
  }
  /* USER CODE END Error_Handler_Debug */
}

#ifdef  USE_FULL_ASSERT
/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t *file, uint32_t line)
{
  /* USER CODE BEGIN 6 */
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  /* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */

增加Update.c文件

#include "Update.h"


int fputc(int ch, FILE *f)
{
	while(CDC_Transmit_FS((uint8_t *)&ch, 1) == USBD_BUSY);
	return ch;
}

void Set_Device_Info(void)
{
	uint32_t deviceserial2;
	deviceserial2 = *(uint32_t *) DEVICE_ID3;
	
	sprintf((char *)&Device_SSID_Info, "%d", deviceserial2);
	strcpy((char *)Device_Name_Info, Device_Name_Info_Str);
	strcpy((char *)Device_Version_Info, Device_Version_Info_Str);
}


void Write_Flash(uint8_t *data, uint16_t DataLen, uint32_t Addr)
{
	uint16_t i = 0;
	uint32_t Data = 0;
	uint32_t temp = 0;
    
	HAL_FLASH_Unlock();
	for(i = 0; i < DataLen; i += 4)
	{
        Data = 0;        
        for(uint8_t j = 0; j < 4; j++)
        {
            temp = data[i + j];
            Data |= temp << 8 * j;
        }
        
		if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, FLASH_APP_ADDR + Addr + i, Data) == HAL_OK)
		{
             
		}
	}
	HAL_FLASH_Lock();
}


void Write_Updata_Flag_Flash(void)
{
    HAL_FLASH_Unlock();
    HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, FLASH_Updata_Flag_ADDR, 0x55555555);
    HAL_FLASH_Lock();
}


void Erase_Updata_Flag_Flash(void)
{
	FLASH_EraseInitTypeDef EraseInitStruct;
	HAL_FLASH_Unlock();
	EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;
	EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;
	EraseInitStruct.Sector = UPDATA_FLAG_SECTOR;
	EraseInitStruct.NbSectors = UPDATA_FLAG_SECTOR_NUM;
	if (HAL_FLASHEx_Erase(&EraseInitStruct, &PageError) != HAL_OK)
	{

    }
    HAL_FLASH_Lock();
}

void Erase_APP_Flash(void)
{
	FLASH_EraseInitTypeDef EraseInitStruct;
	HAL_FLASH_Unlock();
	EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;
	EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;
	EraseInitStruct.Sector = UPDATA_APP_SECTOR;
	EraseInitStruct.NbSectors = UPDATA_APP_SECTOR_NUM;
	if (HAL_FLASHEx_Erase(&EraseInitStruct, &PageError) != HAL_OK)
	{

    }
    HAL_FLASH_Lock();
}

void Read_Flash_Data(uint8_t* pBuffer, uint32_t NumToRead, uint32_t ReadAddr)
{
    uint32_t i;
    for (i = 0; i < NumToRead; i++)
    {
        *((uint8_t*)pBuffer + i) = *((uint8_t*)ReadAddr + i);
    }
}

增加Update.h文件

#ifndef __UPDATE_H
#define __UPDATE_H

#include "main.h"
#include <string.h>
#include <stdbool.h>
#include <stdio.h>
#include "usbd_cdc_if.h"

#define ADDR_FLASH_SECTOR_0     ((uint32_t)0x08000000) /* Base @ of Sector 0, 16 Kbytes */
#define ADDR_FLASH_SECTOR_1     ((uint32_t)0x08004000) /* Base @ of Sector 1, 16 Kbytes */
#define ADDR_FLASH_SECTOR_2     ((uint32_t)0x08008000) /* Base @ of Sector 2, 16 Kbytes */
#define ADDR_FLASH_SECTOR_3     ((uint32_t)0x0800C000) /* Base @ of Sector 3, 16 Kbytes */
#define ADDR_FLASH_SECTOR_4     ((uint32_t)0x08010000) /* Base @ of Sector 4, 64 Kbytes */
#define ADDR_FLASH_SECTOR_5     ((uint32_t)0x08020000) /* Base @ of Sector 5, 128 Kbytes */
#define ADDR_FLASH_SECTOR_6     ((uint32_t)0x08040000) /* Base @ of Sector 6, 128 Kbytes */
#define ADDR_FLASH_SECTOR_7     ((uint32_t)0x08060000) /* Base @ of Sector 7, 128 Kbytes */

#define FLASH_Updata_Flag_ADDR	ADDR_FLASH_SECTOR_2
#define FLASH_APP_ADDR	ADDR_FLASH_SECTOR_3

#define UPDATA_FLAG_SECTOR 		FLASH_SECTOR_2
#define UPDATA_FLAG_SECTOR_NUM 	1

#define UPDATA_APP_SECTOR 		FLASH_SECTOR_3
#define UPDATA_APP_SECTOR_NUM 	3


#define         DEVICE_ID3      (UID_BASE + 0x8)
#define Device_Name_Info_Str 	"APM32F411"
#define Device_SSID_Info_Str  	"1234"
#define Device_Version_Info_Str "Boot V 1.0"

extern uint8_t Device_Name_Info[12];
extern uint8_t Device_SSID_Info[12];
extern uint8_t Device_Version_Info[12];
extern uint32_t PageError;


void Erase_APP_Flash(void);
void Erase_Updata_Flag_Flash(void);
void Write_Updata_Flag_Flash(void);
void Write_Flash(uint8_t *data, uint16_t DataLen, uint32_t Addr);
void Read_Flash_Data(uint8_t* pBuffer, uint32_t NumToRead, uint32_t ReadAddr);


void ClearRxQueue(void);
void OnDataReceived(uint8_t val);
void Data_Handler(void);

#endif

修改usbd_cdc_if.c文件如下函数即可。

#include "Update.h"

static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len)
{
	/* USER CODE BEGIN 6 */
	USBD_CDC_SetRxBuffer(&hUsbDeviceFS, &Buf[0]);
	USBD_CDC_ReceivePacket(&hUsbDeviceFS);
	for(int i = 0; i < *Len; i++)
	{
		OnDataReceived(Buf[i]);
	}
	return (USBD_OK);
	/* USER CODE END 6 */
}

接下来进行APP代码修改。可以复制Boot代码进行修改。
对Flash起始地址和大小进行修改。


修改main.c文件

#include "main.h"
#include "usb_device.h"
#include "gpio.h"
#include "Update.h"

void SystemClock_Config(void);

void USB_Disconnected(void) 
{
	__HAL_RCC_USB_OTG_FS_FORCE_RESET();
	HAL_Delay(200);
	__HAL_RCC_USB_OTG_FS_RELEASE_RESET();
	
	GPIO_InitTypeDef GPIO_Initure;
	__HAL_RCC_GPIOA_CLK_ENABLE();

	GPIO_Initure.Pin = GPIO_PIN_11 | GPIO_PIN_12;
	GPIO_Initure.Mode = GPIO_MODE_OUTPUT_PP;
	GPIO_Initure.Pull = GPIO_PULLDOWN;
	GPIO_Initure.Speed = GPIO_SPEED_FREQ_HIGH;
	HAL_GPIO_Init(GPIOA, &GPIO_Initure);

	HAL_GPIO_WritePin(GPIOA, GPIO_PIN_11, GPIO_PIN_RESET);
	HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_RESET);
	HAL_Delay(300);
}
int main(void)
{
	SCB->VTOR = FLASH_APP_ADDR;
	HAL_Init();
	SystemClock_Config();
	USB_Disconnected();

	MX_GPIO_Init();
	MX_USB_DEVICE_Init();
	printf("APP Code Start\r\n");
	printf("%s\r\n", Device_Version_Info_Str);
	while (1)
	{
		Data_Handler();
	}
}

/**
  * @brief System Clock Configuration
  * @retval None
  */
void SystemClock_Config(void)
{
  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

  /** Configure the main internal regulator output voltage
  */
  __HAL_RCC_PWR_CLK_ENABLE();
  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

  /** Initializes the RCC Oscillators according to the specified parameters
  * in the RCC_OscInitTypeDef structure.
  */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLM = 4;
  RCC_OscInitStruct.PLL.PLLN = 96;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  RCC_OscInitStruct.PLL.PLLQ = 4;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  {
    Error_Handler();
  }

  /** Initializes the CPU, AHB and APB buses clocks
  */
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
  {
    Error_Handler();
  }
}

/* USER CODE BEGIN 4 */

/* USER CODE END 4 */

/**
  * @brief  This function is executed in case of error occurrence.
  * @retval None
  */
void Error_Handler(void)
{
  /* USER CODE BEGIN Error_Handler_Debug */
  /* User can add his own implementation to report the HAL error return state */
  __disable_irq();
  while (1)
  {
  }
  /* USER CODE END Error_Handler_Debug */
}

#ifdef  USE_FULL_ASSERT
/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t *file, uint32_t line)
{
  /* USER CODE BEGIN 6 */
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  /* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */

如上就行OTA升级的全部配置步骤。Update.h有很多宏定义可以修改。喜欢的可以下载代码自己试试。代码链接在文章末尾。
打开升级工具


打开升级文件升级后截图

APM32F411Boot源码:跳转链接

APM32F411APP源码:跳转链接

APM32F4XX升级工具:跳转链接

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/963337.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

C#面试十问

1&#xff1a;C#中变量类型分为哪两种&#xff1f;它们的区别是什么&#xff1f;2&#xff1a;Class和Struct的区别&#xff1f;3&#xff1a;C#中类的修饰符和类成员的修饰符有哪些&#xff1f;4&#xff1a;面向对象的三个特征&#xff08;特点&#xff09;是什么&#xff1f…

随机游走任务中时间差分(0)和常数α蒙特卡罗方法的比较

一、说明 在这篇文章中&#xff0c;我们讨论了常α MC 方法和 TD&#xff08;0&#xff09; 方法之间的区别&#xff0c;并比较了它们在随机游走任务中的性能。TD方法在本文的所有测试中都覆盖了MC方法&#xff0c;因此将TD视为强化学习任务的方法是更可取的选择。 二、方法库介…

算法通关村第10关【白银】| 数组中第k大的数

思路&#xff1a;快速排序&#xff0c;每次都定位一个元素&#xff0c;找指定位置的元素还得有序&#xff0c;很容易就想到快排思想 小优化之处就是当前归位元素比目标元素小就继续往右&#xff0c;比目标元素大就往左&#xff0c;相等就返回 class Solution {public int fin…

【算法竞赛宝典】稀疏数组

【算法竞赛宝典】稀疏数组 题目描述代码展示 题目描述 代码展示 random.cpp #include <iostream>using namespace std;int main() {freopen("zip5.in", "w", stdout);int n, m;cin >> n >> m;cout << n << << m <…

小白入门python

建议用vscode进行代码学习 vscode下载地址:Download Visual Studio Code - Mac, Linux, Windows 左侧点击扩展安装python,右下角选择python版本&#xff0c;记得配置系统环境变量&#xff0c;python在系统(cmd)的版本由环境变量优先级决定,在编程软件中由自己选择解释器

4.1 链式栈StackT

C关键词&#xff1a;内部类/模板类/头插 C自学精简教程 目录(必读) C数据结构与算法实现&#xff08;目录&#xff09; 栈的内存结构 空栈&#xff1a; 有一个元素的栈&#xff1a; 多个元素的栈&#xff1a; 成员函数说明 0 clear 清空栈 clear 函数负责将栈的对内存释放…

为什么磁盘满可能导致cpu使用率飙升

先说原因 因为当文件在安装和卸载的时候&#xff0c;会使硬盘中的数据排列非常分散或者断断续续的&#xff0c;让电脑在查找时速度变慢&#xff0c;就造成大量的使用CPU资源。这时就需要更换CPU。 案例 事件描述 公司监控系统事件报警某个应用的磁盘满了。通过后端执行命令发现…

linux编程--进程--进程相关概念

5个问题了解进程&#xff1a; 什么是程序&#xff0c;什么是进程&#xff0c;有什么区别如何查看系统中有哪些进程&#xff1f;什么是进程标识符&#xff1f;什么叫父进程&#xff0c;什么叫子进程&#xff1f;c程序的存储空间是如何分配的&#xff1f; 1.程序是静态的概念&a…

【力扣】96. 不同的二叉搜索树 <动态规划>

【力扣】96. 不同的二叉搜索树 给你一个整数 n &#xff0c;求恰由 n 个节点组成且节点值从 1 到 n 互不相同的 二叉搜索树 有多少种&#xff1f;返回满足题意的二叉搜索树的种数。 示例 1&#xff1a; 输入&#xff1a;n 3 输出&#xff1a;5 示例 2&#xff1a; 输入&am…

算法竞赛备赛之数学知识训练提升,暑期集训营培训

1.质数 在大于1的整数&#xff0c;如果质包含1和本身这两个约数&#xff0c;就称之为素数/质数。 1.质数的判定&#xff08;试除法&#xff09; 优化后的&#xff1a; #include<iostream> #include<algorithm> ​ using namespace std; ​ bool is_prime(int n…

Multisim14.0仿真(五)三角波发生器

一、仿真原理图&#xff1a; 二、仿真效果&#xff1a;

微服务架构|go-zero 的自适应熔断器

原文链接&#xff1a; go-zero 的自适应熔断器 上篇文章我们介绍了微服务的限流&#xff0c;详细分析了计数器限流和令牌桶限流算法&#xff0c;这篇文章来说说熔断。 熔断和限流还不太一样&#xff0c;限流是控制请求速率&#xff0c;只要还能承受&#xff0c;那么都会处理&…

Meta AI的Nougat能够将数学表达式从PDF文件转换为机器可读文本

大多数科学知识通常以可移植文档格式&#xff08;PDF&#xff09;的形式存储&#xff0c;这也是互联网上第二突出的数据格式。然而&#xff0c;从这种格式中提取信息或将其转换为机器可读的文本具有挑战性&#xff0c;尤其是在涉及数学表达式时。 为了解决这个问题&#xff0c…

Sharding-JDBC(九)5.3.0版本,实现按月分表、自动建表、自动刷新节点

目录 一、简介二、Maven依赖三、配置文件application.ymlsharding.yaml 四、代码实现1.自动建表、自动刷新节点思路2.创建表结构3.TimeShardingAlgorithm.java 分片算法类4.ShardingAlgorithmTool.java 分片工具类5.ShardingTablesLoadRunner.java 初始化缓存类6.SpringUtil.ja…

xss前十二关靶场练习

目录 一、xss原理和分类 1.原理 2.分类&#xff1a;xss分为存储型和反射型以及dom型 &#xff08;1&#xff09;反射性 &#xff08;2&#xff09;存储型 &#xff08;3&#xff09;dom型 二、靶场关卡练习​编辑 1.第一关 2.第二关 3.第三关 4.第四关 5.第五关 6…

flutter plugins插件【三】【Flutter Intl】

3、 Flutter Intl 多语言国际化 在Android Studio中菜单Tools找到flutter intl创建多语言配置。 创建后会在pubspec.yaml出现 flutter_intl:enabled: true 在工程的lib会生成l10n与generated文件夹 l10n包含 intl_en.arb intl_zn.arb 我们在intl_en.arb添加 { home: &quo…

常见的存储结构

分析&回答 本文只作为了解&#xff0c;让大家理解 B数跟透传&#xff0c;可以不刷哈。 常见的存储结构&#xff1a; 我们计算机的主存基本都是随机访问存储器(Random-Access Memory&#xff0c;RAM)&#xff0c;他分为两类&#xff1a;静态随机访问存储器&#xff08;SRA…

iPhone 15 Ultra都要来啦?顶配8GB 内存、2TB存储,满足任何想象

据相关媒体透露&#xff0c;苹果计划在今年9月推出全新的iPhone 15系列。除了已确认的iPhone 15 Pro和iPhone 15 Pro Max之外&#xff0c;还有一款名为iPhone 15 Ultra至尊版的机型将会问世。 这款iPhone 15 Ultra将成为苹果旗舰系列的巅峰之作&#xff0c;预计将配备更高配置和…

【算法竞赛宝典】语言之争

【算法竞赛宝典】语言之争 题目描述代码展示 题目描述 代码展示 //语言之争 #include<fstream> #include<string>using namespace std;ifstream cin("language.in"); ofstream cout("language.out");string a; int n;int main() {int i;bool …

快速建设数字工厂管理系统,需要做好哪些准备

随着工业4.0的推进&#xff0c;数字工厂管理系统已经在全球范围内得到了广泛的应用。在中国&#xff0c;许多制造业企业也逐步认识到数字化转型的重要性&#xff0c;开始积极探索和实施数字工厂管理系统。那么&#xff0c;在快速建设数字工厂管理系统的过程中&#xff0c;需要做…