Bladeren bron

RTX5: updated configuration (simplified resource allocation)

Robert Rostohar 9 jaren geleden
bovenliggende
commit
ff75e34b84

+ 52 - 51
CMSIS/RTOS2/RTX/Config/RTX_Config.c

@@ -30,19 +30,25 @@
 // <h>Thread Configuration
 // =======================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_THREAD_STATIC            0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_THREAD_OBJ_MEM           0
  
 //     <o>Number of user Threads (total) <1-1000>
 //     <i> Defines maximum number of user threads that can be active at the same time.
+//     <i> Applies to user threads with system provided memory for control blocks.
 #define OS_THREAD_NUM               1
  
 //     <o>Number of user Threads with user-provided Stack size <0-1000>
 //     <i> Defines maximum number of user threads with user-provided stack size.
 //     <i> Default: 0
 #define OS_THREAD_USER_STACK_NUM    0
-  
+ 
+//     <o>Total Stack size [bytes] for user Threads with user-provided Stack size <0-1073741824:8>
+//     <i> Defines the combined stack size for user threads with user-provided stack size.
+//     <i> Default: 0
+#define OS_THREAD_USER_STACK_SIZE   0
+ 
 //   </e>
  
 //   <o>Default Thread Stack size [bytes] <96-1073741824:8>
@@ -76,12 +82,13 @@
 // <h>Timer Configuration
 // ======================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_TIMER_STATIC             0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_TIMER_OBJ_MEM            0
  
-//     <o>Number of user Timers <1-1000>
-//     <i> Defines maximum number of user timers that can be active at the same time.
+//     <o>Number of Timer objects <1-1000>
+//     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_TIMER_NUM                1
  
 //   </e>
@@ -112,12 +119,13 @@
 // <h>Event Flags Configuration
 // ============================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_EVFLAGS_STATIC           0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_EVFLAGS_OBJ_MEM          0
  
 //     <o>Number of Event Flags objects <1-1000>
 //     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_EVFLAGS_NUM              1
  
 //   </e>
@@ -127,12 +135,13 @@
 // <h>Mutex Configuration
 // ======================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_MUTEX_STATIC             0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_MUTEX_OBJ_MEM            0
  
 //     <o>Number of Mutex objects <1-1000>
 //     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_MUTEX_NUM                1
  
 //   </e>
@@ -142,12 +151,13 @@
 // <h>Semaphore Configuration
 // ==========================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_SEMAPHORE_STATIC         0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_SEMAPHORE_OBJ_MEM        0
  
 //     <o>Number of Semaphore objects <1-1000>
 //     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_SEMAPHORE_NUM            1
  
 //   </e>
@@ -157,14 +167,21 @@
 // <h>Memory Pool Configuration
 // ============================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_MEMPOOL_STATIC           0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_MEMPOOL_OBJ_MEM          0
  
 //     <o>Number of Memory Pool objects <1-1000>
 //     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_MEMPOOL_NUM              1
  
+//     <o>Data Storage Memory size [bytes] <0-1073741824:4>
+//     <i> Defines the combined data storage memory size.
+//     <i> Applies to objects with system provided memory for data storage.
+//     <i> Default: 0
+#define OS_MEMPOOL_DATA_SIZE        0
+ 
 //   </e>
  
 // </h>
@@ -172,14 +189,21 @@
 // <h>Message Queue Configuration
 // ==============================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_MSGQUEUE_STATIC          0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_MSGQUEUE_OBJ_MEM         0
  
 //     <o>Number of Message Queue objects <1-1000>
 //     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_MSGQUEUE_NUM             1
  
+//     <o>Data Storage Memory size [bytes] <0-1073741824:4>
+//     <i> Defines the combined data storage memory size.
+//     <i> Applies to objects with system provided memory for data storage.
+//     <i> Default: 0
+#define OS_MSGQUEUE_DATA_SIZE       0
+ 
 //   </e>
  
 // </h>
@@ -187,31 +211,8 @@
 // <h>System Configuration
 // =======================
  
-//   <e>Dynamic Resources
-//   <i> Enables dynamic resources allocation
-#define OS_DYNAMIC                  0
- 
-//     <o>Memory size [bytes] for Control Blocks <0-1073741824:4>
-//     <i> Defines the combined memory size for control blocks.
-//     <i> Excluding objects with static resources.
-//     <i> Default: 0
-#define OS_DYNAMIC_MEM_CB_SIZE      0
- 
-//     <o>Memory size [bytes] for Data Storage <0-1073741824:4>
-//     <i> Defines the combined memory size for data storage (Memory Pool and Message Queue).
-//     <i> Default: 0
-#define OS_DYNAMIC_MEM_DATA_SIZE    0
- 
-//     <o>Memory size [bytes] for Stack <0-1073741824:8>
-//     <i> Defines the combined memory size for stack (Thread).
-//     <i> Excluding threads with static resources and default stack size.
-//     <i> Default: 0
-#define OS_DYNAMIC_MEM_STACK_SIZE   0
- 
-//   </e>
- 
-//     <o>Dynamic Memory size [bytes] <0-1073741824:8>
-//     <i> Defines the combined dynamic memory size (excluding static and dynamic resources).
+//     <o>Global Dynamic Memory size [bytes] <0-1073741824:8>
+//     <i> Defines the combined global dynamic memory size.
 //     <i> Default: 4096
 #define OS_DYNAMIC_MEM_SIZE         4096
  
@@ -237,8 +238,8 @@
 // </h>
  
 // Number of Threads which use standard C/C++ library libspace
-// (when static thread resource allocation is not used).
-#if (OS_THREAD_STATIC == 0)
+// (when thread specific memory allocation is not used).
+#if (OS_THREAD_OBJ_MEM == 0)
 #define OS_THREAD_LIBSPACE_NUM      4
 #else
 #define OS_THREAD_LIBSPACE_NUM      OS_THREAD_NUM

+ 5 - 0
CMSIS/RTOS2/RTX/Examples/Simulation/RTX5_Blinky/Blinky.uvoptx

@@ -146,6 +146,11 @@
         </SetRegEntry>
       </TargetDriverDllRegistry>
       <Breakpoint/>
+      <ScvdPack>
+        <Filename>C:\Keil\ARM\PACK\ARM\CMSIS\5.0.0-Beta12\CMSIS\RTOS2\RTX\RTX5.scvd</Filename>
+        <Type>ARM.CMSIS.5.0.0-Beta12</Type>
+        <SubType>1</SubType>
+      </ScvdPack>
       <Tracepoint>
         <THDelay>0</THDelay>
       </Tracepoint>

+ 5 - 4
CMSIS/RTOS2/RTX/Examples/Simulation/RTX5_Blinky/Blinky.uvprojx

@@ -15,7 +15,7 @@
         <TargetCommonOption>
           <Device>ARMCM3</Device>
           <Vendor>ARM</Vendor>
