当前位置:   article > 正文

STM32F103C8T6开发环境的搭建(畅通无阻)_stm32f103c8t6芯片常用软件

stm32f103c8t6芯片常用软件

目录

一、硬件包下载

二、标准库下载

三、库导入

四、编译


       STM32使用keil5 MDK-ARM开发。 基于stm32f103c8t6芯片的开发板网上主流的一款开发板,资料多,开源项目也多,便于入门。stm32f103c8t6开发板拥有着主流增强型ARM Cortex-M3 MCU,具有64 KB Flash、72 MHz CPU、电机控制、USB和CAN等。这里没有给keil和protues软件资源,因为知识产权保护,大家可以去网上找。

一、硬件包下载

        官网查得该系列属于STM32F1系列

非官网下载渠道,但下载速度快(不是最新的库,已经够用了)

       进入网页后点击上图圈出的就可以下载了,下载完成以后,双击硬件包,一直点next就行,安装完成,点finish。

二、标准库下载

官网下载渠道,下载速度慢(标准库到3.6就一直没更新了)

        进入网页后,点击Get latest 即可开始下载,完成后解压到自己便于查找的位置。

三、库导入

        在自己方便查找的地方新建一个demo文件夹。

        再新建project放到demo文件夹下。

 

         然后选择CPU stm32f103c8。

 

         点击图中蓝色圈出的地方,添加组cmsis,startup,std,users。

 

        将下载的标准库里面的文件批量添加到各个组里(可先将标准库文件下的二级文件复制到demo文件夹下,再添加,以免后续编译时出现错误,比如编译器找不到头文件等),添加完毕后点击OK。

 

        然后点击魔术棒,点击C/C++栏,IncludePaths添加所有组里.c和.s文件对应的.h文件的文件夹(这里涉及到编译的原理,暂时不用深究)。

         接着再Define框内写上USE_STDPERIPH_DRIVER。

          最后新建main.c和stm32f10x_conf.h文件到user组里。

  1. #include "Device/Include/stm32f10x.h" // Device header
  2. int main()
  3. {
  4. while(1);
  5. }
  1. /**
  2. ******************************************************************************
  3. * @file CortexM3/MPU/stm32f10x_conf.h
  4. * @author MCD Application Team
  5. * @version V3.6.0
  6. * @date 20-September-2021
  7. * @brief Library configuration file.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * Copyright (c) 2011 STMicroelectronics.
  12. * All rights reserved.
  13. *
  14. * This software is licensed under terms that can be found in the LICENSE file
  15. * in the root directory of this software component.
  16. * If no LICENSE file comes with this software, it is provided AS-IS.
  17. *
  18. ******************************************************************************
  19. */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __STM32F10x_CONF_H
  22. #define __STM32F10x_CONF_H
  23. /* Includes ------------------------------------------------------------------*/
  24. /* Uncomment/Comment the line below to enable/disable peripheral header file inclusion */
  25. #include "stm32f10x_adc.h"
  26. #include "stm32f10x_bkp.h"
  27. #include "stm32f10x_can.h"
  28. #include "stm32f10x_cec.h"
  29. #include "stm32f10x_crc.h"
  30. #include "stm32f10x_dac.h"
  31. #include "stm32f10x_dbgmcu.h"
  32. #include "stm32f10x_dma.h"
  33. #include "stm32f10x_exti.h"
  34. #include "stm32f10x_flash.h"
  35. #include "stm32f10x_fsmc.h"
  36. #include "stm32f10x_gpio.h"
  37. #include "stm32f10x_i2c.h"
  38. #include "stm32f10x_iwdg.h"
  39. #include "stm32f10x_pwr.h"
  40. #include "stm32f10x_rcc.h"
  41. #include "stm32f10x_rtc.h"
  42. #include "stm32f10x_sdio.h"
  43. #include "stm32f10x_spi.h"
  44. #include "stm32f10x_tim.h"
  45. #include "stm32f10x_usart.h"
  46. #include "stm32f10x_wwdg.h"
  47. #include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
  48. /* Exported types ------------------------------------------------------------*/
  49. /* Exported constants --------------------------------------------------------*/
  50. /* Uncomment the line below to expanse the "assert_param" macro in the
  51. Standard Peripheral Library drivers code */
  52. /* #define USE_FULL_ASSERT 1 */
  53. /* Exported macro ------------------------------------------------------------*/
  54. #ifdef USE_FULL_ASSERT
  55. /**
  56. * @brief The assert_param macro is used for function's parameters check.
  57. * @param expr: If expr is false, it calls assert_failed function which reports
  58. * the name of the source file and the source line number of the call
  59. * that failed. If expr is true, it returns no value.
  60. * @retval None
  61. */
  62. #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
  63. /* Exported functions ------------------------------------------------------- */
  64. void assert_failed(uint8_t* file, uint32_t line);
  65. #else
  66. #define assert_param(expr) ((void)0)
  67. #endif /* USE_FULL_ASSERT */
  68. #endif /* __STM32F10x_CONF_H */
  69. /**
  70. ******************************************************************************
  71. * @file CortexM3/MPU/stm32f10x_conf.h
  72. * @author MCD Application Team
  73. * @version V3.6.0
  74. * @date 20-September-2021
  75. * @brief Library configuration file.
  76. ******************************************************************************
  77. * @attention
  78. *
  79. * Copyright (c) 2011 STMicroelectronics.
  80. * All rights reserved.
  81. *
  82. * This software is licensed under terms that can be found in the LICENSE file
  83. * in the root directory of this software component.
  84. * If no LICENSE file comes with this software, it is provided AS-IS.
  85. *
  86. ******************************************************************************
  87. */
  88. /* Define to prevent recursive inclusion -------------------------------------*/
  89. #ifndef __STM32F10x_CONF_H
  90. #define __STM32F10x_CONF_H
  91. /* Includes ------------------------------------------------------------------*/
  92. /* Uncomment/Comment the line below to enable/disable peripheral header file inclusion */
  93. #include "stm32f10x_adc.h"
  94. #include "stm32f10x_bkp.h"
  95. #include "stm32f10x_can.h"
  96. #include "stm32f10x_cec.h"
  97. #include "stm32f10x_crc.h"
  98. #include "stm32f10x_dac.h"
  99. #include "stm32f10x_dbgmcu.h"
  100. #include "stm32f10x_dma.h"
  101. #include "stm32f10x_exti.h"
  102. #include "stm32f10x_flash.h"
  103. #include "stm32f10x_fsmc.h"
  104. #include "stm32f10x_gpio.h"
  105. #include "stm32f10x_i2c.h"
  106. #include "stm32f10x_iwdg.h"
  107. #include "stm32f10x_pwr.h"
  108. #include "stm32f10x_rcc.h"
  109. #include "stm32f10x_rtc.h"
  110. #include "stm32f10x_sdio.h"
  111. #include "stm32f10x_spi.h"
  112. #include "stm32f10x_tim.h"
  113. #include "stm32f10x_usart.h"
  114. #include "stm32f10x_wwdg.h"
  115. #include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
  116. /* Exported types ------------------------------------------------------------*/
  117. /* Exported constants --------------------------------------------------------*/
  118. /* Uncomment the line below to expanse the "assert_param" macro in the
  119. Standard Peripheral Library drivers code */
  120. /* #define USE_FULL_ASSERT 1 */
  121. /* Exported macro ------------------------------------------------------------*/
  122. #ifdef USE_FULL_ASSERT
  123. /**
  124. * @brief The assert_param macro is used for function's parameters check.
  125. * @param expr: If expr is false, it calls assert_failed function which reports
  126. * the name of the source file and the source line number of the call
  127. * that failed. If expr is true, it returns no value.
  128. * @retval None
  129. */
  130. #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
  131. /* Exported functions ------------------------------------------------------- */
  132. void assert_failed(uint8_t* file, uint32_t line);
  133. #else
  134. #define assert_param(expr) ((void)0)
  135. #endif /* USE_FULL_ASSERT */
  136. #endif /* __STM32F10x_CONF_H */

四、编译

        勾选Create HEX File并设定晶振频率。

        点击编译。

        没出现任何报错,之后会慢慢的更新一些实用的嵌入式项目,感谢各位的支持(*^_^*)!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/433210
推荐阅读
相关标签
  

闽ICP备14008679号