Skip to content

Commit fe7056b

Browse files
committed
2.0.4
1 parent 3a1a810 commit fe7056b

File tree

9 files changed

+47
-28
lines changed

9 files changed

+47
-28
lines changed

3rd_party/nucleo-c031c6/README.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
This directory contains embedded code for the STM32 NUCLEO-L152RE
1+
This directory contains embedded code for the STM32 NUCLEO-C031C6
22
board. This code is then used to build ET tests for this board.
3-
See also the examples/ directory, make_nucleo-l152re makefiles.
3+
See also the examples/ directory, make_nucleo-l152re makefiles.

include/sst.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ int SST_Task_run(void); /* run SST tasks static */
9191

9292
/* SST Kernel facilities ---------------------------------------------------*/
9393
void SST_init(void);
94+
void SST_start(void);
9495
void SST_onStart(void);
9596

9697
#ifndef SST_LOG2

include/sst.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class Task {
8787

8888
// SST Kernel facilities -----------------------------------------------------
8989
void init(void);
90+
void start(void);
9091
void onStart(void);
9192
void onIdle(void);
9293

sst_c/examples/blinky_button/armclang/nucleo-h743zi.uvoptx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
<SetRegEntry>
141141
<Number>0</Number>
142142
<Key>DLGTARM</Key>
143-
<Name>(1010=1221,723,1671,1280,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=3268,1338,3745,1653,0)</Name>
143+
<Name>(1010=2367,534,2817,1091,1)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=3268,1338,3745,1653,0)</Name>
144144
</SetRegEntry>
145145
<SetRegEntry>
146146
<Number>0</Number>
@@ -152,18 +152,18 @@
152152
<Bp>
153153
<Number>0</Number>
154154
<Type>0</Type>
155-
<LineNumber>283</LineNumber>
155+
<LineNumber>67</LineNumber>
156156
<EnabledFlag>1</EnabledFlag>
157-
<Address>134221674</Address>
157+
<Address>134221976</Address>
158158
<ByteObject>0</ByteObject>
159159
<HtxType>0</HtxType>
160160
<ManyObjects>0</ManyObjects>
161161
<SizeOfObject>0</SizeOfObject>
162162
<BreakByAccess>0</BreakByAccess>
163163
<BreakIfRCount>1</BreakIfRCount>
164-
<Filename>..\bsp_nucleo-h743zi.c</Filename>
164+
<Filename>..\..\..\ports\arm-cm\sst_port.c</Filename>
165165
<ExecCommand></ExecCommand>
166-
<Expression>\\blinky_button\../bsp_nucleo-h743zi.c\283</Expression>
166+
<Expression>\\blinky_button\../../../ports/arm-cm/sst_port.c\67</Expression>
167167
</Bp>
168168
</Breakpoint>
169169
<WatchWindow1>

sst_c/ports/arm-cm/sst_port.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ DBC_MODULE_NAME("sst_port") /* for DBC assertions in this module */
3232
#define NVIC_EN ((uint32_t volatile *)0xE000E100U)
3333
#define NVIC_IP ((uint32_t volatile *)0xE000E400U)
3434
#define SCB_SYSPRI ((uint32_t volatile *)0xE000ED14U)
35+
#define SCB_AIRCR *((uint32_t volatile *)0xE000ED0CU)
3536
#define FPU_FPCCR *((uint32_t volatile *)0xE000EF34U)
3637