-          <PackID>ARM.CMSIS.5.0.0-Beta11</PackID>
+          <PackID>ARM.CMSIS.5.0.0-Beta12</PackID>
           <PackURL>http://www.keil.com/pack/</PackURL>
           <Cpu>IRAM(0x20000000,0x00020000) IROM(0x00000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ESEL ELITTLE</Cpu>
           <FlashUtilSpec></FlashUtilSpec>
@@ -330,6 +330,7 @@
             <vShortWch>0</vShortWch>
             <v6Lto>0</v6Lto>
             <v6WtE>0</v6WtE>
+            <v6Rtti>0</v6Rtti>
             <VariousControls>
               <MiscControls></MiscControls>
               <Define></Define>
@@ -453,7 +454,7 @@
       <file attr="config" category="source" name="CMSIS\RTOS2\RTX\Config\RTX_Config.c" version="5.0.0">
         <instance index="0">RTE\CMSIS\RTX_Config.c</instance>
         <component Capiversion="2.0" Cclass="CMSIS" Cgroup="RTOS2" Csub="Keil RTX5" Cvendor="ARM" Cversion="5.0.0-Alpha" condition="RTOS2 RTX5 Dependency"/>
-        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.0.0-Beta11"/>
+        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.0.0-Beta12"/>
         <targetInfos>
           <targetInfo name="Simulation"/>
         </targetInfos>
@@ -461,7 +462,7 @@
       <file attr="config" category="sourceAsm" condition="ARMCC" name="Device\ARM\ARMCM3\Source\ARM\startup_ARMCM3.s" version="1.0.0">
         <instance index="0">RTE\Device\ARMCM3\startup_ARMCM3.s</instance>
         <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.0.1" condition="ARMCM3 CMSIS"/>
-        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.0.0-Beta11"/>
+        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.0.0-Beta12"/>
         <targetInfos>
           <targetInfo name="Simulation"/>
         </targetInfos>
@@ -469,7 +470,7 @@
       <file attr="config" category="sourceC" name="Device\ARM\ARMCM3\Source\system_ARMCM3.c" version="1.0.0">
         <instance index="0">RTE\Device\ARMCM3\system_ARMCM3.c</instance>
         <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.0.1" condition="ARMCM3 CMSIS"/>
-        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.0.0-Beta11"/>
+        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.0.0-Beta12"/>
         <targetInfos>
           <targetInfo name="Simulation"/>
         </targetInfos>

+ 52 - 51
CMSIS/RTOS2/RTX/Examples/Simulation/RTX5_Blinky/RTE/CMSIS/RTX_Config.c

@@ -30,19 +30,25 @@
 // <h>Thread Configuration
 // =======================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_THREAD_STATIC            1
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_THREAD_OBJ_MEM           1
  
 //     <o>Number of user Threads (total) <1-1000>
 //     <i> Defines maximum number of user threads that can be active at the same time.
+//     <i> Applies to user threads with system provided memory for control blocks.
 #define OS_THREAD_NUM               6
  
 //     <o>Number of user Threads with user-provided Stack size <0-1000>
 //     <i> Defines maximum number of user threads with user-provided stack size.
 //     <i> Default: 0
 #define OS_THREAD_USER_STACK_NUM    0
-  
+ 
+//     <o>Total Stack size [bytes] for user Threads with user-provided Stack size <0-1073741824:8>
+//     <i> Defines the combined stack size for user threads with user-provided stack size.
+//     <i> Default: 0
+#define OS_THREAD_USER_STACK_SIZE   0
+ 
 //   </e>
  
 //   <o>Default Thread Stack size [bytes] <96-1073741824:8>
@@ -76,12 +82,13 @@
 // <h>Timer Configuration
 // ======================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_TIMER_STATIC             0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_TIMER_OBJ_MEM            0
  
-//     <o>Number of user Timers <1-1000>
-//     <i> Defines maximum number of user timers that can be active at the same time.
+//     <o>Number of Timer objects <1-1000>
+//     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_TIMER_NUM                1
  
 //   </e>
@@ -112,12 +119,13 @@
 // <h>Event Flags Configuration
 // ============================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_EVFLAGS_STATIC           0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_EVFLAGS_OBJ_MEM          0
  
 //     <o>Number of Event Flags objects <1-1000>
 //     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_EVFLAGS_NUM              1
  
 //   </e>
@@ -127,12 +135,13 @@
 // <h>Mutex Configuration
 // ======================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_MUTEX_STATIC             0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_MUTEX_OBJ_MEM            0
  
 //     <o>Number of Mutex objects <1-1000>
 //     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_MUTEX_NUM                1
  
 //   </e>
@@ -142,12 +151,13 @@
 // <h>Semaphore Configuration
 // ==========================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_SEMAPHORE_STATIC         0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_SEMAPHORE_OBJ_MEM        0
  
 //     <o>Number of Semaphore objects <1-1000>
 //     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_SEMAPHORE_NUM            1
  
 //   </e>
@@ -157,14 +167,21 @@
 // <h>Memory Pool Configuration
 // ============================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_MEMPOOL_STATIC           0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_MEMPOOL_OBJ_MEM          0
  
 //     <o>Number of Memory Pool objects <1-1000>
 //     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_MEMPOOL_NUM              1
  
+//     <o>Data Storage Memory size [bytes] <0-1073741824:4>
+//     <i> Defines the combined data storage memory size.
+//     <i> Applies to objects with system provided memory for data storage.
+//     <i> Default: 0
+#define OS_MEMPOOL_DATA_SIZE        0
+ 
 //   </e>
  
 // </h>
@@ -172,14 +189,21 @@
 // <h>Message Queue Configuration
 // ==============================
  
-//   <e>Static Resources
-//   <i> Enables static resources allocation.
-#define OS_MSGQUEUE_STATIC          0
+//   <e>Object specific Memory allocation
+//   <i> Enables object specific memory allocation.
+#define OS_MSGQUEUE_OBJ_MEM         0
  
 //     <o>Number of Message Queue objects <1-1000>
 //     <i> Defines maximum number of objects that can be active at the same time.
+//     <i> Applies to objects with system provided memory for control blocks.
 #define OS_MSGQUEUE_NUM             1
  
+//     <o>Data Storage Memory size [bytes] <0-1073741824:4>
+//     <i> Defines the combined data storage memory size.
+//     <i> Applies to objects with system provided memory for data storage.
+//     <i> Default: 0
+#define OS_MSGQUEUE_DATA_SIZE       0
+ 
 //   </e>
  
 // </h>
@@ -187,31 +211,8 @@
 // <h>System Configuration
 // =======================
  
-//   <e>Dynamic Resources
-//   <i> Enables dynamic resources allocation
-#define OS_DYNAMIC                  0
- 
-//     <o>Memory size [bytes] for Control Blocks <0-1073741824:4>
-//     <i> Defines the combined memory size for control blocks.
-//     <i> Excluding objects with static resources.
-//     <i> Default: 0
-#define OS_DYNAMIC_MEM_CB_SIZE      0
- 
-//     <o>Memory size [bytes] for Data Storage <0-1073741824:4>
-//     <i> Defines the combined memory size for data storage (Memory Pool and Message Queue).
-//     <i> Default: 0
-#define OS_DYNAMIC_MEM_DATA_SIZE    0
- 
-//     <o>Memory size [bytes] for Stack <0-1073741824:8>
-//     <i> Defines the combined memory size for stack (Thread).
-//     <i> Excluding threads with static resources and default stack size.
-//     <i> Default: 0
-#define OS_DYNAMIC_MEM_STACK_SIZE   0
- 
-//   </e>
- 
-//     <o>Dynamic Memory size [bytes] <0-1073741824:8>
-//     <i> Defines the combined dynamic memory size (excluding static and dynamic resources).
+//     <o>Global Dynamic Memory size [bytes] <0-1073741824:8>
+//     <i> Defines the combined global dynamic memory size.
 //     <i> Default: 4096
 #define OS_DYNAMIC_MEM_SIZE         4096
  
@@ -237,8 +238,8 @@
 // </h>
  
 // Number of Threads which use standard C/C++ library libspace
-// (when static thread resource allocation is not used).
-#if (OS_THREAD_STATIC == 0)
+// (when thread specific memory allocation is not used).
+#if (OS_THREAD_OBJ_MEM == 0)
 #define OS_THREAD_LIBSPACE_NUM      4
 #else
 #define OS_THREAD_LIBSPACE_NUM      OS_THREAD_NUM

+ 72 - 69
CMSIS/RTOS2/RTX/Include/rtx_config.h

@@ -39,21 +39,31 @@
 #endif
 
 
-#if (OS_THREAD_STATIC != 0)
+#if (OS_THREAD_OBJ_MEM != 0)
 
 #define OS_THREAD_DEF_STACK_NUM (OS_THREAD_NUM - OS_THREAD_USER_STACK_NUM)
 
-#if ((OS_THREAD_NUM == 0) || (OS_THREAD_DEF_STACK_NUM < 0))
+#if ((OS_THREAD_NUM == 0) || (OS_THREAD_NUM < OS_THREAD_USER_STACK_NUM))
 #error "Invalid number of user Threads!"
 #endif
 
+#if ((OS_THREAD_USER_STACK_NUM != 0) && (OS_THREAD_USER_STACK_SIZE == 0))
+#error "Total Stack size must not be zero!"
+#endif
+
+#if ((OS_THREAD_USER_STACK_SIZE != 0) && \
+   (((OS_THREAD_USER_STACK_SIZE & 7) != 0) || \
+     (OS_THREAD_USER_STACK_SIZE < (72*OS_THREAD_USER_STACK_NUM))))
+#error "Invalid total Stack size!"
+#endif
+
 // Thread Control Blocks
 static os_thread_t os_thread_cb[OS_THREAD_NUM] \
 __attribute__((section(".os.object.cb")));
 
 // Thread Default Stack
 #if (OS_THREAD_DEF_STACK_NUM != 0)
