首页 > 编程语言 >为什么 Keil 中C/C++选项要 define STM32F10X_LD/MD/HD

为什么 Keil 中C/C++选项要 define STM32F10X_LD/MD/HD

时间:2023-06-26 16:24:02浏览次数:41  
标签:MD LD density STM32F10X devices Keil HD define

原因1:配置相应的中断向量表

 原因2:配置相应的寄存器

 

 

总结原因:

因为所有的 stm32f10x 系列的芯片都会用到 stm32f10x.h  这个头文件,

但是问题的所在是:每种芯片的配置不同(中断向量个数、寄存器个数等等)

因此宏条件编译 #if !defined 判断这个宏(这个宏就是 STM32F10X_LD/MD/HD),配置不同芯片的参数。

 官方对不同芯片的宏定义参照以下内容:

 

/* #define STM32F10X_LD */ /*!< STM32F10X_LD: STM32 Low density devices */
/* #define STM32F10X_LD_VL */ /*!< STM32F10X_LD_VL: STM32 Low density Value Line devices */
/* #define STM32F10X_MD */ /*!< STM32F10X_MD: STM32 Medium density devices */
/* #define STM32F10X_MD_VL */ /*!< STM32F10X_MD_VL: STM32 Medium density Value Line devices */
/* #define STM32F10X_HD */ /*!< STM32F10X_HD: STM32 High density devices */
/* #define STM32F10X_HD_VL */ /*!< STM32F10X_HD_VL: STM32 High density value line devices */
/* #define STM32F10X_XL */ /*!< STM32F10X_XL: STM32 XL-density devices */
/* #define STM32F10X_CL */ /*!< STM32F10X_CL: STM32 Connectivity line devices */

 

- Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
where the Flash memory density ranges between 16 and 32 Kbytes.
- Low-density value line devices are STM32F100xx microcontrollers where the Flash
memory density ranges between 16 and 32 Kbytes.
- Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
where the Flash memory density ranges between 64 and 128 Kbytes.
- Medium-density value line devices are STM32F100xx microcontrollers where the
Flash memory density ranges between 64 and 128 Kbytes.
- High-density devices are STM32F101xx and STM32F103xx microcontrollers where
the Flash memory density ranges between 256 and 512 Kbytes.
- High-density value line devices are STM32F100xx microcontrollers where the
Flash memory density ranges between 256 and 512 Kbytes.
- XL-density devices are STM32F101xx and STM32F103xx microcontrollers where
the Flash memory density ranges between 512 and 1024 Kbytes.
- Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.

由上面的引用可知,STM32F103C8T6 为64KB FLASH,应该为STM32F10X_MD 。

野火教程使用的 STM32F103VET6 为 512KB FLASH, 应该为STM32F10X_HD。

标签:MD,LD,density,STM32F10X,devices,Keil,HD,define
From: https://www.cnblogs.com/FBsharl/p/17505968.html

相关文章

  • 07.生成器模式(Builder)
    使用生成器模式来解决问题定义将一个复杂对象的构建与它的表示分离,使得同样的构建过程可以创建不同的表示。生成器模式的结构和说明Builder:生成器接口,定义创建一个Product对象所需的各个部件的操作。ConcreteBuilder:具体的生成器实现,实现各个部件的创建,并负责组装Produ......
  • NetCore使用使用Scaffold-DbContext命令生成数据库表实体类
    1.根据数据库生成实体类ModelsScaffold-DbContext"DataSource=.;InitialCatalog=TEST;UserID=sa;Password=pwd;TrustServerCertificate=True"Microsoft.EntityFrameworkCore.SqlServer-OutputDirModels-Force  2.根据数据表生成实体类ModelsScaffold-DbConte......
  • R语言618电商大数据文本分析LDA主题模型可视化报告|附代码数据
    原文链接:http://tecdat.cn/?p=1078最近我们被客户要求撰写关于文本分析LDA主题模型的研究报告,包括一些图形和统计输出。618购物狂欢节前后,网民较常搜索的关键词在微博、微信、新闻三大渠道的互联网数据表现,同时通过分析平台采集618相关媒体报道和消费者提及数据社交媒体指数趋......
  • 安卓装包失败提示 Package xxx could not be assigned a valid UID解决方案
    1.因为新装包规则是总当前uid往后分配,所以我要找到uid最大的几个应用 cat/data/system/packages.list|awk'{print$2}'|sort-n 2.根据查到的uid分别找出对应包名去卸载cat/data/system/packages.list|grep查询到的uid  awk'{print$1,$2}' 3.......
  • Could not resolve type alias 'com.github.mybatis.helper.page.PageSqlInterceptor'
    报错信息 Couldnotresolvetypealias'com.github.mybatis.helper.page.PageSqlInterceptor'.Cause:java.lang.ClassNotFoundException:Cannotfindclass:com.github.mybatis.helper.page.PageSqlInterceptor 原因报错的位置是 mybatis-config.xml 文件中......
  • mysqldump 介绍
    使用mysqldump命令来备份MySQL数据库。mysqldump命令是MySQL自带的备份工具,可以将MySQL数据库备份成SQL文件。mysqldump是MySQL用于转存储数据库的实用程序。它主要产生一个SQL脚本,其中包含从头重新创建数据库所必需的命令CREATETABLE、INSERT等。mysqldump的运行机制......
  • PANDACU: Second Hand Brand Bags Used Handbag Brand Purse Shoulder Bags Wholesale
    PANDACUisatrustedwholesalesupplierspecializinginsecond-handbrandbags,includingusedhandbagsandbrandpurses.Theyofferawiderangeofoptionsforretailers,resellers,anddistributorsseekinghigh-qualityshoulderbagsatwholesaleprices.......
  • Could not locate zlibwapi.dll. Please make sure it is in your library path
    再跑CNN程序的时候报了这个错2023-06-2321:11:52.069321:Itensorflow/core/platform/cpu_feature_guard.cc:151]ThisTensorFlowbinaryisoptimizedwithoneAPIDeepNeuralNetworkLibrary(oneDNN)tousethefollowingCPUinstructionsinperformance-criticalop......
  • Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
     001、问题cmake报错[root@PC1build]#cmake.. 002、解决方法,下载zlib并安装官网:http://www.zlib.net/a、下载 b、解压并安装[root@PC1software]#tar-xzvfzlib-1.2.13.tar.gz[root@PC1software]#cdzlib-1.2.13/[[email protected]]#./configur......
  • “NTLDR is missing”是指在Windows启动过程中发生了一个错误,系统找不到NTLDR文件。NT
    NTLDR(NTLoader)是Windows操作系统早期版本(如WindowsNT和WindowsXP)使用的引导加载程序。随着后续Windows版本的发布,引导加载程序也发生了一些变化和更新。以下是各个版本中NTLDR的功能更新的简要说明:WindowsNT4.0:支持在启动时选择使用哪个操作系统。提供了基本的恢复控制台......