Skip to content

Commit 909b9e2

Browse files
committed
stm32f0: Make interrupt stack sizes configurable
1 parent 2845d78 commit 909b9e2

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

stm32f0_src/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,29 @@ light_tasking_stm32f0xx.AHB_Pre = "DIV1"
282282
light_tasking_stm32f0xx.APB_Pre = "DIV1"
283283
```
284284

285+
The following variables configure the interrupt stack sizes:
286+
287+
<table>
288+
<thead>
289+
<th>Variable</th>
290+
<th>Values</th>
291+
<th>Default</th>
292+
<th>Description</th>
293+
</thead>
294+
<tr>
295+
<td><tt>Interrupt_Stack_Size</tt></td>
296+
<td>Any positive integer</td>
297+
<td><tt>1024</tt></td>
298+
<td>Specifies the size of the primary stack used for interrupt handlers.</td>
299+
</tr>
300+
<tr>
301+
<td><tt>Interrupt_Secondary_Stack_Size</tt></td>
302+
<td>Any positive integer</td>
303+
<td><tt>128</tt></td>
304+
<td>Specifies the size of the secondary stack used for interrupt handlers.</td>
305+
</tr>
306+
</table>
307+
285308
### GPR Scenario Variables
286309

287310
The runtime project files expose `*_BUILD` and and `*_LIBRARY_TYPE` GPR

stm32f0_src/s-bbpara.ads

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ pragma Restrictions (No_Elaboration_Code);
4444
with System.BB.Board_Parameters;
4545
with System.BB.MCU_Parameters;
4646

47+
with STM32F0xx_Runtime_Config;
48+
4749
package System.BB.Parameters is
4850
pragma Preelaborate (System.BB.Parameters);
4951

@@ -98,12 +100,14 @@ package System.BB.Parameters is
98100
-- Stacks --
99101
------------
100102

101-
Interrupt_Stack_Size : constant := 1024;
103+
Interrupt_Stack_Size : constant :=
104+
STM32F0xx_Runtime_Config.Interrupt_Stack_Size;
102105
-- Size of each of the interrupt stacks in bytes. While there nominally is
103106
-- an interrupt stack per interrupt priority, the entire space is used as a
104107
-- single stack.
105108

106-
Interrupt_Sec_Stack_Size : constant := 128;
109+
Interrupt_Sec_Stack_Size : constant :=
110+
STM32F0xx_Runtime_Config.Interrupt_Secondary_Stack_Size;
107111
-- Size of the secondary stack for interrupt handlers
108112

109113
Has_FPU : constant Boolean := False;

stm32f0_src/templates/alire.toml.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,8 @@ PLLMUL = { type = "Integer", first = 2, last = 16, default = 12 }
9999
AHB_Pre = { type = "Enum", values = ["DIV1", "DIV2", "DIV4", "DIV8", "DIV16", "DIV64", "DIV128", "DIV256", "DIV512"], default = "DIV1" }
100100
APB_Pre = { type = "Enum", values = ["DIV1", "DIV2", "DIV4", "DIV8", "DIV16"], default = "DIV2" }
101101

102+
Interrupt_Stack_Size = { type = "Integer", first = 1, default = 1024 }
103+
Interrupt_Secondary_Stack_Size = { type = "Integer", first = 1, default = 128 }
104+
102105
[[depends-on]]
103106
gnat_arm_elf = "^15"

0 commit comments

Comments
 (0)