zTEMCB400.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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>Keil MCBSTM32F400 Evaluation Board</title>
  7. <title>CMSIS-Zone: Keil MCBSTM32F400 Evaluation Board</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-Zone
  35. &#160;<span id="projectnumber">Version 1.0.0</span>
  36. </div>
  37. <div id="projectbrief">System Resource Management</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>
  62. <div id="MSearchBox" class="MSearchBoxInactive">
  63. <span class="left">
  64. <img id="MSearchSelect" src="search/mag_sel.png"
  65. onmouseover="return searchBox.OnSearchSelectShow()"
  66. onmouseout="return searchBox.OnSearchSelectHide()"
  67. alt=""/>
  68. <input type="text" id="MSearchField" value="Search" accesskey="S"
  69. onfocus="searchBox.OnSearchFieldFocus(true)"
  70. onblur="searchBox.OnSearchFieldFocus(false)"
  71. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  72. </span><span class="right">
  73. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  74. </span>
  75. </div>
  76. </li>
  77. </ul>
  78. </div>
  79. </div><!-- top -->
  80. <div id="side-nav" class="ui-resizable side-nav-resizable">
  81. <div id="nav-tree">
  82. <div id="nav-tree-contents">
  83. <div id="nav-sync" class="sync"></div>
  84. </div>
  85. </div>
  86. <div id="splitbar" style="-moz-user-select:none;"
  87. class="ui-resizable-handle">
  88. </div>
  89. </div>
  90. <script type="text/javascript">
  91. $(document).ready(function(){initNavTree('zTEMCB400.html','');});
  92. </script>
  93. <div id="doc-content">
  94. <!-- window showing the filter options -->
  95. <div id="MSearchSelectWindow"
  96. onmouseover="return searchBox.OnSearchSelectShow()"
  97. onmouseout="return searchBox.OnSearchSelectHide()"
  98. onkeydown="return searchBox.OnSearchSelectKey(event)">
  99. <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>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Pages</a></div>
  100. <!-- iframe showing the search results (closed by default) -->
  101. <div id="MSearchResultsWindow">
  102. <iframe src="javascript:void(0)" frameborder="0"
  103. name="MSearchResults" id="MSearchResults">
  104. </iframe>
  105. </div>
  106. <div class="header">
  107. <div class="headertitle">
  108. <div class="title">Keil MCBSTM32F400 Evaluation Board </div> </div>
  109. </div><!--header-->
  110. <div class="contents">
  111. <div class="textblock"><p>This single processor demo application shows how to do the <a class="el" href="UseCases.html#UseCase_MPU">MPU Protection</a>. Using CMSIS-Zone, it generates:</p>
  112. <ul>
  113. <li>A header file that contains #defines to control the various linker scatter files (and might be used in other parts of the application).</li>
  114. <li>The MPU configuration table source and header files. These contain MPU register settings used during thread switching to update accessible memory regions.</li>
  115. </ul>
  116. <p>The application itself shows how to isolate network stack threads from the user application.</p>
  117. <h1><a class="anchor" id="zTEMCB400_Eclipse"></a>
  118. Using the CMSIS-Zone project</h1>
  119. <ul>
  120. <li><a class="el" href="zTExamples.html#zTExImport">Import</a> the project "Examples\MCBSTM32F400\Zone" into the CMSIS-Zone utility</li>
  121. <li><a class="el" href="zTUI.html#zTProjEx">Open</a> the MCBSTM32F400.azone file</li>
  122. <li><a class="el" href="zTUIGenerate.html">Generate</a> the related output files</li>
  123. </ul>
  124. <p>The MCBSTM32F400.azone file of that project has the following configuration settings:</p>
  125. <ul>
  126. <li>Project mode is set to <code>Execution</code>.</li>
  127. <li><a class="el" href="zTUIZonePart.html#zTUICreate">Added the zones</a> <code>Net</code>, <code>Main</code>, <code>RTX</code>, <code>Blinky</code>, <code>Timer</code>, <code>Idle</code> </li>
  128. <li><a class="el" href="zTUIMemPerRes.html#zTUIMemAdd">Created the memory regions</a> <code>CODE</code>, <code>RAM_SHARED</code>, <code>RAM_NET</code>, <code>RAM_MAIN</code>, <code>RAM_PRIVILEGED</code>, <code>RAM_EVR</code>, <code>RAM_BSD</code>, <code>RAM_LED</code>, <code>RAM_ADC</code>, <code>RAM_TIMER</code>, and <code>RAM_IDLE</code> </li>
  129. <li>Selected various memory regions and peripherals for using in the different zones: <div class="image">
  130. <img src="MCB400_zones.png" alt="MCB400_zones.png"/>
  131. </div>
  132. </li>
  133. </ul>
  134. <p>The zones use common Flash region for all the application code but different SRAM regions to segregate thread data. To generate the output, click on the <a class="el" href="zTUIGenerate.html">Generate</a> button in the Zone Editor tool bar. This creates the following files in the <code>ftl_gen</code> directory:</p>
  135. <table class="doxtable">
  136. <tr>
  137. <th align="left">Template File </th><th align="left">Generated File </th><th align="left">Description </th></tr>
  138. <tr>
  139. <td align="left">dump_fzone.txt.ftl </td><td align="left">dump_fzone.txt </td><td align="left">Contains the complete model </td></tr>
  140. <tr>
  141. <td align="left">helper.ftlinc </td><td align="left">N/A </td><td align="left">Helper template file with FTL functions. </td></tr>
  142. <tr>
  143. <td align="left">mem_layout.h.ftl </td><td align="left">mem_layout.h </td><td align="left">Header file that contains the memory region definitions, for example for the linker scatter file. </td></tr>
  144. <tr>
  145. <td align="left">mputable.c.ftl </td><td align="left">mputable.c </td><td align="left">MPU Table data definition. </td></tr>
  146. <tr>
  147. <td align="left">mputable.h.ftl </td><td align="left">mputable.h </td><td align="left">MPU Table data declaration. </td></tr>
  148. <tr>
  149. <td align="left">scatter.sct.ftl </td><td align="left">scatter.sct </td><td align="left">Example scatter file for MPU protection. </td></tr>
  150. </table>
  151. <p>These files can be used in any IDE to create the final application. In the following, the usage in Arm Keil MDK is described.</p>
  152. <h1><a class="anchor" id="zTEMCB400_MDK"></a>
  153. Using the MDK project</h1>
  154. <p>The example project can be loaded, built and debugged in µVision by performing the following steps:</p>
  155. <ol type="1">
  156. <li>Navigate to Examples/MCBSTM32F400/MDK</li>
  157. <li>Open the project workspace Blinky_Net.uvprojx</li>
  158. <li>Optional: Update the generated files by executing the copy_gen.bat script.</li>
  159. <li>Run the build in MDK.</li>
  160. </ol>
  161. <h1><a class="anchor" id="zTEMCB400_MDK_Setup"></a>
  162. MDK project setup</h1>
  163. <p>The projects Blinky_Net use the files generated in CMSIS-Zone as follows:</p>
  164. <table class="doxtable">
  165. <tr>
  166. <th align="left">File </th><th align="left">Description </th></tr>
  167. <tr>
  168. <td align="left">mem_layout.h </td><td align="left">Input for the linker scatter files. </td></tr>
  169. <tr>
  170. <td align="left">mputable.c </td><td align="left">MPU Table data definition. </td></tr>
  171. <tr>
  172. <td align="left">mputable.h </td><td align="left">MPU Table data declaration. </td></tr>
  173. <tr>
  174. <td align="left">scatter.sct </td><td align="left">Initial template for scatter file. </td></tr>
  175. </table>
  176. <h2><a class="anchor" id="zTEMCB400_hwsScatter"></a>
  177. scatter.sct</h2>
  178. <p>As explained previously, the #defines in <code>mem_layout.h</code> can be used to create generic scatter files that are easy to update once changes in the CMSIS-Zone project happen. Using the <b>mem_layout.h</b> file from CMSIS-Zone, the following scatter file is used in the <code>Blinky_Net</code> project, which is based on the generated scatter file template (scatter.sct):</p>
  179. <div class="fragment"><div class="line"><span class="preprocessor">#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m3 -xc</span></div>
  180. <div class="line"><span class="preprocessor"></span></div>
  181. <div class="line"><span class="preprocessor">#include &quot;mem_layout.h&quot;</span></div>
  182. <div class="line"></div>
  183. <div class="line">LR_CODE REGION_CODE_START REGION_CODE_SIZE {</div>
  184. <div class="line"> ER_CODE REGION_CODE_START REGION_CODE_SIZE {</div>
  185. <div class="line"> .o (RESET,+FIRST)</div>
  186. <div class="line"> (InRoot$$Sections)</div>
  187. <div class="line"> .ANY (+RO, +XO)</div>
  188. <div class="line"> }</div>
  189. <div class="line"> RW_RAM_PRIVILEGED REGION_RAM_PRIVILEGED_START REGION_RAM_PRIVILEGED_SIZE {</div>
  190. <div class="line"> Net_Config.o (.bss.os.*.cb)</div>
  191. <div class="line"> .ANY (+RW +ZI)</div>
  192. <div class="line"> }</div>
  193. <div class="line"> RW_RAM_SHARED REGION_RAM_SHARED_START REGION_RAM_SHARED_SIZE {</div>
  194. <div class="line"> system_stm32f4xx.o (.data.SystemCoreClock)</div>
  195. <div class="line">; *.o (.data.shared)</div>
  196. <div class="line"> .o (.bss.shared)</div>
  197. <div class="line"> }</div>
  198. <div class="line"> RW_RAM_EVR REGION_RAM_EVR_START UNINIT REGION_RAM_EVR_SIZE {</div>
  199. <div class="line"> EventRecorder.o (+ZI)</div>
  200. <div class="line"> }</div>
  201. <div class="line"> RW_RAM_BSD REGION_RAM_BSD_START REGION_RAM_BSD_SIZE {</div>
  202. <div class="line"> bsd.o (+RW +ZI)</div>
  203. <div class="line"> }</div>
  204. <div class="line"> RW_RAM_NET REGION_RAM_NET_START REGION_RAM_NET_SIZE {</div>
  205. <div class="line"> Net*.lib (+RW +ZI)</div>
  206. <div class="line"> Net_Config.o (.bss*)</div>
  207. <div class="line"> emac_stm32f4xx.o (+RW +ZI)</div>
  208. <div class="line"> phy_ksz8081rna.o (+RW +ZI)</div>
  209. <div class="line"> phy_st802rt1.o (+RW +ZI)</div>
  210. <div class="line"> }</div>
  211. <div class="line"> RW_RAM_TIMER REGION_RAM_TIMER_START REGION_RAM_TIMER_SIZE {</div>
  212. <div class="line"> timer.o (+RW +ZI)</div>
  213. <div class="line"> .o (.bss.os.thread.stack.rtx.timer)</div>
  214. <div class="line"> }</div>
  215. <div class="line"> RW_RAM_ADC REGION_RAM_ADC_START REGION_RAM_ADC_SIZE {</div>
  216. <div class="line"> adc.o (+RW +ZI)</div>
  217. <div class="line"> adc_mcbstm32f400.o (+RW +ZI)</div>
  218. <div class="line"> }</div>
  219. <div class="line"> RW_RAM_LED REGION_RAM_LED_START REGION_RAM_LED_SIZE {</div>
  220. <div class="line"> led.o (+RW +ZI)</div>
  221. <div class="line"> }</div>
  222. <div class="line"> RW_RAM_MAIN REGION_RAM_MAIN_START REGION_RAM_MAIN_SIZE {</div>
  223. <div class="line"> app.o (+RW +ZI)</div>
  224. <div class="line"> }</div>
  225. <div class="line"> RW_RAM_IDLE REGION_RAM_IDLE_START REGION_RAM_IDLE_SIZE {</div>
  226. <div class="line"> RTX_Config.o (+RW +ZI)</div>
  227. <div class="line"> .o (.bss.os.thread.stack.rtx.idle)</div>
  228. <div class="line"> }</div>
  229. <div class="line">}</div>
  230. </div><!-- fragment --><p>The data segments of segregated software components have been allocated to distinct memory regions. </p>
  231. </div></div><!-- contents -->
  232. </div><!-- doc-content -->
  233. <!-- start footer part -->
  234. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  235. <ul>
  236. <li class="navelem"><a class="el" href="zoneToolUsage.html">CMSIS-Zone Utility</a></li><li class="navelem"><a class="el" href="zTExamples.html">Examples</a></li>
  237. <li class="footer">Generated on Thu Apr 9 2020 15:50:03 for CMSIS-Zone Version 1.0.0 by Arm Ltd. All rights reserved.
  238. <!--
  239. <a href="http://www.doxygen.org/index.html">
  240. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6
  241. -->
  242. </li>
  243. </ul>
  244. </div>
  245. </body>
  246. </html>