]> begriffs open source - cmsis/blob - CMSIS/Documentation/Core/html/partition_h_pg.html
adding documentation for section 'Core'
[cmsis] / CMSIS / Documentation / Core / html / partition_h_pg.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <title>System Partition Header File partition_&lt;device&gt;.h</title>
7 <title>CMSIS-CORE: System Partition Header File partition_&lt;device&gt;.h</title>
8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
9 <link href="cmsis.css" rel="stylesheet" type="text/css" />
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <script type="text/javascript" src="printComponentTabs.js"></script>
13 <link href="navtree.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="resize.js"></script>
15 <script type="text/javascript" src="navtree.js"></script>
16 <script type="text/javascript">
17   $(document).ready(initResizable);
18   $(window).load(resizeHeight);
19 </script>
20 <link href="search/search.css" rel="stylesheet" type="text/css"/>
21 <script type="text/javascript" src="search/search.js"></script>
22 <script type="text/javascript">
23   $(document).ready(function() { searchBox.OnSelectItem(0); });
24 </script>
25 </head>
26 <body>
27 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
28 <div id="titlearea">
29 <table cellspacing="0" cellpadding="0">
30  <tbody>
31  <tr style="height: 46px;">
32   <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
33   <td style="padding-left: 0.5em;">
34    <div id="projectname">CMSIS-CORE
35    &#160;<span id="projectnumber">Version 5.0.0 - Beta</span>
36    </div>
37    <div id="projectbrief">CMSIS-CORE support for Cortex-M processor-based devices</div>
38   </td>
39  </tr>
40  </tbody>
41 </table>
42 </div>
43 <!-- end header part -->
44 <div id="CMSISnav" class="tabs1">
45     <ul class="tablist">
46       <script type="text/javascript">
47                 <!--
48                 writeComponentTabs.call(this);
49                 //-->
50       </script>
51           </ul>
52 </div>
53 <!-- Generated by Doxygen 1.8.6 -->
54 <script type="text/javascript">
55 var searchBox = new SearchBox("searchBox", "search",false,'Search');
56 </script>
57   <div id="navrow1" class="tabs">
58     <ul class="tablist">
59       <li><a href="index.html"><span>Main&#160;Page</span></a></li>
60       <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
61       <li><a href="modules.html"><span>Reference</span></a></li>
62       <li>
63         <div id="MSearchBox" class="MSearchBoxInactive">
64         <span class="left">
65           <img id="MSearchSelect" src="search/mag_sel.png"
66                onmouseover="return searchBox.OnSearchSelectShow()"
67                onmouseout="return searchBox.OnSearchSelectHide()"
68                alt=""/>
69           <input type="text" id="MSearchField" value="Search" accesskey="S"
70                onfocus="searchBox.OnSearchFieldFocus(true)" 
71                onblur="searchBox.OnSearchFieldFocus(false)" 
72                onkeyup="searchBox.OnSearchFieldChange(event)"/>
73           </span><span class="right">
74             <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
75           </span>
76         </div>
77       </li>
78     </ul>
79   </div>
80 </div><!-- top -->
81 <div id="side-nav" class="ui-resizable side-nav-resizable">
82   <div id="nav-tree">
83     <div id="nav-tree-contents">
84       <div id="nav-sync" class="sync"></div>
85     </div>
86   </div>
87   <div id="splitbar" style="-moz-user-select:none;" 
88        class="ui-resizable-handle">
89   </div>
90 </div>
91 <script type="text/javascript">
92 $(document).ready(function(){initNavTree('partition_h_pg.html','');});
93 </script>
94 <div id="doc-content">
95 <!-- window showing the filter options -->
96 <div id="MSearchSelectWindow"
97      onmouseover="return searchBox.OnSearchSelectShow()"
98      onmouseout="return searchBox.OnSearchSelectHide()"
99      onkeydown="return searchBox.OnSearchSelectKey(event)">
100 <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>
101
102 <!-- iframe showing the search results (closed by default) -->
103 <div id="MSearchResultsWindow">
104 <iframe src="javascript:void(0)" frameborder="0" 
105         name="MSearchResults" id="MSearchResults">
106 </iframe>
107 </div>
108
109 <div class="header">
110   <div class="headertitle">
111 <div class="title">System Partition Header File partition_&lt;device&gt;.h </div>  </div>
112 </div><!--header-->
113 <div class="contents">
114 <div class="textblock"><p>The <a class="el" href="partition_h_pg.html">System Partition Header File partition_&lt;device&gt;.h</a> contains the initial setup of the TrustZone hardware in an ARMv8-M system. The function <a class="el" href="group__sau__trustzone__functions.html#ga6093bc5939ea8924fbcfdffb8f0553f1">TZ_SAU_Setup</a> is call from <a class="el" href="group__system__init__gr.html#ga93f514700ccf00d08dbdcff7f1224eb2">SystemInit</a> and uses the settings in this file to initialize the Secure Attribute Unit (SAU) and define non-secure interrupts (register NVIC_INIT_ITNS). The following initializations are performed:</p>
115 <ul>
116 <li><a class="el" href="partition_h_pg.html#sau_ctrlregister_sec">SAU CTRL register settings</a> provides settings for the SAU CTRL register.</li>
117 <li><a class="el" href="partition_h_pg.html#sau_regions_sect">Configuration of the SAU Address Regions</a> provides configuration of the SAU Address Regions.</li>
118 <li><a class="el" href="partition_h_pg.html#sau_sleepexception_sec">Configuration of Sleep and Exception behaviour</a> provides device-specific deepsleep and exception settings.</li>
119 <li><a class="el" href="partition_h_pg.html#sau_interrupttarget_sec">Configuration of Interrupt Target settings</a> provides device-specific interrupt target settings.</li>
120 </ul>
121 <h1><a class="anchor" id="sau_ctrlregister_sec"></a>
122 SAU CTRL register settings</h1>
123 <table  class="cmtable">
124 <tr>
125 <th>#define </th><th>Value Range </th><th>Default </th><th>Description  </th></tr>
126 <tr>
127 <td>SAU_INIT_CTRL </td><td>0 .. 1 </td><td>0 </td><td>Initialize SAU CTRL register or not<ul>
128 <li>0: do not initialize SAU CTRL register</li>
129 <li>1: initialize SAU CTRL register  </li>
130 </ul>
131 </td></tr>
132 <tr>
133 <td>SAU_INIT_CTRL_ENABLE </td><td>0 .. 1 </td><td>0 </td><td>enable/disable the SAU<ul>
134 <li>0: disable SAU</li>
135 <li>1: enable SAU  </li>
136 </ul>
137 </td></tr>
138 <tr>
139 <td>SAU_INIT_CTRL_ALLNS </td><td>0 .. 1 </td><td>0 </td><td>value for SAU_CTRL register bit ALLNS<ul>
140 <li>0: all Memory is Secure</li>
141 <li>1: all Memory is Non-Secure  </li>
142 </ul>
143 </td></tr>
144 </table>
145 <h1><a class="anchor" id="sau_regions_sect"></a>
146 Configuration of the SAU Address Regions</h1>
147 <table  class="cmtable">
148 <tr>
149 <th>#define </th><th>Value Range </th><th>Default </th><th>Description  </th></tr>
150 <tr>
151 <td>SAU_REGIONS_MAX </td><td>0 .. tbd </td><td>8 </td><td>maximum number of SAU regions  </td></tr>
152 <tr>
153 <td>SAU_INIT_REGION&lt;number&gt; </td><td>0 .. 1 </td><td>0 </td><td>initialize SAU region or not<ul>
154 <li>0: do not initialize SAU region</li>
155 <li>1: initialize SAU region  </li>
156 </ul>
157 </td></tr>
158 <tr>
159 <td>SAU_INIT_START&lt;number&gt; </td><td>0x00000000 .. 0xFFFFFFE0<br/>
160  [in steps of 32] </td><td>0x00000000 </td><td>region start address  </td></tr>
161 <tr>
162 <td>SAU_INIT_END&lt;number&gt; </td><td>0x00000000 .. 0xFFFFFFE0<br/>
163  [in steps of 32] </td><td>0x00000000 </td><td>region start address  </td></tr>
164 <tr>
165 <td>SAU_INIT_NSC&lt;number&gt; </td><td>0 .. 1 </td><td>0 </td><td>SAU region attribute<ul>
166 <li>0: Non-Secure</li>
167 <li>1: Secure, Non-Secure callable  </li>
168 </ul>
169 </td></tr>
170 </table>
171 <p>The range of &lt;number&gt; is from 0 .. SAU_REGIONS_MAX. A set of these macros must exist for each &lt;number&gt;.</p>
172 <p>The following example shows a set of SAU region macros.</p>
173 <div class="fragment"><div class="line"><span class="preprocessor">#define SAU_REGIONS_MAX   8                 </span><span class="comment">/* Max. number of SAU regions */</span><span class="preprocessor"></span></div>
174 <div class="line"><span class="preprocessor"></span> </div>
175 <div class="line"><span class="preprocessor">#define SAU_INIT_REGION0    1</span></div>
176 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_START0     0x00000000      </span><span class="comment">/* start address of SAU region 0 */</span><span class="preprocessor"></span></div>
177 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_END0       0x001FFFE0      </span><span class="comment">/* end address of SAU region 0 */</span><span class="preprocessor"></span></div>
178 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_NSC0       1</span></div>
179 <div class="line"><span class="preprocessor"></span> </div>
180 <div class="line"><span class="preprocessor">#define SAU_INIT_REGION1    1</span></div>
181 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_START1     0x00200000      </span><span class="comment">/* start address of SAU region 1 */</span><span class="preprocessor"></span></div>
182 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_END1       0x003FFFE0      </span><span class="comment">/* end address of SAU region 1 */</span><span class="preprocessor"></span></div>
183 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_NSC1       0</span></div>
184 <div class="line"><span class="preprocessor"></span> </div>
185 <div class="line"><span class="preprocessor">#define SAU_INIT_REGION2    1</span></div>
186 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_START2     0x20200000      </span><span class="comment">/* start address of SAU region 2 */</span><span class="preprocessor"></span></div>
187 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_END2       0x203FFFE0      </span><span class="comment">/* end address of SAU region 2 */</span><span class="preprocessor"></span></div>
188 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_NSC2       0</span></div>
189 <div class="line"><span class="preprocessor"></span> </div>
190 <div class="line"><span class="preprocessor">#define SAU_INIT_REGION3    1</span></div>
191 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_START3     0x40000000      </span><span class="comment">/* start address of SAU region 3 */</span><span class="preprocessor"></span></div>
192 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_END3       0x40040000      </span><span class="comment">/* end address of SAU region 3 */</span><span class="preprocessor"></span></div>
193 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_NSC3       0</span></div>
194 <div class="line"><span class="preprocessor"></span> </div>
195 <div class="line"><span class="preprocessor">#define SAU_INIT_REGION4    0</span></div>
196 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_START4     0x00000000      </span><span class="comment">/* start address of SAU region 4 */</span><span class="preprocessor"></span></div>
197 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_END4       0x00000000      </span><span class="comment">/* end address of SAU region 4 */</span><span class="preprocessor"></span></div>
198 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_NSC4       0</span></div>
199 <div class="line"><span class="preprocessor"></span> </div>
200 <div class="line"><span class="preprocessor">#define SAU_INIT_REGION5    0</span></div>
201 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_START5     0x00000000      </span><span class="comment">/* start address of SAU region 5 */</span><span class="preprocessor"></span></div>
202 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_END5       0x00000000      </span><span class="comment">/* end address of SAU region 5 */</span><span class="preprocessor"></span></div>
203 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_NSC5       0</span></div>
204 <div class="line"><span class="preprocessor"></span> </div>
205 <div class="line"><span class="preprocessor">#define SAU_INIT_REGION6    0</span></div>
206 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_START6     0x00000000      </span><span class="comment">/* start address of SAU region 6 */</span><span class="preprocessor"></span></div>
207 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_END6       0x00000000      </span><span class="comment">/* end address of SAU region 6 */</span><span class="preprocessor"></span></div>
208 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_NSC6       0</span></div>
209 <div class="line"><span class="preprocessor"></span> </div>
210 <div class="line"><span class="preprocessor">#define SAU_INIT_REGION7    0</span></div>
211 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_START7     0x00000000      </span><span class="comment">/* start address of SAU region 7 */</span><span class="preprocessor"></span></div>
212 <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAU_INIT_END7       0x00000000      </span><span class="comment">/* end address of SAU region 7 */</span><span class="preprocessor"></span></div>
213 <div class="line"><span class="preprocessor">#define SAU_INIT_NSC7       0</span></div>
214 </div><!-- fragment --><h1><a class="anchor" id="sau_sleepexception_sec"></a>
215 Configuration of Sleep and Exception behaviour</h1>
216 <table  class="cmtable">
217 <tr>
218 <th>#define </th><th>Value Range </th><th>Default </th><th>Description  </th></tr>
219 <tr>
220 <td>CSR_INIT_DEEPSLEEPS </td><td>0 .. 1 </td><td>0 </td><td>value for SCB_CSR register bit DEEPSLEEPS<ul>
221 <li>0: Deep Sleep can be enabled by Secure and Non-Secure state</li>
222 <li>1: Deep Sleep can be enabled by Secure state only  </li>
223 </ul>
224 </td></tr>
225 <tr>
226 <td>AIRCR_INIT_SYSRESETREQS </td><td>0 .. 1 </td><td>0 </td><td>value for SCB_AIRCR register bit SYSRESETREQS<ul>
227 <li>0: System reset request accessible from Secure and Non-Secure state</li>
228 <li>1: System reset request accessible from Secure state only  </li>
229 </ul>
230 </td></tr>
231 <tr>
232 <td>AIRCR_INIT_PRIS </td><td>0 .. 1 </td><td>0 </td><td>value for SCB_AIRCR register bit PRIS<ul>
233 <li>0: Priority of Non-Secure exceptions is Not altered</li>
234 <li>1: Priority of Non-Secure exceptions is Lowered to 0x80-0xFF  </li>
235 </ul>
236 </td></tr>
237 <tr>
238 <td>AIRCR_INIT_BFHFNMINS </td><td>0 .. 1 </td><td>0 </td><td>value for SCB_AIRCR register bit BFHFNMINS<ul>
239 <li>0: BusFault, HardFault, and NMI target are Secure state</li>
240 <li>1: BusFault, HardFault, and NMI target are Non-Secure state  </li>
241 </ul>
242 </td></tr>
243 </table>
244 <h1><a class="anchor" id="sau_interrupttarget_sec"></a>
245 Configuration of Interrupt Target settings</h1>
246 <p>Each interrupt has a configuration bit that defines the execution in Secure or Non-secure state. The Non-Secure interrupts have a separate vector table. Refer to <a class="el" href="using_TrustZone_pg.html#Model_TrustZone">Programmers Model with TrustZone</a> for more information.</p>
247 <table  class="cmtable">
248 <tr>
249 <th>#define </th><th>Value Range </th><th>Default </th><th>Description  </th></tr>
250 <tr>
251 <td>NVIC_INIT_ITNS&lt;number&gt; </td><td>0x00000000 .. 0xFFFFFFFF<br/>
252  [each bit represents an interrupt] </td><td>0x00000000 </td><td>Interrupt vector target<ul>
253 <li>0: Secure state</li>
254 <li>1: Non-Secure state  </li>
255 </ul>
256 </td></tr>
257 </table>
258 <p>The range of &lt;number&gt; is 0 .. (&lt;number of external interrupts&gt; + 31) / 32.</p>
259 <p>The following example shows the configuration for a maximum of 64 external interrupts.</p>
260 <div class="fragment"><div class="line"><span class="preprocessor">#define NVIC_INIT_ITNS0      0x0000122B</span></div>
261 <div class="line"><span class="preprocessor">#define NVIC_INIT_ITNS1      0x0000003A</span></div>
262 </div><!-- fragment --> </div></div><!-- contents -->
263 </div><!-- doc-content -->
264 <!-- start footer part -->
265 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
266   <ul>
267     <li class="navelem"><a class="el" href="templates_pg.html">Template Files</a></li>
268     <li class="footer">Generated on Tue Sep 13 2016 16:45:26 for CMSIS-CORE by ARM Ltd. All rights reserved.
269         <!--
270     <a href="http://www.doxygen.org/index.html">
271     <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 
272         -->
273         </li>
274   </ul>
275 </div>
276 </body>
277 </html>