1 <!-- HTML header for doxygen 1.9.6-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <meta http-equiv="X-UA-Compatible" content="IE=11"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>CMSIS-Core (Cortex-M): Using CMSIS in Embedded Applications</title>
9 <link href="doxygen.css" rel="stylesheet" type="text/css"/>
10 <link href="tabs.css" rel="stylesheet" type="text/css"/>
11 <link href="extra_navtree.css" rel="stylesheet" type="text/css"/>
12 <link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
13 <link href="extra_search.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="jquery.js"></script>
15 <script type="text/javascript" src="dynsections.js"></script>
16 <script type="text/javascript" src="printComponentTabs.js"></script>
17 <script type="text/javascript" src="footer.js"></script>
18 <script type="text/javascript" src="navtree.js"></script>
19 <link href="navtree.css" rel="stylesheet" type="text/css"/>
20 <script type="text/javascript" src="resize.js"></script>
21 <script type="text/javascript" src="navtreedata.js"></script>
22 <script type="text/javascript" src="navtree.js"></script>
23 <link href="search/search.css" rel="stylesheet" type="text/css"/>
24 <script type="text/javascript" src="search/searchdata.js"></script>
25 <script type="text/javascript" src="search/search.js"></script>
26 <script type="text/javascript">
27 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
28 $(document).ready(function() { init_search(); });
31 <script type="text/javascript" src="darkmode_toggle.js"></script>
32 <link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
33 <link href="extra_navtree.css" rel="stylesheet" type="text/css"/>
34 <link href="extra_search.css" rel="stylesheet" type="text/css"/>
35 <link href="version.css" rel="stylesheet" type="text/css" />
36 <script type="text/javascript" src="../../../version.js"></script>
39 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
41 <table cellspacing="0" cellpadding="0">
43 <tr style="height: 55px;">
44 <td id="projectlogo" style="padding: 1.5em;"><img alt="Logo" src="cmsis_logo_white_small.png"/></td>
45 <td style="padding-left: 1em; padding-bottom: 1em;padding-top: 1em;">
46 <div id="projectname">CMSIS-Core (Cortex-M)
47  <span id="projectnumber"><script type="text/javascript">
49 writeHeader.call(this);
50 writeVersionDropdown.call(this);
55 <div id="projectbrief">CMSIS-Core support for Cortex-M processor-based devices</div>
57 <td> <div id="MSearchBox" class="MSearchBoxInactive">
59 <span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
60 <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
61 onfocus="searchBox.OnSearchFieldFocus(true)"
62 onblur="searchBox.OnSearchFieldFocus(false)"
63 onkeyup="searchBox.OnSearchFieldChange(event)"/>
64 </span><span class="right">
65 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
69 <!--END !PROJECT_NAME-->
74 <!-- end header part -->
75 <div id="CMSISnav" class="tabs1">
77 <script type="text/javascript">
78 writeComponentTabs.call(this);
82 <script type="text/javascript">
83 writeSubComponentTabs.call(this);
85 <!-- Generated by Doxygen 1.9.6 -->
86 <script type="text/javascript">
87 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
88 var searchBox = new SearchBox("searchBox", "search/",'.html');
92 <div id="side-nav" class="ui-resizable side-nav-resizable">
94 <div id="nav-tree-contents">
95 <div id="nav-sync" class="sync"></div>
98 <div id="splitbar" style="-moz-user-select:none;"
99 class="ui-resizable-handle">
102 <script type="text/javascript">
103 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
104 $(document).ready(function(){initNavTree('using_pg.html',''); initResizable(); });
107 <div id="doc-content">
108 <!-- window showing the filter options -->
109 <div id="MSearchSelectWindow"
110 onmouseover="return searchBox.OnSearchSelectShow()"
111 onmouseout="return searchBox.OnSearchSelectHide()"
112 onkeydown="return searchBox.OnSearchSelectKey(event)">
115 <!-- iframe showing the search results (closed by default) -->
116 <div id="MSearchResultsWindow">
117 <div id="MSearchResults">
120 <div id="SRResults"></div>
121 <div class="SRStatus" id="Loading">Loading...</div>
122 <div class="SRStatus" id="Searching">Searching...</div>
123 <div class="SRStatus" id="NoMatches">No Matches</div>
129 <div><div class="header">
130 <div class="headertitle"><div class="title">Using CMSIS in Embedded Applications </div></div>
132 <div class="contents">
133 <div class="textblock"><p>To use the CMSIS-Core (Cortex-M) the following files are added to the embedded application:</p><ul>
134 <li><a class="el" href="startup_c_pg.html">Startup File startup_<device>.c</a> (formerly <a class="el" href="startup_s_pg.html">Startup File startup_<device>.s (deprecated)</a>) with reset handler and exception vectors.</li>
135 <li><a class="el" href="system_c_pg.html">System Configuration Files system_<device>.c and system_<device>.h</a> with general device configuration (i.e. for clock and BUS setup).</li>
136 <li><a class="el" href="device_h_pg.html">Device Header File <device.h></a> gives access to processor core and all peripherals.</li>
138 <dl class="section note"><dt>Note</dt><dd>The files <a class="el" href="startup_c_pg.html">Startup File startup_<device>.c</a> (or <a class="el" href="startup_s_pg.html">Startup File startup_<device>.s (deprecated)</a>) and <a class="el" href="system_c_pg.html">System Configuration Files system_<device>.c and system_<device>.h</a> may require application specific adaptations and therefore should be copied into the application project folder prior configuration. The <a class="el" href="device_h_pg.html">Device Header File <device.h></a> is included in all source files that need device access and can be stored on a central include folder that is generic for all projects.</dd></dl>
139 <p>The <a class="el" href="startup_c_pg.html">Startup File startup_<device>.c</a> (or <a class="el" href="startup_s_pg.html">Startup File startup_<device>.s (deprecated)</a>) is executed after reset and calls <a class="el" href="group__system__init__gr.html#ga93f514700ccf00d08dbdcff7f1224eb2">SystemInit</a>. After the system initialization control is transferred to the C/C++ run-time library which performs initialization and calls the <b>main</b> function in the user code. In addition the <a class="el" href="startup_c_pg.html">Startup File startup_<device>.c</a> (or <a class="el" href="startup_s_pg.html">Startup File startup_<device>.s (deprecated)</a>) contains all exception and interrupt vectors and implements a default function for every interrupt. It may also contain stack and heap configurations for the user application.</p>
140 <p>The <a class="el" href="system_c_pg.html">System Configuration Files system_<device>.c and system_<device>.h</a> performs the setup for the processor clock. The variable <a class="el" href="group__system__init__gr.html#gaa3cd3e43291e81e795d642b79b6088e6">SystemCoreClock</a> indicates the CPU clock speed. <a class="el" href="group__system__init__gr.html">System and Clock Configuration</a> describes the minimum feature set. In addition the file may contain functions for the memory BUS setup and clock re-configuration.</p>
141 <p>The <a class="el" href="device_h_pg.html">Device Header File <device.h></a> is the central include file that the application programmer is using in the C source code. It provides the following features:</p><ul>
142 <li><a class="el" href="group__peripheral__gr.html">Peripheral Access</a> provides a standardized register layout for all peripherals. Optionally functions for device-specific peripherals may be available.</li>
143 <li><a class="el" href="group__NVIC__gr.html">Interrupts and Exceptions (NVIC)</a> can be accessed with standardized symbols and functions for the Nested Interrupt Vector Controller (NVIC) are provided.</li>
144 <li><a class="el" href="group__intrinsic__CPU__gr.html">Intrinsic Functions for CPU Instructions</a> allow to access special instructions, for example for activating sleep mode or the NOP instruction.</li>
145 <li><a class="el" href="group__intrinsic__SIMD__gr.html">Intrinsic Functions for SIMD Instructions</a> provide access to the DSP-oriented instructions.</li>
146 <li><a class="el" href="group__SysTick__gr.html">Systick Timer (SYSTICK)</a> function to configure and start a periodic timer interrupt.</li>
147 <li><a class="el" href="group__ITM__Debug__gr.html">Debug Access</a> are functions that allow printf-style I/O via the CoreSight Debug Unit and ITM communication.</li>
149 <p>CMSIS-Pack provides the <b>#define CMSIS_header_file</b> in <a href="../../Pack/html/pdsc_components_pg.html#RTE_Components_h"><b>RTE_Components.h</b></a> which gives you access to this <b><em>device</em>.h</b> file.</p>
151 <img src="CMSIS_CORE_Files_USER.png" alt=""/>
152 <div class="caption">
153 CMSIS-Core (Cortex-M) User Files</div></div>
154 <p>The CMSIS-Core (Cortex-M) system files are device specific. In addition, the deprecated <a class="el" href="startup_s_pg.html">Startup File startup_<device>.s (deprecated)</a> is also compiler vendor specific. The versions provided by CMSIS are only generic templates. The adopted versions for a concrete device are typically provided by the device vendor through the according device family pack (DFP).</p>
155 <p>For example, the following files are provided by the STM32F10x device family pack:</p>
156 <table class="cmtable">
158 <th>File </th><th>Description </th></tr>
160 <td>".\Device\Source\ARM\startup_stm32f10x_cl.s" </td><td><a class="el" href="startup_s_pg.html">Startup File startup_<device>.s (deprecated)</a> for the STM32F10x Connectivity Line device variants. </td></tr>
162 <td>".\Device\Source\system_stmf10x.c" </td><td><a class="el" href="system_c_pg.html">System Configuration Files system_<device>.c and system_<device>.h</a> for the STM32F10x device families. </td></tr>
164 <td>".\Device\Include\stm32f10x.h" </td><td><a class="el" href="device_h_pg.html">Device Header File <device.h></a> for the STM32F10x device families. </td></tr>
166 <td>".\Device\Include\system_stm32f10x.h" </td><td><a class="el" href="system_c_pg.html#system_Device_h_sec">system_Device.h Template File</a> for the STM32F10x device families. </td></tr>
168 <dl class="section note"><dt>Note</dt><dd>The silicon vendors create these device-specific CMSIS-Core (Cortex-M) files based on <a class="el" href="templates_pg.html">CMSIS-Core Device Templates</a> provide by Arm.</dd></dl>
169 <p>Thereafter, the functions described under <a href="modules.html"><b>Reference</b> </a> can be used in the application.</p>
170 <p><b>Examples</b> </p><ul>
171 <li><a class="el" href="using_CMSIS.html">Basic CMSIS Example</a> is a simple example that shows the usage of the CMSIS layer.</li>
172 <li><a class="el" href="using_VTOR_pg.html">Using Interrupt Vector Remap</a> shows how to remap the interrupt vector table.</li>
173 <li><a class="el" href="using_ARM_pg.html">Using CMSIS with generic Arm Processors</a> explains how to use CMSIS-Core (Cortex-M) for Arm processors. </li>
175 </div></div><!-- contents -->
176 </div><!-- PageDoc -->
177 </div><!-- doc-content -->
178 <!-- start footer part -->
179 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
182 <script type="text/javascript">
184 writeFooter.call(this);