-static uint64_t os_thread_stack[OS_THREAD_DEF_STACK_NUM*(OS_STACK_SIZE/8)] \
+static uint64_t os_thread_def_stack[OS_THREAD_DEF_STACK_NUM*(OS_STACK_SIZE/8)] \
 __attribute__((section(".os.object.stack")));
 #endif
 
@@ -64,12 +74,18 @@ __attribute__((section(".os.object.cb"))) =
 
 // Memory Pool for Thread Default Stack
 #if (OS_THREAD_DEF_STACK_NUM != 0)
-static os_mp_info_t os_mpi_stack \
-__attribute__((section(".os.object.cb"))) =
-{ (uint32_t)OS_THREAD_DEF_STACK_NUM, 0U, (uint32_t)OS_STACK_SIZE, &os_thread_stack, NULL, NULL };
+static os_mp_info_t os_mpi_def_stack \
+__attribute__((section(".os.object.stack"))) =
+{ (uint32_t)OS_THREAD_DEF_STACK_NUM, 0U, (uint32_t)OS_STACK_SIZE, &os_thread_def_stack, NULL, NULL };
+#endif
+
+// Memory Pool for Thread Stack
+#if (OS_THREAD_USER_STACK_SIZE != 0)
+static uint64_t os_thread_stack[OS_THREAD_USER_STACK_SIZE/8] \
+__attribute__((section(".os.object.stack")));
 #endif
 
-#endif  // (OS_THREAD_STATIC != 0)
+#endif  // (OS_THREAD_OBJ_MEM != 0)
 
 
 // Stack overrun checking
