https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=How_to_configure_system_resources&feed=atom&action=history
How to configure system resources - Revision history
2024-03-29T05:53:42Z
Revision history for this page on the wiki
MediaWiki 1.31.16
https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=How_to_configure_system_resources&diff=70685&oldid=prev
Arnaud Pouliquen at 12:55, 3 June 2020
2020-06-03T12:55:39Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 12:55, 3 June 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l83" >Line 83:</td>
<td colspan="2" class="diff-lineno">Line 83:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*The Cortex-M4 can use the [[STM32CubeMP1 architecture|STM32Cube]] ResourceManager utility to update the configuration of these resources.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*The Cortex-M4 can use the [[STM32CubeMP1 architecture|STM32Cube]] ResourceManager utility to update the configuration of these resources.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{Info| In addition to the peripheral configuration, the Cortex-M4 still has to <del class="diffchange diffchange-inline">manage </del>the pheripheral clock <del class="diffchange diffchange-inline">gating even if it has not to configure </del>the <del class="diffchange diffchange-inline">clock tree</del>.}}</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Info| In addition to the peripheral configuration, the Cortex-M4 still has to <ins class="diffchange diffchange-inline">enable/disable </ins>the pheripheral clock<ins class="diffchange diffchange-inline">. The peripheral clock enable is implemented in </ins>the <ins class="diffchange diffchange-inline">[[STM32CubeMP1_development_guidelines#HAL_MspInit | HAL_MSPInit]] code generated by the [[STM32CubeMX]] tool</ins>.}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== ADC example ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== ADC example ===</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l118" >Line 118:</td>
<td colspan="2" class="diff-lineno">Line 118:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==== Firmware update on the Cortex-M4 context ====</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==== Firmware update on the Cortex-M4 context ====</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>No implementation is required to have the resources configured to their initial state.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>No implementation is required to have the <ins class="diffchange diffchange-inline">system </ins>resources configured to their initial state.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The below example describes how to update the ADC1 regulator configuration:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The below example describes how to update the ADC1 regulator configuration:</div></td></tr>
</table>
Arnaud Pouliquen
https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=How_to_configure_system_resources&diff=70669&oldid=prev
Arnaud Pouliquen at 15:53, 2 June 2020
2020-06-02T15:53:49Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 15:53, 2 June 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l48" >Line 48:</td>
<td colspan="2" class="diff-lineno">Line 48:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Cortex-M4 context ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Cortex-M4 context ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In the [[STM32CubeMP1 architecture|STM32Cube]] application, the developer must protect the '''GPIO''' and EXTI configuration registers by '''hardware semaphores''' managed by the [[HSEM internal peripheral|HSEM]]. This can be done by using the {{CodeSource | STM32CubeMP1 | Projects/STM32MP157C-DK2/Templates/Src/lock_resource.c | lock resource}} service.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In the [[STM32CubeMP1 architecture|STM32Cube]] application, the developer must protect the '''GPIO''' and EXTI configuration registers by '''hardware semaphores''' managed by the [[HSEM internal peripheral|HSEM]]. This can be done by using the {{CodeSource | STM32CubeMP1 | Projects/STM32MP157C-DK2/Templates/Src/lock_resource.c | lock resource}} service.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{Info | The selection of '''HSEM 0''' for '''GPIO''' and '''HSEM 1''' for '''EXTI''' protection is hidden inside STM32Cube code and visible inside the above '''lock resource''' service}}<del class="diffchange diffchange-inline">.</del></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Info | The selection of '''HSEM 0''' for '''GPIO''' and '''HSEM 1''' for '''EXTI''' protection is hidden inside STM32Cube code and visible inside the above '''lock resource''' service<ins class="diffchange diffchange-inline">.</ins>}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>  void main(void)</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>  void main(void)</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l83" >Line 83:</td>
<td colspan="2" class="diff-lineno">Line 83:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*The Cortex-M4 can use the [[STM32CubeMP1 architecture|STM32Cube]] ResourceManager utility to update the configuration of these resources.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*The Cortex-M4 can use the [[STM32CubeMP1 architecture|STM32Cube]] ResourceManager utility to update the configuration of these resources.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{<del class="diffchange diffchange-inline">ReviewsComments</del>|<del class="diffchange diffchange-inline">-- [[User:Arnaud Pouliquen|Arnaud Pouliquen]] ([[User talk:Arnaud Pouliquen|talk]]) 13:19</del>, <del class="diffchange diffchange-inline">31 January 2020 (CET)<br />missing explaination around </del>the <del class="diffchange diffchange-inline">IP clock gating management  in </del>Cortex-M4 <del class="diffchange diffchange-inline">firmware</del>}}</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{<ins class="diffchange diffchange-inline">Info</ins>| <ins class="diffchange diffchange-inline">In addition to the peripheral configuration</ins>, the Cortex-M4 <ins class="diffchange diffchange-inline">still has to manage the pheripheral clock gating even if it has not to configure the clock tree.</ins>}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== ADC example ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== ADC example ===</div></td></tr>
</table>
Arnaud Pouliquen
https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=How_to_configure_system_resources&diff=70663&oldid=prev
Arnaud Pouliquen: /* Firmware update on the Cortex-M4 context */
2020-06-02T15:06:27Z
<p><span dir="auto"><span class="autocomment">Firmware update on the Cortex-M4 context</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 15:06, 2 June 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l157" >Line 157:</td>
<td colspan="2" class="diff-lineno">Line 157:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Coprocessor management STM32Cube]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Coprocessor management STM32Cube]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{PublicationRequestId | 10649 | 2019-02-07 | AnneJ}}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{PublicationRequestId | 10649 | 2019-02-07 | AnneJ}}</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">{{ReviewsComments | W906.2 ArnaudP : this article will need to be updated for A7 secure context part, after the implementation of the management of slim firmware}}</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></noinclude></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></noinclude></div></td></tr>
</table>
Arnaud Pouliquen
https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=How_to_configure_system_resources&diff=67427&oldid=prev
Jean Christophe Trotin at 07:51, 4 February 2020
2020-02-04T07:51:31Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 07:51, 4 February 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><noinclude></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">{{ArticleMainWriter | ArnaudP}}</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">{{ArticleApprovedVersion | ArnaudP | GeraldB, LoicP, LionelD, FabienD | No previous approved version | AnneJ - 07Feb'19 - TLMS10649| 07Feb'19}}</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[Category:How to customize software]]</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[Category:Coprocessor management Linux]]</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[Category:Coprocessor management STM32Cube]]</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">{{ReviewsComments | W906.2 ArnaudP : this article will need to be updated for A7 secure context part, after the implementation of the management of slim firmware}}</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></noinclude></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Article purpose ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Article purpose ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This article explains how to configure the '''GPIO''', '''EXTI''', '''clocks''' and '''regulators''' [[Resource_manager_for_coprocessing#Terminology | system resources]] shared between the Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-A7 and the Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-M4 contexts.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This article explains how to configure the '''GPIO''', '''EXTI''', '''clocks''' and '''regulators''' [[Resource_manager_for_coprocessing#Terminology | system resources]] shared between the Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-A7 and the Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-M4 contexts.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l162" >Line 162:</td>
<td colspan="2" class="diff-lineno">Line 151:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   </div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   log_info("Regulator voltage is now=%ld mv\n", config_out.regu.curr_voltage_mv);</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   log_info("Regulator voltage is now=%ld mv\n", config_out.regu.curr_voltage_mv);</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><noinclude></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:How to customize software]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Coprocessor management Linux]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Coprocessor management STM32Cube]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{PublicationRequestId | 10649 | 2019-02-07 | AnneJ}}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{ReviewsComments | W906.2 ArnaudP : this article will need to be updated for A7 secure context part, after the implementation of the management of slim firmware}}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></noinclude></ins></div></td></tr>
</table>
Jean Christophe Trotin
https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=How_to_configure_system_resources&diff=67175&oldid=prev
Arnaud Pouliquen: /* System resource management on the Cortex-M4 context */
2020-01-31T12:19:13Z
<p><span dir="auto"><span class="autocomment">System resource management on the Cortex-M4 context</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 12:19, 31 January 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l93" >Line 93:</td>
<td colspan="2" class="diff-lineno">Line 93:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*The Cortex-M4 must not set the initial configuration of these resources: this is done by the [[STM32MP15 Linux kernel overview|Linux kernel]].</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*The Cortex-M4 must not set the initial configuration of these resources: this is done by the [[STM32MP15 Linux kernel overview|Linux kernel]].</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*The Cortex-M4 can use the [[STM32CubeMP1 architecture|STM32Cube]] ResourceManager utility to update the configuration of these resources.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*The Cortex-M4 can use the [[STM32CubeMP1 architecture|STM32Cube]] ResourceManager utility to update the configuration of these resources.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{ReviewsComments|-- [[User:Arnaud Pouliquen|Arnaud Pouliquen]] ([[User talk:Arnaud Pouliquen|talk]]) 13:19, 31 January 2020 (CET)<br />missing explaination around the IP clock gating management  in Cortex-M4 firmware}}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== ADC example ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== ADC example ===</div></td></tr>
</table>
Arnaud Pouliquen
https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=How_to_configure_system_resources&diff=53639&oldid=prev
Arnaud Pouliquen at 10:58, 19 February 2019
2019-02-19T10:58:47Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 10:58, 19 February 2019</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l58" >Line 58:</td>
<td colspan="2" class="diff-lineno">Line 58:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Cortex-M4 context ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Cortex-M4 context ===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>In the [[STM32CubeMP1 architecture|STM32Cube]] application, the developer must protect the '''GPIO''' and EXTI configuration registers by '''hardware semaphores''' managed by the [[HSEM internal peripheral|HSEM]]. This can be done by using the {{<del class="diffchange diffchange-inline">CodeSourceTest </del>| STM32CubeMP1 | Projects/STM32MP157C-DK2/Templates/Src/lock_resource.c | lock resource}} service.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>In the [[STM32CubeMP1 architecture|STM32Cube]] application, the developer must protect the '''GPIO''' and EXTI configuration registers by '''hardware semaphores''' managed by the [[HSEM internal peripheral|HSEM]]. This can be done by using the {{<ins class="diffchange diffchange-inline">CodeSource </ins>| STM32CubeMP1 | Projects/STM32MP157C-DK2/Templates/Src/lock_resource.c | lock resource}} service.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Info | The selection of '''HSEM 0''' for '''GPIO''' and '''HSEM 1''' for '''EXTI''' protection is hidden inside STM32Cube code and visible inside the above '''lock resource''' service}}.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Info | The selection of '''HSEM 0''' for '''GPIO''' and '''HSEM 1''' for '''EXTI''' protection is hidden inside STM32Cube code and visible inside the above '''lock resource''' service}}.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Arnaud Pouliquen
https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=How_to_configure_system_resources&diff=53600&oldid=prev
Arnaud Pouliquen at 09:56, 19 February 2019
2019-02-19T09:56:36Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 09:56, 19 February 2019</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l84" >Line 84:</td>
<td colspan="2" class="diff-lineno">Line 84:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>**regulator settings</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>**regulator settings</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">=</del>===System resource manager on the Cortex-A7 non-secure context<del class="diffchange diffchange-inline">=</del>===</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>===System resource manager on the Cortex-A7 non-secure context===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The [[Resource_manager_for_coprocessing#System_resource_configuration_set_service | resource manager]] Linux Kernel driver is in charge of configuring the clocks and regulators used to operate the peripherals assigned to the Cortex-M4 context. The configurations are defined  in the '''m4_system_resources''' node of the Linux kernel [[Device tree|device tree]].  </div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The [[Resource_manager_for_coprocessing#System_resource_configuration_set_service | resource manager]] Linux Kernel driver is in charge of configuring the clocks and regulators used to operate the peripherals assigned to the Cortex-M4 context. The configurations are defined  in the '''m4_system_resources''' node of the Linux kernel [[Device tree|device tree]].  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>To help developers, the [[STM32MP15 Linux kernel overview|Linux kernel]] predefines the clock system resources for most of the peripherals that can be assigned to the Cortex-M4 context: see {{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp157c-m4-srm.dtsi}}.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>To help developers, the [[STM32MP15 Linux kernel overview|Linux kernel]] predefines the clock system resources for most of the peripherals that can be assigned to the Cortex-M4 context: see {{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp157c-m4-srm.dtsi}}.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">=</del>=== System resource management on the Cortex-M4 context<del class="diffchange diffchange-inline">=</del>===</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>=== System resource management on the Cortex-M4 context===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>As clock and regulator system resources are under the [[STM32MP15 Linux kernel overview|Linux kernel]] responsibility, the Cortex-M4 context '''must NOT''' configure these system resources directly:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>As clock and regulator system resources are under the [[STM32MP15 Linux kernel overview|Linux kernel]] responsibility, the Cortex-M4 context '''must NOT''' configure these system resources directly:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*The Cortex-M4 must not set the initial configuration of these resources: this is done by the [[STM32MP15 Linux kernel overview|Linux kernel]].</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*The Cortex-M4 must not set the initial configuration of these resources: this is done by the [[STM32MP15 Linux kernel overview|Linux kernel]].</div></td></tr>
</table>
Arnaud Pouliquen
https://wiki.st.com/stm32mpu-ecosystem-v1/index.php?title=How_to_configure_system_resources&diff=51892&oldid=prev
imported>Frq07267 at 08:51, 7 February 2019
2019-02-07T08:51:26Z
<p></p>
<p><b>New page</b></p><div><noinclude><br />
{{ArticleMainWriter | ArnaudP}}<br />
{{ArticleApprovedVersion | ArnaudP | GeraldB, LoicP, LionelD, FabienD | No previous approved version | AnneJ - 07Feb'19 - TLMS10649| 07Feb'19}}<br />
<br />
[[Category:How to customize software]]<br />
[[Category:Coprocessor management Linux]]<br />
[[Category:Coprocessor management STM32Cube]]<br />
<br />
{{ReviewsComments | W906.2 ArnaudP : this article will need to be updated for A7 secure context part, after the implementation of the management of slim firmware}}<br />
</noinclude><br />
<br />
== Article purpose ==<br />
This article explains how to configure the '''GPIO''', '''EXTI''', '''clocks''' and '''regulators''' [[Resource_manager_for_coprocessing#Terminology | system resources]] shared between the Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-A7 and the Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-M4 contexts.<br />
<br />
In this article, it is assumed that the system runs in [[STM32CubeMP1 Package#Introduction to boot mode|production boot mode]] where both the Cortex-A7 non-secure and Cortex-M4 contexts are running. The specificities of the [[STM32CubeMP1 development guidelines|engineering boot mode]] are not covered here.<br />
<br />
==Introduction==<br />
When a peripheral is '''assigned to the Cortex<sup>&reg;</sup>-M4''' context (refer to [[How_to_assign_an_internal_peripheral_to_a_runtime_context |How to assign an internal peripheral to a runtime context]] for details), the developer has to pay attention to the configuration of the [[Resource_manager_for_coprocessing#Terminology | system resources]], shared between the Cortex<sup>&reg;</sup>-A7 and the Cortex<sup>&reg;</sup>-M4 contexts. It is mandatory to '''avoid concurrent accesses''' to these resources from the Cortex<sup>&reg;</sup>-A7 and the Cortex<sup>&reg;</sup>-M4.<br />
<br><br /><br />
<br />
The system resources can be accessed:<br />
* from the Cortex<sup>&reg;</sup>-A7 core:<br />
:*during the platform boot, by [[U-Boot overview|U-Boot]] or [[TF-A overview |TF-A]], (refer to [[Boot chains overview]]),<br />
:*during the Linux<sup>&reg;</sup> firmware execution.<br />
* from the Cortex<sup>&reg;</sup>-M4 by the [[STM32CubeMP1 architecture|STM32Cube]] firmware.<br />
<br><br />
To ensure an exclusive access to these system resources, two strategies are implemented in the [[STM32MPU Embedded Software distribution]]:<br />
*a protection by a hardware semaphore (see[[HSEM internal peripheral|HSEM]]) for '''GPIO''' and '''EXTI''' configurations,<br />
*an exclusive access by the Cortex-A7 non-secure context. In that case, the Cortex-M4 context relies on the [[Resource_manager_for_coprocessing | resources manager]] to configure the '''clocks''' and '''regulators''' via the [[STM32MP15 Linux kernel overview|Linux kernel]] .<br />
<br />
== Protecting GPIO and EXTI system resources by hardware semaphores ==<br />
The '''GPIO''' and '''EXTI''' configurations are protected from concurrent accesses by '''hardware semaphores''' from [[HSEM internal peripheral|HSEM]].<br /><br />
Each execution context must use a hardware semaphore to ensure the exclusive access to the '''critical registers''' of the GPIO and EXTI resources.<br />
{{Info|The developer has to ensure the consistency of the hardware semaphore usage accross the Cortex-A7 non-secure and Cortex-M4 contexts: in the STM32MPU Embedded Software distribution, the '''HSEM 0''' and the '''HSEM 1''' are used to protect the '''GPIO''' and the '''EXTI''' configurations, respectively.}}<br />
<br />
=== Cortex-A7 secure context ===<br />
In the [[STM32MPU Embedded Software distribution]], the [[TF-A overview |TF-A]] and [[OP-TEE overview|OP-TEE]] do not use HSEM protection, since no concurrent accesses to GPIO and EXTI system resource have been identified. Nevertheless this protection has to be taken into account in secure firmware development.<br />
<br />
=== Cortex-A7 non-secure context ===<br />
==== U-boot ====<br />
No specific protection is required in U-Boot since it configures the system resources before starting the Cortex-M4 firmware.<br />
==== Linux kernel ====<br />
The Linux GPIO and EXTI drivers use semaphores to protect the registers from being acessed: these semaphores are defined in the corresponding device tree nodes.<br />
<br />
exti: interrupt-controller@5000d000 {<br />
compatible = "st,stm32mp1-exti", "syscon";<br />
...<br />
{{Highlight|hwlocks {{=}} <&hsem 1>;}}<br />
...<br />
};<br />
<br />
pinctrl: pin-controller@50002000 {<br />
compatible = "st,stm32mp157-pinctrl";<br />
...<br />
{{Highlight|hwlocks {{=}} <&hsem 0>;}}<br />
...<br />
}<br />
<br />
=== Cortex-M4 context ===<br />
In the [[STM32CubeMP1 architecture|STM32Cube]] application, the developer must protect the '''GPIO''' and EXTI configuration registers by '''hardware semaphores''' managed by the [[HSEM internal peripheral|HSEM]]. This can be done by using the {{CodeSourceTest | STM32CubeMP1 | Projects/STM32MP157C-DK2/Templates/Src/lock_resource.c | lock resource}} service.<br />
{{Info | The selection of '''HSEM 0''' for '''GPIO''' and '''HSEM 1''' for '''EXTI''' protection is hidden inside STM32Cube code and visible inside the above '''lock resource''' service}}.<br />
<br />
void main(void)<br />
{<br />
GPIO_InitStruct.Pin = USER_BUTTON_PIN;<br />
<br />
/*HW semaphore Clock enable*/<br />
{{Highlight|__HAL_RCC_HSEM_CLK_ENABLE();}}<br />
<br />
{{Highlight|PERIPH_LOCK(GPIOA);}}<br />
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);<br />
{{Highlight|PERIPH_UNLOCK(GPIOA); }}<br />
...<br />
{{Highlight|PERIPH_LOCK(EXTI);}}<br />
HAL_EXTI_SetConfigLine(&hexti, &EXTI_ConfigStructure);<br />
{{Highlight|PERIPH_UNLOCK(EXTI);}}<br />
}<br />
<br />
== Configuring clock and regulator system resources ==<br />
The [[STM32MP15 Linux kernel overview|Linux kernel]] provides services, implemented by the [[Resource_manager_for_coprocessing|resource manager]], to control the '''clock''' and '''regulator''' configuration for the peripherals assigned to the Cortex-M4 context:<br />
* The resource manager [[Resource_manager_for_coprocessing#System_resource_configuration_set_service|configures]] the clocks and the regulators before the Cortex-M4 starts.<br />
* At runtime, the Cortex-M4 STM32Cube application can ask the resource manager to [[Resource_manager_for_coprocessing#Dynamic_system_resource_update_service|update]] the clock and regulator configurations: <br />
**clock rate<br />
**regulator settings<br />
<br />
====System resource manager on the Cortex-A7 non-secure context====<br />
The [[Resource_manager_for_coprocessing#System_resource_configuration_set_service | resource manager]] Linux Kernel driver is in charge of configuring the clocks and regulators used to operate the peripherals assigned to the Cortex-M4 context. The configurations are defined in the '''m4_system_resources''' node of the Linux kernel [[Device tree|device tree]]. <br />
<br />
To help developers, the [[STM32MP15 Linux kernel overview|Linux kernel]] predefines the clock system resources for most of the peripherals that can be assigned to the Cortex-M4 context: see {{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp157c-m4-srm.dtsi}}.<br />
<br />
==== System resource management on the Cortex-M4 context====<br />
As clock and regulator system resources are under the [[STM32MP15 Linux kernel overview|Linux kernel]] responsibility, the Cortex-M4 context '''must NOT''' configure these system resources directly:<br />
*The Cortex-M4 must not set the initial configuration of these resources: this is done by the [[STM32MP15 Linux kernel overview|Linux kernel]].<br />
*The Cortex-M4 can use the [[STM32CubeMP1 architecture|STM32Cube]] ResourceManager utility to update the configuration of these resources.<br />
<br />
=== ADC example ===<br />
This example describes how to configure the system resources of the ADC peripheral assigned to the Cortex-M4 coprocessor.<br />
<br />
==== Device tree on the Cortex-A7 non-secure context====<br />
* Disable the Linux ADC device node for the Cortex-A7 non-secure context (see [[How to assign an internal peripheral to a runtime context]] for details):<br />
&adc {<br />
status = {{Highlight|"disabled"}};<br />
...<br />
};<br />
<br />
* Notice that the ADC clocks are already defined in {{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp157c-m4-srm.dtsi}}.<br />
<br />
m4_adc: adc@48003000 {<br />
compatible = "rproc-srm-dev";<br />
reg = <0x48003000>;<br />
{{Highlight|clocks {{=}} <&rcc ADC12>, <&rcc ADC12_K>;}}<br />
{{Highlight|clock-names {{=}} "bus", "adc";}}<br />
status = "disabled";<br />
};<br />
<br />
* Enable the resource manager<br />
&m4_rproc {<br />
m4_system_resources {<br />
{{Highlight|status {{=}} "okay";}}<br />
};<br />
};<br />
* Enable the Linux ADC resource node for the Cortex-M4 and assign a regulator to it<br />
&m4_adc {<br />
{{Highlight|vref-supply {{=}} <&vdda>;}}<br />
{{Highlight|status {{=}} "okay";}}<br />
};<br />
<br />
==== Firmware update on the Cortex-M4 context ====<br />
No implementation is required to have the resources configured to their initial state.<br />
<br />
The below example describes how to update the ADC1 regulator configuration:<br />
<br />
* Initialization:<br />
int main(void)<br />
{<br />
...<br />
/* Initialize the ResourceManager with OpenAMP */<br />
HAL_IPCC_Init(&hipcc);<br />
OPENAMP_Init(RPMSG_REMOTE, NULL);<br />
{{Highlight|ResMgr_Init}}(NULL, NULL);<br />
<br />
...<br />
<br />
while (1)<br />
{<br />
/* ResourceManager with OpenAMP polling */<br />
OPENAMP_check_for_message();<br />
<br />
/* Application main processing */<br />
...<br />
}<br />
<br />
* Update of the regulator voltage:<br />
config_in.regu.index = 0;<br />
config_in.regu.enable = 1;<br />
config_in.regu.min_voltage_mv = 1000;<br />
config_in.regu.max_voltage_mv = 4000;<br />
<br />
{{Highlight|ResMgr_SetConfig}}({{Highlight|RESMGR_ID_ADC1}}, NULL, {{Highlight|RESMGR_REGU}}, &config_in, &config_out);<br />
<br />
log_info("Regulator voltage is now=%ld mv\n", config_out.regu.curr_voltage_mv);</div>
imported>Frq07267