3738
/*..........................................................................*/
@@ -62,6 +63,22 @@ void SST_init(void) {
6263
| (1U << 31U); /* lazy stacking (LSPEN) */
6364
#endif
6465
}
66+
/*..........................................................................*/
67+
void SST_start(void) {
68+
/* Set the NVIC priority grouping to default 0
69+
*
70+
* NOTE:
71+
* Typically the SST port to ARM Cortex-M should waste no NVIC priority
72+
* bits for grouping. This code ensures this setting, but priority
73+
* grouping can be still overridden in the application-specific
74+
* callback SST_onStart().
75+
*/
76+
uint32_t tmp = SCB_AIRCR;
77+
/* clear the key bits 31:16 and priority grouping bits 10:8 */
78+
tmp &= ~((0xFFFFU << 16U) | (0x7U << 8U));
79+
SCB_AIRCR = (0x05FAU << 16U) | tmp;
80+
}
81+
6582
/* SST Task facilities -----------------------------------------------------*/
6683
void SST_Task_setPrio(SST_Task * const me, SST_TaskPrio prio) {
6784

sst_c/src/sst.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ DBC_MODULE_NAME("sst") /* for DBC assertions in this module */
3030

3131
/*..........................................................................*/
3232
int SST_Task_run(void) {
33-
SST_onStart(); /* configure and start the interrupts */
33+
SST_start(); /* port-specific start of multitasking */
34+
SST_onStart(); /* application callback to config & start interrupts */
3435

3536
for (;;) { /* idle loop of the SST kernel */
3637
SST_onIdle();

sst_cpp/examples/blinky_button/armclang/nucleo-h743zi.uvoptx

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -140,32 +140,15 @@
140140
<SetRegEntry>
141141
<Number>0</Number>
142142
<Key>DLGTARM</Key>
143-
<Name>(1010=1221,723,1671,1280,1)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=3268,1338,3745,1653,0)</Name>
143+
<Name>(1010=2346,607,2796,1164,1)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=3268,1338,3745,1653,0)</Name>
144144
</SetRegEntry>
145145
<SetRegEntry>
146146
<Number>0</Number>
147147
<Key>ARMDBGFLAGS</Key>
148148
<Name></Name>
149149
</SetRegEntry>
150150
</TargetDriverDllRegistry>
151-
<Breakpoint>
152-
<Bp>
153-
<Number>0</Number>
154-
<Type>0</Type>
155-
<LineNumber>725</LineNumber>
156-
<EnabledFlag>1</EnabledFlag>
157-
<Address>134218620</Address>
158-
<ByteObject>0</ByteObject>
159-
<HtxType>0</HtxType>
160-
<ManyObjects>0</ManyObjects>
161-
<SizeOfObject>0</SizeOfObject>
162-
<BreakByAccess>0</BreakByAccess>
163-
<BreakIfRCount>1</BreakIfRCount>
164-
<Filename>C:\GitHub\Super-Simple-Tasker\sst_c\targets\nucleo-h743zi\arm\startup_stm32h743xx.s</Filename>
165-
<ExecCommand></ExecCommand>
166-
<Expression>\\blinky_button\../../targets/nucleo-h743zi/arm/startup_stm32h743xx.s\725</Expression>
167-
</Bp>
168-
</Breakpoint>
151+
<Breakpoint/>
169152
<WatchWindow1>
170153
<Ww>
171154
<count>0</count>

sst_cpp/ports/arm-cm/sst_port.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define NVIC_EN ((uint32_t volatile *)0xE000E100U)
3131
#define NVIC_IP ((uint32_t volatile *)0xE000E400U)
3232
#define SCB_SYSPRI ((uint32_t volatile *)0xE000ED14U)
33+
#define SCB_AIRCR *((uint32_t volatile *)0xE000ED0CU)
3334
#define FPU_FPCCR *((uint32_t volatile *)0xE000EF34U)
3435

3536
//............................................................................
@@ -67,6 +68,21 @@ void init(void) {
6768
| (1U << 31U); // lazy stacking (LSPEN)
6869
#endif
6970
}
71+
//............................................................................
72+
void start(void) {
73+
// Set the NVIC priority grouping to default 0
74+
//
75+
// NOTE:
76+
// Typically the SST port to ARM Cortex-M should waste no NVIC priority
77+
// bits for grouping. This code ensures this setting, but priority
78+
// grouping can be still overridden in the application-specific
79+
// callback SST_onStart().
80+
//
81+
std::uint32_t tmp = SCB_AIRCR;
82+
// clear the key bits 31:16 and priority grouping bits 10:8
83+
tmp &= ~((0xFFFFU << 16U) | (0x7U << 8U));
84+
SCB_AIRCR = (0x05FAU << 16U) | tmp;
85+
}
7086

7187
// SST Task facilities -------------------------------------------------------
7288
void Task::setPrio(TaskPrio prio) noexcept {

sst_cpp/src/sst.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ DBC_MODULE_NAME("sst") // for DBC assertions in this module
3636
namespace SST {
3737

3838
// SST kernel facilities -----------------------------------------------------
39-
//............................................................................
4039
int Task::run(void) {
40+
SST::start(); // port-specific start of multitasking
4141
onStart(); // configure and start the interrupts
4242

4343
for (;;) { // idle loop of the SST kernel

0 commit comments

Comments
 (0)