@@ -104,10 +120,10 @@ static const osThreadAttr_t os_idle_thread_attr = {
 // Timer Configuration
 // ===================
 
-#if (OS_TIMER_STATIC != 0)
+#if (OS_TIMER_OBJ_MEM != 0)
 
 #if (OS_TIMER_NUM == 0)
-#error "Invalid number of user Timers!"
+#error "Invalid number of Timer objects!"
 #endif
 
 // Timer Control Blocks
@@ -119,10 +135,10 @@ static os_mp_info_t os_mpi_timer \
 __attribute__((section(".os.object.cb"))) =
 { (uint32_t)OS_TIMER_NUM, 0U, (uint32_t)os_TimerCbSize, &os_timer_cb, NULL, NULL };
 
-#endif  // (OS_TIMER_STATIC != 0)
+#endif  // (OS_TIMER_OBJ_MEM != 0)
 
 
-#if ((OS_TIMER_THREAD_STACK_SIZE > 0) && (OS_TIMER_CB_QUEUE > 0))
+#if ((OS_TIMER_THREAD_STACK_SIZE != 0) && (OS_TIMER_CB_QUEUE != 0))
 
 #if (((OS_TIMER_THREAD_STACK_SIZE & 7) != 0) || (OS_TIMER_THREAD_STACK_SIZE < 96))
 #error "Invalid Timer Thread Stack size!"
@@ -166,13 +182,13 @@ static const osMessageQueueAttr_t os_timer_mq_attr = {
   (uint32_t)sizeof(os_timer_mq_data)
 };
 
-#endif  // ((OS_TIMER_THREAD_STACK_SIZE > 0) && (OS_TIMER_CB_QUEUE > 0))
+#endif  // ((OS_TIMER_THREAD_STACK_SIZE != 0) && (OS_TIMER_CB_QUEUE != 0))
 
 
 // Event Flags Configuration
 // =========================
 
-#if (OS_EVFLAGS_STATIC != 0)
+#if (OS_EVFLAGS_OBJ_MEM != 0)
 
 #if (OS_EVFLAGS_NUM == 0)
 #error "Invalid number of Event Flags objects!"
@@ -187,13 +203,13 @@ static os_mp_info_t os_mpi_ef \
 __attribute__((section(".os.object.cb"))) =
 { (uint32_t)OS_EVFLAGS_NUM, 0U, (uint32_t)os_EventFlagsCbSize, &os_ef_cb, NULL, NULL };
 
-#endif  // (OS_EVFLAGS_STATIC != 0)
+#endif  // (OS_EVFLAGS_OBJ_MEM != 0)
 
 
 // Mutex Configuration
 // ===================
 
-#if (OS_MUTEX_STATIC != 0)
+#if (OS_MUTEX_OBJ_MEM != 0)
 
 #if (OS_MUTEX_NUM == 0)
 #error "Invalid number of Mutex objects!"
@@ -208,13 +224,13 @@ static os_mp_info_t os_mpi_mutex \
 __attribute__((section(".os.object.cb"))) =
 { (uint32_t)OS_MUTEX_NUM, 0U, (uint32_t)os_MutexCbSize, &os_mutex_cb, NULL, NULL };
 
-#endif  // (OS_MUTEX_STATIC != 0)
+#endif  // (OS_MUTEX_OBJ_MEM != 0)
 
 
 // Semaphore Configuration
 // =======================
 
-#if (OS_SEMAPHORE_STATIC != 0)
+#if (OS_SEMAPHORE_OBJ_MEM != 0)
 
 #if (OS_SEMAPHORE_NUM == 0)
 #error "Invalid number of Semaphore objects!"
@@ -229,15 +245,15 @@ static os_mp_info_t os_mpi_semaphore \
 __attribute__((section(".os.object.cb"))) =
 { (uint32_t)OS_SEMAPHORE_NUM, 0U, (uint32_t)os_SemaphoreCbSize, &os_semaphore_cb, NULL, NULL };
 
-#endif  // (OS_SEMAPHORE_STATIC != 0)
+#endif  // (OS_SEMAPHORE_OBJ_MEM != 0)
 
 
 // Memory Pool Configuration
 // =========================
 
-#if (OS_MEMPOOL_STATIC != 0)
+#if (OS_MEMPOOL_OBJ_MEM != 0)
 
-#if (OS_MUTEX_NUM == 0)
+#if (OS_MEMPOOL_NUM == 0)
 #error "Invalid number of Memory Pool objects!"
 #endif
 
@@ -250,15 +266,24 @@ static os_mp_info_t os_mpi_mp \
 __attribute__((section(".os.object.cb"))) =
 { (uint32_t)OS_MEMPOOL_NUM, 0U, (uint32_t)os_MemoryPoolCbSize, &os_mp_cb, NULL, NULL };
 
-#endif  // (OS_MEMPOOL_STATIC != 0)
+// Memory Pool for Memory Pool Data Storage
+#if (OS_MEMPOOL_DATA_SIZE != 0)
+#if ((OS_MEMPOOL_DATA_SIZE & 3) != 0)
+#error "Invalid Data Memory size for Memory Pools!"
+#endif
+static uint32_t os_mp_data[OS_MEMPOOL_DATA_SIZE/4] \
+__attribute__((section(".os.object.data")));
+#endif
+
+#endif  // (OS_MEMPOOL_OBJ_MEM != 0)
 
 
 // Message Queue Configuration
 // ===========================
 
-#if (OS_MSGQUEUE_STATIC != 0)
+#if (OS_MSGQUEUE_OBJ_MEM != 0)
 
-#if (OS_MUTEX_NUM == 0)
+#if (OS_MSGQUEUE_NUM == 0)
 #error "Invalid number of Message Queue objects!"
 #endif
 
@@ -271,42 +296,20 @@ static os_mp_info_t os_mpi_mq \
 __attribute__((section(".os.object.cb"))) =
 { (uint32_t)OS_MSGQUEUE_NUM, 0U, (uint32_t)os_MessageQueueCbSize, &os_mq_cb, NULL, NULL };
 
-#endif  // (OS_MSGQUEUE_STATIC != 0)
-
-
-// System Configuration
-// ====================
-
-#if (OS_DYNAMIC != 0)
-
-// Memory for Control Blocks
-#if (OS_DYNAMIC_MEM_CB_SIZE != 0)
-#if ((OS_DYNAMIC_MEM_CB_SIZE & 3) != 0)
-#error "Invalid memory size for Control Blocks!"
-#endif
-static uint32_t os_mem_cb[OS_DYNAMIC_MEM_CB_SIZE/4] \
-__attribute__((section(".os.object.cb")));
+// Memory Pool for Message Queue Data Storage
+#if (OS_MSGQUEUE_DATA_SIZE != 0)
+#if ((OS_MSGQUEUE_DATA_SIZE & 3) != 0)
+#error "Invalid Data Memory size for Message Queues!"
 #endif
-
-// Memory for Data Storage
-#if (OS_DYNAMIC_MEM_DATA_SIZE != 0)
-#if ((OS_DYNAMIC_MEM_DATA_SIZE & 3) != 0)
-#error "Invalid memory size for Data Storage!"
-#endif
-static uint32_t os_mem_data[OS_DYNAMIC_MEM_DATA_SIZE/4] \
+static uint32_t os_mq_data[OS_MSGQUEUE_DATA_SIZE/4] \
 __attribute__((section(".os.object.data")));
 #endif
 
-// Memory for Stack
-#if (OS_DYNAMIC_MEM_STACK_SIZE != 0)
-#if ((OS_DYNAMIC_MEM_STACK_SIZE & 7) != 0)
-#error "Invalid memory size for Stack!"
-#endif
-static uint64_t os_mem_stack[OS_DYNAMIC_MEM_STACK_SIZE/8] \
-__attribute__((section(".os.object.stack")));
-#endif
+#endif  // (OS_MSGQUEUE_OBJ_MEM != 0)
 
-#endif  // (OS_DYNAMIC != 0)
+
+// System Configuration
+// ====================
 
 // Dynamic Memory
 #if (OS_DYNAMIC_MEM_SIZE != 0)
@@ -342,18 +345,18 @@ const os_config_t os_Config = {
   { &os_isr_queue[0], sizeof(os_isr_queue)/sizeof(void *), 0U },
   { 
     // Memory Pools (Variable Block Size)
-#if (OS_DYNAMIC_MEM_CB_SIZE != 0)
-    &os_mem_cb, (uint32_t)OS_DYNAMIC_MEM_CB_SIZE,
+#if ((OS_THREAD_OBJ_MEM != 0) && (OS_THREAD_USER_STACK_SIZE != 0))
+    &os_thread_stack, (uint32_t)OS_THREAD_USER_STACK_SIZE,
 #else
     NULL, 0U,
 #endif
-#if (OS_DYNAMIC_MEM_DATA_SIZE != 0)
-    &os_mem_data, (uint32_t)OS_DYNAMIC_MEM_DATA_SIZE,
+#if ((OS_MEMPOOL_OBJ_MEM != 0) && (OS_MEMPOOL_DATA_SIZE != 0))
+    &os_mp_data, (uint32_t)OS_MEMPOOL_DATA_SIZE,
 #else
     NULL, 0U,
 #endif
-#if (OS_DYNAMIC_MEM_STACK_SIZE != 0)
-    &os_mem_stack, (uint32_t)OS_DYNAMIC_MEM_STACK_SIZE,
+#if ((OS_MSGQUEUE_OBJ_MEM != 0) && (OS_MSGQUEUE_DATA_SIZE != 0))
+    &os_mq_data, (uint32_t)OS_MSGQUEUE_DATA_SIZE,
 #else
     NULL, 0U,
 #endif
@@ -365,9 +368,9 @@ const os_config_t os_Config = {
   },
   {
     // Memory Pools (Fixed Block Size)
-#if (OS_THREAD_STATIC != 0)
+#if (OS_THREAD_OBJ_MEM != 0)
 #if (OS_THREAD_DEF_STACK_NUM != 0)
-    &os_mpi_stack,
+    &os_mpi_def_stack,
 #else
     NULL,
 #endif
@@ -376,32 +379,32 @@ const os_config_t os_Config = {
     NULL, 
     NULL,
 #endif
-#if (OS_TIMER_STATIC != 0)
+#if (OS_TIMER_OBJ_MEM != 0)
     &os_mpi_timer,
 #else
     NULL,
 #endif
-#if (OS_EVFLAGS_STATIC != 0)
+#if (OS_EVFLAGS_OBJ_MEM != 0)
     &os_mpi_ef,
 #else
     NULL,
 #endif
-#if (OS_MUTEX_STATIC != 0)
+#if (OS_MUTEX_OBJ_MEM != 0)
     &os_mpi_mutex,
 #else
     NULL,
 #endif
-#if (OS_SEMAPHORE_STATIC != 0)
+#if (OS_SEMAPHORE_OBJ_MEM != 0)
     &os_mpi_semaphore,
 #else
     NULL,
 #endif
-#if (OS_MEMPOOL_STATIC != 0)
+#if (OS_MEMPOOL_OBJ_MEM != 0)
     &os_mpi_mp,
 #else
     NULL,
 #endif
-#if (OS_MSGQUEUE_STATIC != 0)
+#if (OS_MSGQUEUE_OBJ_MEM != 0)
     &os_mpi_mq,
 #else
     NULL,
@@ -409,7 +412,7 @@ const os_config_t os_Config = {
   },
   (uint32_t)OS_STACK_SIZE,
   &os_idle_thread_attr,
-#if ((OS_TIMER_THREAD_STACK_SIZE > 0) && (OS_TIMER_CB_QUEUE > 0))
+#if ((OS_TIMER_THREAD_STACK_SIZE != 0) && (OS_TIMER_CB_QUEUE != 0))
   &os_timer_thread_attr,
   &os_timer_mq_attr,
   (uint32_t)OS_TIMER_CB_QUEUE

+ 8 - 8
CMSIS/RTOS2/RTX/Include/rtx_os.h

@@ -324,13 +324,13 @@ typedef struct {
     void (*event_flags)(os_event_flags_t*); ///< Event Flags Post Processing function
     void     (*semaphore)(os_semaphore_t*); ///< Semaphore Post Processing function
     void (*memory_pool)(os_memory_pool_t*); ///< Memory Pool Post Processing function
-    void   (*message_queue)(os_message_t*); ///< MEssage Queue Post Processing function
+    void   (*message_queue)(os_message_t*); ///< Message Queue Post Processing function
   } post_process;
   struct {                              ///< Memory Pools (Variable Block Size)
-    void                          *cb;  ///< Control Blocks Memory
-    void                        *data;  ///< Data Memory
     void                       *stack;  ///< Stack Memory
-    void                      *common;  ///< Common Memory Address
+    void                     *mp_data;  ///< Memory Pool Data Memory
+    void                     *mq_data;  ///< Message Queue Data Memory
+    void                      *common;  ///< Common Memory
   } mem;
   struct {                              ///< Memory Pools (Fixed Block Size)
     os_mp_info_t               *stack;  ///< Stack for Threads
@@ -439,12 +439,12 @@ typedef struct {
     uint16_t                         padding;
   } isr_queue;
   struct {                                      ///< Memory Pools (Variable Block Size)
-    void                            *cb_addr;   ///< Control Blocks Memory Address
-    uint32_t                         cb_size;   ///< Control Blocks Memory Size
-    void                          *data_addr;   ///< Data Memory Address
-    uint32_t                       data_size;   ///< Data Memory Size
     void                         *stack_addr;   ///< Stack Memory Address
     uint32_t                      stack_size;   ///< Stack Memory Size
+    void                       *mp_data_addr;   ///< Memory Pool Memory Address
+    uint32_t                    mp_data_size;   ///< Memory Pool Memory Size
+    void                       *mq_data_addr;   ///< Message Queue Data Memory Address
+    uint32_t                    mq_data_size;   ///< Message Queue Data Memory Size
     void                        *common_addr;   ///< Common Memory Address
     uint32_t                     common_size;   ///< Common Memory Size
   } mem;

+ 18 - 6
CMSIS/RTOS2/RTX/Library/ARM/MDK/RTX_CM.uvprojx

@@ -11,12 +11,12 @@
       <ToolsetNumber>0x4</ToolsetNumber>
       <ToolsetName>ARM-ADS</ToolsetName>
       <pArmCC>6050000::V6.5::.\ARMCLANG_6.5</pArmCC>
-      <pCCUsed>6050000::V6.5::.\ARMCLANG_6.5</pCCUsed>
+      <pCCUsed>6050000::V6.5::.\ARMCLANG</pCCUsed>
       <TargetOption>
         <TargetCommonOption>
           <Device>ARMCM0</Device>
           <Vendor>ARM</Vendor>
-          <PackID>ARM.CMSIS.5.0.0</PackID>
+          <PackID>ARM.CMSIS.5.0.0-Beta12</PackID>
           <PackURL>http://www.keil.com/pack/</PackURL>
           <Cpu>IRAM(0x20000000,0x00020000) IROM(0x00000000,0x00040000) CPUTYPE("Cortex-M0") CLOCK(12000000) ESEL ELITTLE</Cpu>
           <FlashUtilSpec></FlashUtilSpec>
@@ -331,6 +331,7 @@
             <vShortWch>1</vShortWch>
             <v6Lto>0</v6Lto>
             <v6WtE>0</v6WtE>
+            <v6Rtti>0</v6Rtti>
             <VariousControls>
               <MiscControls></MiscControls>
               <Define></Define>
@@ -348,6 +349,7 @@
             <NoWarn>0</NoWarn>
             <uSurpInc>0</uSurpInc>
             <useXO>0</useXO>
+            <uClangAs>0</uClangAs>
             <VariousControls>
               <MiscControls>--no_hide_all</MiscControls>
               <Define></Define>
@@ -480,6 +482,7 @@
                     <NoWarn>2</NoWarn>
                     <uSurpInc>2</uSurpInc>
                     <useXO>2</useXO>
+                    <uClangAs>2</uClangAs>
                     <VariousControls>
                       <MiscControls></MiscControls>
                       <Define></Define>
@@ -522,6 +525,7 @@
                     <NoWarn>2</NoWarn>
                     <uSurpInc>2</uSurpInc>
                     <useXO>2</useXO>
+                    <uClangAs>2</uClangAs>
                     <VariousControls>
                       <MiscControls></MiscControls>
                       <Define></Define>
@@ -544,12 +548,12 @@
       <ToolsetNumber>0x4</ToolsetNumber>
       <ToolsetName>ARM-ADS</ToolsetName>
       <pArmCC>6050000::V6.5::.\ARMCLANG_6.5</pArmCC>
-      <pCCUsed>6050000::V6.5::.\ARMCLANG_6.5</pCCUsed>
+      <pCCUsed>6050000::V6.5::.\ARMCLANG</pCCUsed>
       <TargetOption>
         <TargetCommonOption>
           <Device>ARMCM3</Device>
           <Vendor>ARM</Vendor>
-          <PackID>ARM.CMSIS.5.0.0</PackID>
+          <PackID>ARM.CMSIS.5.0.0-Beta12</PackID>
           <PackURL>http://www.keil.com/pack/</PackURL>
           <Cpu>IRAM(0x20000000,0x00020000) IROM(0x00000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ESEL ELITTLE</Cpu>
           <FlashUtilSpec></FlashUtilSpec>
@@ -864,6 +868,7 @@
             <vShortWch>1</vShortWch>
             <v6Lto>0</v6Lto>
             <v6WtE>0</v6WtE>
+            <v6Rtti>0</v6Rtti>
             <VariousControls>
               <MiscControls></MiscControls>
               <Define></Define>
@@ -881,6 +886,7 @@
             <NoWarn>0</NoWarn>
             <uSurpInc>0</uSurpInc>
             <useXO>0</useXO>
+            <uClangAs>0</uClangAs>
             <VariousControls>
               <MiscControls>--no_hide_all</MiscControls>
               <Define></Define>
@@ -1008,6 +1014,7 @@
                     <NoWarn>2</NoWarn>
                     <uSurpInc>2</uSurpInc>
                     <useXO>2</useXO>
+                    <uClangAs>2</uClangAs>
                     <VariousControls>
                       <MiscControls></MiscControls>
                       <Define></Define>
@@ -1055,6 +1062,7 @@
                     <NoWarn>2</NoWarn>
                     <uSurpInc>2</uSurpInc>
                     <useXO>2</useXO>
+                    <uClangAs>2</uClangAs>
                     <VariousControls>
                       <MiscControls></MiscControls>
                       <Define></Define>
@@ -1077,12 +1085,12 @@
       <ToolsetNumber>0x4</ToolsetNumber>
       <ToolsetName>ARM-ADS</ToolsetName>
       <pArmCC>6050000::V6.5::.\ARMCLANG_6.5</pArmCC>
-      <pCCUsed>6050000::V6.5::.\ARMCLANG_6.5</pCCUsed>
+      <pCCUsed>6050000::V6.5::.\ARMCLANG</pCCUsed>
       <TargetOption>
         <TargetCommonOption>
           <Device>ARMCM4_FP</Device>
           <Vendor>ARM</Vendor>
-          <PackID>ARM.CMSIS.5.0.0</PackID>
+          <PackID>ARM.CMSIS.5.0.0-Beta12</PackID>
           <PackURL>http://www.keil.com/pack/</PackURL>
           <Cpu>IRAM(0x20000000,0x00020000) IROM(0x00000000,0x00040000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE</Cpu>
           <FlashUtilSpec></FlashUtilSpec>
@@ -1397,6 +1405,7 @@
             <vShortWch>1</vShortWch>
             <v6Lto>0</v6Lto>
             <v6WtE>0</v6WtE>
+            <v6Rtti>0</v6Rtti>
             <VariousControls>
               <MiscControls></MiscControls>
               <Define></Define>
@@ -1414,6 +1423,7 @@
             <NoWarn>0</NoWarn>
             <uSurpInc>0</uSurpInc>
             <useXO>0</useXO>
+            <uClangAs>0</uClangAs>
             <VariousControls>
               <MiscControls>--no_hide_all</MiscControls>
               <Define></Define>
@@ -1541,6 +1551,7 @@
                     <NoWarn>2</NoWarn>
                     <uSurpInc>2</uSurpInc>
                     <useXO>2</useXO>
+                    <uClangAs>2</uClangAs>
                     <VariousControls>
                       <MiscControls></MiscControls>
                       <Define></Define>
@@ -1583,6 +1594,7 @@
                     <NoWarn>2</NoWarn>
                     <uSurpInc>2</uSurpInc>
                     <useXO>2</useXO>
+                    <uClangAs>2</uClangAs>
                     <VariousControls>
                       <MiscControls></MiscControls>
                       <Define></Define>

BIN
CMSIS/RTOS2/RTX/Library/ARM/RTX_CM0.lib


BIN
CMSIS/RTOS2/RTX/Library/ARM/RTX_CM3.lib


BIN
CMSIS/RTOS2/RTX/Library/ARM/RTX_CM4F.lib


+ 3 - 3
CMSIS/RTOS2/RTX/Library/GCC/MDK/RTX_CM.uvprojx

@@ -16,7 +16,7 @@
         <TargetCommonOption>
           <Device>ARMCM0</Device>
           <Vendor>ARM</Vendor>
-          <PackID>ARM.CMSIS.5.0.0</PackID>
+          <PackID>ARM.CMSIS.5.0.0-Beta12</PackID>
           <PackURL>http://www.keil.com/pack/</PackURL>
           <Cpu>IRAM(0x20000000,0x00020000) IROM(0x00000000,0x00040000) CPUTYPE("Cortex-M0") CLOCK(12000000) ESEL ELITTLE</Cpu>
           <FlashUtilSpec></FlashUtilSpec>
@@ -432,7 +432,7 @@
         <TargetCommonOption>
           <Device>ARMCM3</Device>
           <Vendor>ARM</Vendor>
-          <PackID>ARM.CMSIS.5.0.0</PackID>
+          <PackID>ARM.CMSIS.5.0.0-Beta12</PackID>
           <PackURL>http://www.keil.com/pack/</PackURL>
           <Cpu>IRAM(0x20000000,0x00020000) IROM(0x00000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ESEL ELITTLE</Cpu>
           <FlashUtilSpec></FlashUtilSpec>
@@ -895,7 +895,7 @@
         <TargetCommonOption>
           <Device>ARMCM4_FP</Device>
           <Vendor>ARM</Vendor>
-          <PackID>ARM.CMSIS.5.0.0</PackID>
+          <PackID>ARM.CMSIS.5.0.0-Beta12</PackID>
           <PackURL>http://www.keil.com/pack/</PackURL>
           <Cpu>IRAM(0x20000000,0x00020000) IROM(0x00000000,0x00040000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE</Cpu>
           <FlashUtilSpec></FlashUtilSpec>

BIN
CMSIS/RTOS2/RTX/Library/GCC/libRTX_CM0.a


BIN
CMSIS/RTOS2/RTX/Library/GCC/libRTX_CM3.a


BIN
CMSIS/RTOS2/RTX/Library/GCC/libRTX_CM4F.a


+ 2 - 2
CMSIS/RTOS2/RTX/Source/rtx_evflags.c

@@ -193,7 +193,7 @@ osEventFlagsId_t os_svcEventFlagsNew (const osEventFlagsAttr_t *attr) {
     if (os_Info.mpi.event_flags != NULL) {
       ef = os_MemoryPoolAlloc(os_Info.mpi.event_flags);
     } else {
-      ef = os_MemoryAlloc(os_Info.mem.cb, sizeof(os_event_flags_t));
+      ef = os_MemoryAlloc(os_Info.mem.common, sizeof(os_event_flags_t));
     }
     if (ef == NULL) {
       return (osEventFlagsId_t)NULL;
@@ -386,7 +386,7 @@ osStatus_t os_svcEventFlagsDelete (osEventFlagsId_t ef_id) {
     if (os_Info.mpi.event_flags != NULL) {
       os_MemoryPoolFree(os_Info.mpi.event_flags, ef);
     } else {
-      os_MemoryFree(os_Info.mem.cb, ef);
+      os_MemoryFree(os_Info.mem.common, ef);
     }
   }
 

+ 9 - 9
CMSIS/RTOS2/RTX/Source/rtx_kernel.c

@@ -120,20 +120,20 @@ osStatus_t os_svcKernelInitialize (void) {
   if (os_MemoryInit(os_Config.mem.common_addr, os_Config.mem.common_size) != 0U) {
     os_Info.mem.common = os_Config.mem.common_addr;
   }
-  if (os_MemoryInit(os_Config.mem.cb_addr, os_Config.mem.cb_size) != 0U) {
-    os_Info.mem.cb = os_Config.mem.cb_addr;
+  if (os_MemoryInit(os_Config.mem.stack_addr, os_Config.mem.stack_size) != 0U) {
+    os_Info.mem.stack = os_Config.mem.stack_addr;
   } else {
-    os_Info.mem.cb = os_Info.mem.common;
+    os_Info.mem.stack = os_Info.mem.common;
   }
-  if (os_MemoryInit(os_Config.mem.data_addr, os_Config.mem.data_size) != 0U) {
-    os_Info.mem.data = os_Config.mem.data_addr;
+  if (os_MemoryInit(os_Config.mem.mp_data_addr, os_Config.mem.mp_data_size) != 0U) {
+    os_Info.mem.mp_data = os_Config.mem.mp_data_addr;
   } else {
-    os_Info.mem.data = os_Info.mem.common;
+    os_Info.mem.mp_data = os_Info.mem.common;
   }
-  if (os_MemoryInit(os_Config.mem.stack_addr, os_Config.mem.stack_size) != 0U) {
-    os_Info.mem.stack = os_Config.mem.stack_addr;
+  if (os_MemoryInit(os_Config.mem.mq_data_addr, os_Config.mem.mq_data_size) != 0U) {
+    os_Info.mem.mq_data = os_Config.mem.mq_data_addr;
   } else {
-    os_Info.mem.stack = os_Info.mem.common;
+    os_Info.mem.mq_data = os_Info.mem.common;
   }
 
   // Initialize Memory Pools (Fixed Block Size)

+ 5 - 5
CMSIS/RTOS2/RTX/Source/rtx_mempool.c

@@ -281,7 +281,7 @@ osMemoryPoolId_t os_svcMemoryPoolNew (uint32_t block_count, uint32_t block_size,
     if (os_Info.mpi.memory_pool != NULL) {
       mp = os_MemoryPoolAlloc(os_Info.mpi.memory_pool);
     } else {
-      mp = os_MemoryAlloc(os_Info.mem.cb, sizeof(os_memory_pool_t));
+      mp = os_MemoryAlloc(os_Info.mem.common, sizeof(os_memory_pool_t));
     }
     if (mp == NULL) {
       return (osMemoryPoolId_t)NULL;
@@ -293,13 +293,13 @@ osMemoryPoolId_t os_svcMemoryPoolNew (uint32_t block_count, uint32_t block_size,
 
   // Allocate data memory if not provided
   if (mp_mem == NULL) {
-    mp_mem = os_MemoryAlloc(os_Info.mem.data, size);
+    mp_mem = os_MemoryAlloc(os_Info.mem.mp_data, size);
     if (mp_mem == NULL) {
       if (flags & os_FlagSystemObject) {
         if (os_Info.mpi.memory_pool != NULL) {
           os_MemoryPoolFree(os_Info.mpi.memory_pool, mp);
         } else {
-          os_MemoryFree(os_Info.mem.cb, mp);
+          os_MemoryFree(os_Info.mem.common, mp);
         }
       }
       return (osMemoryPoolId_t)NULL;
@@ -496,7 +496,7 @@ osStatus_t os_svcMemoryPoolDelete (osMemoryPoolId_t mp_id) {
 
   // Free data memory
   if (mp->flags & os_FlagSystemMemory) {
-    os_MemoryFree(os_Info.mem.data, mp->mp_info.block_base);
+    os_MemoryFree(os_Info.mem.mp_data, mp->mp_info.block_base);
   }
 
   // Free object memory
@@ -504,7 +504,7 @@ osStatus_t os_svcMemoryPoolDelete (osMemoryPoolId_t mp_id) {
     if (os_Info.mpi.memory_pool != NULL) {
       os_MemoryPoolFree(os_Info.mpi.memory_pool, mp);
     } else {
-      os_MemoryFree(os_Info.mem.cb, mp);
+      os_MemoryFree(os_Info.mem.common, mp);
     }
   }
 

+ 5 - 5
CMSIS/RTOS2/RTX/Source/rtx_msgqueue.c

@@ -291,7 +291,7 @@ osMessageQueueId_t os_svcMessageQueueNew (uint32_t msg_count, uint32_t msg_size,
     if (os_Info.mpi.message_queue != NULL) {
       mq = os_MemoryPoolAlloc(os_Info.mpi.message_queue);
     } else {
-      mq = os_MemoryAlloc(os_Info.mem.cb, sizeof(os_message_queue_t));
+      mq = os_MemoryAlloc(os_Info.mem.common, sizeof(os_message_queue_t));
     }
     if (mq == NULL) {
       return (osMessageQueueId_t)NULL;
@@ -303,13 +303,13 @@ osMessageQueueId_t os_svcMessageQueueNew (uint32_t msg_count, uint32_t msg_size,
 
   // Allocate data memory if not provided
   if (mq_mem == NULL) {
-    mq_mem = os_MemoryAlloc(os_Info.mem.data, size);
+    mq_mem = os_MemoryAlloc(os_Info.mem.mq_data, size);
     if (mq_mem == NULL) {
       if (flags & os_FlagSystemObject) {
         if (os_Info.mpi.message_queue != NULL) {
           os_MemoryPoolFree(os_Info.mpi.message_queue, mq);
         } else {
-          os_MemoryFree(os_Info.mem.cb, mq);
+          os_MemoryFree(os_Info.mem.common, mq);
         }
       }
       return (osMessageQueueId_t)NULL;
@@ -632,7 +632,7 @@ osStatus_t os_svcMessageQueueDelete (osMessageQueueId_t mq_id) {
 
   // Free data memory
   if (mq->flags & os_FlagSystemMemory) {
-    os_MemoryFree(os_Info.mem.data, mq->mp_info.block_base);
+    os_MemoryFree(os_Info.mem.mq_data, mq->mp_info.block_base);
   }
 
   // Free object memory
@@ -640,7 +640,7 @@ osStatus_t os_svcMessageQueueDelete (osMessageQueueId_t mq_id) {
     if (os_Info.mpi.message_queue != NULL) {
       os_MemoryPoolFree(os_Info.mpi.message_queue, mq);
     } else {
-      os_MemoryFree(os_Info.mem.cb, mq);
+      os_MemoryFree(os_Info.mem.common, mq);
     }
   }
 

+ 2 - 2
CMSIS/RTOS2/RTX/Source/rtx_mutex.c

@@ -102,7 +102,7 @@ osMutexId_t os_svcMutexNew (const osMutexAttr_t *attr) {
     if (os_Info.mpi.mutex != NULL) {
       mutex = os_MemoryPoolAlloc(os_Info.mpi.mutex);
     } else {
-      mutex = os_MemoryAlloc(os_Info.mem.cb, sizeof(os_mutex_t));
+      mutex = os_MemoryAlloc(os_Info.mem.common, sizeof(os_mutex_t));
     }
     if (mutex == NULL) {
       return (osMutexId_t)NULL;
@@ -363,7 +363,7 @@ osStatus_t os_svcMutexDelete (osMutexId_t mutex_id) {
     if (os_Info.mpi.mutex != NULL) {
       os_MemoryPoolFree(os_Info.mpi.mutex, mutex);
     } else {
-      os_MemoryFree(os_Info.mem.cb, mutex);
+      os_MemoryFree(os_Info.mem.common, mutex);
     }
   }
 

+ 2 - 2
CMSIS/RTOS2/RTX/Source/rtx_semaphore.c

@@ -163,7 +163,7 @@ osSemaphoreId_t os_svcSemaphoreNew (uint32_t max_count, uint32_t initial_count,
     if (os_Info.mpi.semaphore != NULL) {
       semaphore = os_MemoryPoolAlloc(os_Info.mpi.semaphore);
     } else {
-      semaphore = os_MemoryAlloc(os_Info.mem.cb, sizeof(os_semaphore_t));
+      semaphore = os_MemoryAlloc(os_Info.mem.common, sizeof(os_semaphore_t));
     }
     if (semaphore == NULL) {
       return (osSemaphoreId_t)NULL;
@@ -305,7 +305,7 @@ osStatus_t os_svcSemaphoreDelete (osSemaphoreId_t semaphore_id) {
     if (os_Info.mpi.semaphore != NULL) {
       os_MemoryPoolFree(os_Info.mpi.semaphore, semaphore);
     } else {
-      os_MemoryFree(os_Info.mem.cb, semaphore);
+      os_MemoryFree(os_Info.mem.common, semaphore);
     }
   }
 

+ 4 - 4
CMSIS/RTOS2/RTX/Source/rtx_thread.c

@@ -443,7 +443,7 @@ bool os_ThreadWaitEnter (uint8_t state, uint32_t millisec) {
 }
 
 /// Check current running Thread Stack.
-void os_ThreadStackCheck (void) {
+__WEAK void os_ThreadStackCheck (void) {
   os_thread_t *thread;
 
   thread = os_ThreadGetRunning();
@@ -558,7 +558,7 @@ osThreadId_t os_svcThreadNew (os_thread_func_t func, void *argument, const osThr
     if (os_Info.mpi.thread != NULL) {
       thread = os_MemoryPoolAlloc(os_Info.mpi.thread);
     } else {
-      thread = os_MemoryAlloc(os_Info.mem.cb, sizeof(os_thread_t));
+      thread = os_MemoryAlloc(os_Info.mem.common, sizeof(os_thread_t));
     }
     if (thread == NULL) {
       return (osThreadId_t)NULL;
@@ -587,7 +587,7 @@ osThreadId_t os_svcThreadNew (os_thread_func_t func, void *argument, const osThr
         if (os_Info.mpi.thread != NULL) {
           os_MemoryPoolFree(os_Info.mpi.thread, thread);
         } else {
-          os_MemoryFree(os_Info.mem.cb, thread);
+          os_MemoryFree(os_Info.mem.common, thread);
         }
       }
       return (osThreadId_t)NULL;
@@ -851,7 +851,7 @@ static void os_ThreadFree (os_thread_t *thread) {
     if (os_Info.mpi.thread != NULL) {
       os_MemoryPoolFree(os_Info.mpi.thread, thread);
     } else {
-      os_MemoryFree(os_Info.mem.cb, thread);
+      os_MemoryFree(os_Info.mem.common, thread);
     }
   }
 }

+ 2 - 2
CMSIS/RTOS2/RTX/Source/rtx_timer.c

@@ -196,7 +196,7 @@ osTimerId_t os_svcTimerNew (os_timer_func_t func, osTimerType_t type, void *argu
     if (os_Info.mpi.timer != NULL) {
       timer = os_MemoryPoolAlloc(os_Info.mpi.timer);
     } else {
-      timer = os_MemoryAlloc(os_Info.mem.cb, sizeof(os_timer_t));
+      timer = os_MemoryAlloc(os_Info.mem.common, sizeof(os_timer_t));
     }
     if (timer == NULL) {
       return (osTimerId_t)NULL;
@@ -328,7 +328,7 @@ osStatus_t os_svcTimerDelete (osTimerId_t timer_id) {
     if (os_Info.mpi.timer != NULL) {
       os_MemoryPoolFree(os_Info.mpi.timer, timer);
     } else {
-      os_MemoryFree(os_Info.mem.cb, timer);
+      os_MemoryFree(os_Info.mem.common, timer);
     }
   }