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-A): System Configuration Files system_<Device>.c and system_<Device>.h</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-A)
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-A 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('system_c_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">System Configuration Files system_<Device>.c and system_<Device>.h </div></div>
132 <div class="contents">
133 <div class="textblock"><p>The <a class="el" href="system_c_pg.html">System Configuration Files system_<Device>.c and system_<Device>.h</a> provides as a minimum the functions described under <a class="el" href="group__system__init__gr.html">System and Clock Configuration</a>. These functions are device specific and need adaptations. In addition, the file might have configuration settings for the device such as XTAL frequency or PLL prescaler settings.</p>
134 <p>For devices with external memory BUS the system_<Device>.c also configures the BUS system.</p>
135 <p>The silicon vendor might expose other functions (i.e. for power configuration) in the system_<Device>.c file.</p>
136 <p>In case of additional features the function prototypes need to be added to the system_<Device>.h header file.</p>
137 <h1><a class="anchor" id="system_Device_sec"></a>
138 system_Device.c Template File</h1>
139 <p>The <a class="el" href="system_c_pg.html#system_Device_sec">system_Device.c Template File</a> is shown below.</p>
140 <pre class="fragment">/******************************************************************************
141 * @file system_<Device>.c
142 * @brief CMSIS Cortex-A Device Peripheral Access Layer
144 * @date 10. January 2018
145 ******************************************************************************/
147 * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
149 * SPDX-License-Identifier: Apache-2.0
151 * Licensed under the Apache License, Version 2.0 (the License); you may
152 * not use this file except in compliance with the License.
153 * You may obtain a copy of the License at
155 * www.apache.org/licenses/LICENSE-2.0
157 * Unless required by applicable law or agreed to in writing, software
158 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
159 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
160 * See the License for the specific language governing permissions and
161 * limitations under the License.
164 #include <stdint.h>
165 #include "<Device>.h" /* ToDo: replace '<Device>' with your device name */
166 #include "irq_ctrl.h"
168 /*----------------------------------------------------------------------------
170 *----------------------------------------------------------------------------*/
171 /* ToDo: add here your necessary defines for device initialization
172 following is an example for different system frequencies */
173 #define XTAL (12000000U) /* Oscillator frequency */
175 #define SYSTEM_CLOCK (5 * XTAL)
178 /*----------------------------------------------------------------------------
179 System Core Clock Variable
180 *----------------------------------------------------------------------------*/
181 /* ToDo: initialize SystemCoreClock with the system core clock frequency value
182 achieved after system intitialization.
183 This means system core clock frequency after call to SystemInit() */
184 uint32_t SystemCoreClock = SYSTEM_CLOCK; /* System Clock Frequency (Core Clock)*/
188 /*----------------------------------------------------------------------------
190 *----------------------------------------------------------------------------*/
192 void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
194 /* ToDo: add code to calculate the system frequency based upon the current
196 This function can be used to retrieve the system core clock frequeny
197 after user changed register sittings. */
198 SystemCoreClock = SYSTEM_CLOCK;
202 /*----------------------------------------------------------------------------
203 System Initialization
204 *----------------------------------------------------------------------------*/
205 void SystemInit (void)
207 /* ToDo: add code to initialize the system
208 Do not use global variables because this function is called before
209 reaching pre-main. RW section may be overwritten afterwards. */
210 SystemCoreClock = SYSTEM_CLOCK;
212 // Invalidate entire Unified TLB
215 // Invalidate entire branch predictor array
220 // Invalidate instruction cache and flush branch target cache
225 // Invalidate data cache
226 L1C_InvalidateDCacheAll();
228 // Create Translation Table
229 MMU_CreateTranslationTable();
238 #if (__L2C_PRESENT == 1)
243 #if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
251 </pre><h1><a class="anchor" id="system_Device_h_sec"></a>
252 system_Device.h Template File</h1>
253 <p>The system_<Device>.h header file contains prototypes to access the public functions in the system_<device>.c file. The <a class="el" href="system_c_pg.html#system_Device_h_sec">system_Device.h Template File</a> is shown below.</p>
254 <pre class="fragment">/**************************************************************************//**
255 * @file system_<Device>.h
256 * @brief CMSIS Cortex-A Device Peripheral Access Layer
258 * @date 10. January 2018
259 ******************************************************************************/
261 * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
263 * SPDX-License-Identifier: Apache-2.0
265 * Licensed under the Apache License, Version 2.0 (the License); you may
266 * not use this file except in compliance with the License.
267 * You may obtain a copy of the License at
269 * www.apache.org/licenses/LICENSE-2.0
271 * Unless required by applicable law or agreed to in writing, software
272 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
273 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
274 * See the License for the specific language governing permissions and
275 * limitations under the License.
278 #ifndef SYSTEM_<Device>_H /* ToDo: replace '<Device>' with your device name */
279 #define SYSTEM_<Device>_H
285 #include <stdint.h>
287 extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
290 \brief Setup the microcontroller system.
292 Initialize the System and update the SystemCoreClock variable.
294 extern void SystemInit (void);
297 \brief Update SystemCoreClock variable.
299 Updates the SystemCoreClock with current core Clock retrieved from cpu registers.
301 extern void SystemCoreClockUpdate (void);
304 \brief Create Translation Table.
306 Creates Memory Management Unit Translation Table.
308 extern void MMU_CreateTranslationTable(void);
314 #endif /* SYSTEM_<Device>_H */
315 </pre> </div></div><!-- contents -->
316 </div><!-- PageDoc -->
317 </div><!-- doc-content -->
318 <!-- start footer part -->
319 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
322 <script type="text/javascript">
324 writeFooter.call(this);