Skip to content

Commit

Permalink
2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum-leaps committed Feb 13, 2023
1 parent 3a1a810 commit fe7056b
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 28 deletions.
4 changes: 2 additions & 2 deletions 3rd_party/nucleo-c031c6/README.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This directory contains embedded code for the STM32 NUCLEO-L152RE
This directory contains embedded code for the STM32 NUCLEO-C031C6
board. This code is then used to build ET tests for this board.
See also the examples/ directory, make_nucleo-l152re makefiles.
See also the examples/ directory, make_nucleo-l152re makefiles.
1 change: 1 addition & 0 deletions include/sst.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ int SST_Task_run(void); /* run SST tasks static */

/* SST Kernel facilities ---------------------------------------------------*/
void SST_init(void);
void SST_start(void);
void SST_onStart(void);

#ifndef SST_LOG2
Expand Down
1 change: 1 addition & 0 deletions include/sst.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class Task {

// SST Kernel facilities -----------------------------------------------------
void init(void);
void start(void);
void onStart(void);
void onIdle(void);

Expand Down
10 changes: 5 additions & 5 deletions sst_c/examples/blinky_button/armclang/nucleo-h743zi.uvoptx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<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>
<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>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
Expand All @@ -152,18 +152,18 @@
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>283</LineNumber>
<LineNumber>67</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134221674</Address>
<Address>134221976</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\bsp_nucleo-h743zi.c</Filename>
<Filename>..\..\..\ports\arm-cm\sst_port.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\blinky_button\../bsp_nucleo-h743zi.c\283</Expression>
<Expression>\\blinky_button\../../../ports/arm-cm/sst_port.c\67</Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
Expand Down
17 changes: 17 additions & 0 deletions sst_c/ports/arm-cm/sst_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ DBC_MODULE_NAME("sst_port") /* for DBC assertions in this module */
#define NVIC_EN ((uint32_t volatile *)0xE000E100U)
#define NVIC_IP ((uint32_t volatile *)0xE000E400U)
#define SCB_SYSPRI ((uint32_t volatile *)0xE000ED14U)
#define SCB_AIRCR *((uint32_t volatile *)0xE000ED0CU)
#define FPU_FPCCR *((uint32_t volatile *)0xE000EF34U)

/*..........................................................................*/
Expand Down Expand Up @@ -62,6 +63,22 @@ void SST_init(void) {
| (1U << 31U); /* lazy stacking (LSPEN) */
#endif
}
/*..........................................................................*/
void SST_start(void) {
/* Set the NVIC priority grouping to default 0
*
* NOTE:
* Typically the SST port to ARM Cortex-M should waste no NVIC priority
* bits for grouping. This code ensures this setting, but priority
* grouping can be still overridden in the application-specific
* callback SST_onStart().
*/
uint32_t tmp = SCB_AIRCR;
/* clear the key bits 31:16 and priority grouping bits 10:8 */
tmp &= ~((0xFFFFU << 16U) | (0x7U << 8U));
SCB_AIRCR = (0x05FAU << 16U) | tmp;
}

/* SST Task facilities -----------------------------------------------------*/
void SST_Task_setPrio(SST_Task * const me, SST_TaskPrio prio) {

Expand Down
3 changes: 2 additions & 1 deletion sst_c/src/sst.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ DBC_MODULE_NAME("sst") /* for DBC assertions in this module */

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

for (;;) { /* idle loop of the SST kernel */
SST_onIdle();
Expand Down
21 changes: 2 additions & 19 deletions sst_cpp/examples/blinky_button/armclang/nucleo-h743zi.uvoptx
Original file line number Diff line number Diff line change
Expand Up @@ -140,32 +140,15 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<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>
<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>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMDBGFLAGS</Key>
<Name></Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>725</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134218620</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>C:\GitHub\Super-Simple-Tasker\sst_c\targets\nucleo-h743zi\arm\startup_stm32h743xx.s</Filename>
<ExecCommand></ExecCommand>
<Expression>\\blinky_button\../../targets/nucleo-h743zi/arm/startup_stm32h743xx.s\725</Expression>
</Bp>
</Breakpoint>
<Breakpoint/>
<WatchWindow1>
<Ww>
<count>0</count>
Expand Down
16 changes: 16 additions & 0 deletions sst_cpp/ports/arm-cm/sst_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define NVIC_EN ((uint32_t volatile *)0xE000E100U)
#define NVIC_IP ((uint32_t volatile *)0xE000E400U)
#define SCB_SYSPRI ((uint32_t volatile *)0xE000ED14U)
#define SCB_AIRCR *((uint32_t volatile *)0xE000ED0CU)
#define FPU_FPCCR *((uint32_t volatile *)0xE000EF34U)

//............................................................................
Expand Down Expand Up @@ -67,6 +68,21 @@ void init(void) {
| (1U << 31U); // lazy stacking (LSPEN)
#endif
}
//............................................................................
void start(void) {
// Set the NVIC priority grouping to default 0
//
// NOTE:
// Typically the SST port to ARM Cortex-M should waste no NVIC priority
// bits for grouping. This code ensures this setting, but priority
// grouping can be still overridden in the application-specific
// callback SST_onStart().
//
std::uint32_t tmp = SCB_AIRCR;
// clear the key bits 31:16 and priority grouping bits 10:8
tmp &= ~((0xFFFFU << 16U) | (0x7U << 8U));
SCB_AIRCR = (0x05FAU << 16U) | tmp;
}

// SST Task facilities -------------------------------------------------------
void Task::setPrio(TaskPrio prio) noexcept {
Expand Down
2 changes: 1 addition & 1 deletion sst_cpp/src/sst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ DBC_MODULE_NAME("sst") // for DBC assertions in this module
namespace SST {

// SST kernel facilities -----------------------------------------------------
//............................................................................
int Task::run(void) {
SST::start(); // port-specific start of multitasking
onStart(); // configure and start the interrupts

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

0 comments on commit fe7056b

Please sign in to comment.