Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit f445e62

Browse files
DomenGosekRobertRostohar
authored andcommitted
Synchronize Middleware USB Device/MassStorage example with CMSIS 6
1 parent fdc9384 commit f445e62

File tree

8 files changed

+223
-193
lines changed

8 files changed

+223
-193
lines changed

Projects/Middleware/USB/Device/MassStorage/Abstract.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ The program is available in different targets:
1515

1616
- Debug:
1717
- Compiler: ARM Compiler optimization Level 1
18-
- Compiler:Event Recorder: Enabled
19-
- CMSIS:RTOS2:Keil RTX5: Source
18+
- CMSIS-View:Event Recorder: Enabled
2019
- USB:CORE: Debug
2120

2221
- Release:
2322
- Compiler: ARM Compiler optimization Level 3
24-
- Compiler:Event Recorder: Disabled
25-
- CMSIS:RTOS2:Keil RTX5: Library
23+
- CMSIS-View:Event Recorder: Disabled
2624
- USB:CORE: Release

Projects/Middleware/USB/Device/MassStorage/MassStorage.uvoptx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -162,23 +162,23 @@
162162
</Ww>
163163
</WatchWindow1>
164164
<ScvdPack>
165-
<Filename>C:\ARM\PACK\ARM\CMSIS\5.9.0\CMSIS\Driver\VIO\cmsis_vio.scvd</Filename>
166-
<Type>ARM.CMSIS.5.9.0</Type>
165+
<Filename>C:\PACK\ARM\CMSIS-RTX\5.8.0\RTX5.scvd</Filename>
166+
<Type>ARM::CMSIS-RTX@5.8.0</Type>
167167
<SubType>1</SubType>
168168
</ScvdPack>
169169
<ScvdPack>
170-
<Filename>C:\ARM\PACK\ARM\CMSIS\5.9.0\CMSIS\RTOS2\RTX\RTX5.scvd</Filename>
171-
<Type>ARM.CMSIS.5.9.0</Type>
170+
<Filename>C:\PACK\ARM\CMSIS-View\1.1.0\EventRecorder\EventRecorder.scvd</Filename>
171+
<Type>ARM::CMSIS-View@1.1.0</Type>
172172
<SubType>1</SubType>
173173
</ScvdPack>
174174
<ScvdPack>
175-
<Filename>C:\ARM\PACK\Keil\ARM_Compiler\1.7.2\EventRecorder.scvd</Filename>
176-
<Type>Keil.ARM_Compiler.1.7.2</Type>
175+
<Filename>C:\PACK\Keil\MDK-Middleware\7.17.0\USB\USB.scvd</Filename>
176+
<Type>Keil::MDK-Middleware@7.17.0</Type>
177177
<SubType>1</SubType>
178178
</ScvdPack>
179179
<ScvdPack>
180-
<Filename>C:\ARM\PACK\Keil\MDK-Middleware\7.16.0\USB\USB.scvd</Filename>
181-
<Type>Keil.MDK-Middleware.7.16.0</Type>
180+
<Filename>C:\PACK\ARM\CMSIS\6.0.0\CMSIS\Driver\VIO\cmsis_vio.scvd</Filename>
181+
<Type>ARM::CMSIS@6.0.0</Type>
182182
<SubType>1</SubType>
183183
</ScvdPack>
184184
<Tracepoint>
@@ -348,18 +348,18 @@
348348
</TargetDriverDllRegistry>
349349
<Breakpoint/>
350350
<ScvdPack>
351-
<Filename>C:\ARM\PACK\ARM\CMSIS\5.9.0\CMSIS\Driver\VIO\cmsis_vio.scvd</Filename>
352-
<Type>ARM.CMSIS.5.9.0</Type>
351+
<Filename>C:\PACK\ARM\CMSIS\6.0.0\CMSIS\Driver\VIO\cmsis_vio.scvd</Filename>
352+
<Type>ARM::CMSIS@6.0.0</Type>
353353
<SubType>1</SubType>
354354
</ScvdPack>
355355
<ScvdPack>
356-
<Filename>C:\ARM\PACK\ARM\CMSIS\5.9.0\CMSIS\RTOS2\RTX\RTX5.scvd</Filename>
357-
<Type>ARM.CMSIS.5.9.0</Type>
356+
<Filename>C:\PACK\Keil\MDK-Middleware\7.17.0\USB\USB.scvd</Filename>
357+
<Type>Keil::MDK-Middleware@7.17.0</Type>
358358
<SubType>1</SubType>
359359
</ScvdPack>
360360
<ScvdPack>
361-
<Filename>C:\ARM\PACK\Keil\MDK-Middleware\7.16.0\USB\USB.scvd</Filename>
362-
<Type>Keil.MDK-Middleware.7.16.0</Type>
361+
<Filename>C:\PACK\ARM\CMSIS-RTX\5.8.0\RTX5.scvd</Filename>
362+
<Type>ARM::CMSIS-RTX@5.8.0</Type>
363363
<SubType>1</SubType>
364364
</ScvdPack>
365365
<Tracepoint>
@@ -559,7 +559,7 @@
559559
</Group>
560560

561561
<Group>
562-
<GroupName>::Compiler</GroupName>
562+
<GroupName>::CMSIS-View</GroupName>
563563
<tvExp>0</tvExp>
564564
<tvExpOptDlg>0</tvExpOptDlg>
565565
<cbSel>0</cbSel>

Projects/Middleware/USB/Device/MassStorage/MassStorage.uvprojx

Lines changed: 87 additions & 75 deletions
Large diffs are not rendered by default.

Projects/Middleware/USB/Device/MassStorage/RTE/Compiler/EventRecorderConf.h renamed to Projects/Middleware/USB/Device/MassStorage/RTE/CMSIS-View/EventRecorderConf.h

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
/*------------------------------------------------------------------------------
2-
* MDK - Component ::Event Recorder
3-
* Copyright (c) 2016-2018 ARM Germany GmbH. All rights reserved.
4-
*------------------------------------------------------------------------------
1+
/*
2+
* Copyright (c) 2016-2021 Arm Limited. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the License); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
14+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
518
* Name: EventRecorderConf.h
6-
* Purpose: Event Recorder Configuration
19+
* Purpose: Event Recorder software component configuration options
720
* Rev.: V1.1.0
8-
*----------------------------------------------------------------------------*/
21+
*/
922

1023
//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
1124

Projects/Middleware/USB/Device/MassStorage/RTE/CMSIS/RTX_Config.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013-2021 Arm Limited. All rights reserved.
2+
* Copyright (c) 2013-2023 Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -17,7 +17,7 @@
1717
*
1818
* -----------------------------------------------------------------------------
1919
*
20-
* $Revision: V5.1.1
20+
* $Revision: V5.2.0
2121
*
2222
* Project: CMSIS-RTOS RTX
2323
* Title: RTX Configuration
@@ -55,6 +55,9 @@ __WEAK uint32_t osRtxErrorNotify (uint32_t code, void *object_id) {
5555
case osRtxErrorClibMutex:
5656
// Standard C/C++ library mutex initialization failed
5757
break;
58+
case osRtxErrorSVC:
59+
// Invalid SVC function called (function=object_id)
60+
break;
5861
default:
5962
// Reserved
6063
break;

Projects/Middleware/USB/Device/MassStorage/RTE/CMSIS/RTX_Config.h

Lines changed: 87 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013-2021 Arm Limited. All rights reserved.
2+
* Copyright (c) 2013-2023 Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -17,7 +17,7 @@
1717
*
1818
* -----------------------------------------------------------------------------
1919
*
20-
* $Revision: V5.5.2
20+
* $Revision: V5.6.0
2121
*
2222
* Project: CMSIS-RTOS RTX
2323
* Title: RTX Configuration definitions
@@ -73,6 +73,61 @@
7373

7474
// </e>
7575

76+
// <e>Safety features (Source variant only)
77+
// <i> Enables FuSa related features.
78+
// <i> Requires RTX Source variant.
79+
// <i> Enables:
80+
// <i> - selected features from this group
81+
// <i> - Thread functions: osThreadProtectPrivileged
82+
#ifndef OS_SAFETY_FEATURES
83+
#define OS_SAFETY_FEATURES 0
84+
#endif
85+
86+
// <q>Safety Class
87+
// <i> Threads assigned to lower classes cannot modify higher class threads.
88+
// <i> Enables:
89+
// <i> - Object attributes: osSafetyClass
90+
// <i> - Kernel functions: osKernelProtect, osKernelDestroyClass
91+
// <i> - Thread functions: osThreadGetClass, osThreadSuspendClass, osThreadResumeClass
92+
#ifndef OS_SAFETY_CLASS
93+
#define OS_SAFETY_CLASS 1
94+
#endif
95+
96+
// <q>MPU Protected Zone
97+
// <i> Access protection via MPU (Spatial isolation).
98+
// <i> Enables:
99+
// <i> - Thread attributes: osThreadZone
100+
// <i> - Thread functions: osThreadGetZone, osThreadTerminateZone
101+
// <i> - Zone Management: osZoneSetup_Callback
102+
#ifndef OS_EXECUTION_ZONE
103+
#define OS_EXECUTION_ZONE 1
104+
#endif
105+
106+
// <q>Thread Watchdog
107+
// <i> Watchdog alerts ensure timing for critical threads (Temporal isolation).
108+
// <i> Enables:
109+
// <i> - Thread functions: osThreadFeedWatchdog
110+
// <i> - Handler functions: osWatchdogAlarm_Handler
111+
#ifndef OS_THREAD_WATCHDOG
112+
#define OS_THREAD_WATCHDOG 1
113+
#endif
114+
115+
// <q>Object Pointer checking
116+
// <i> Check object pointer alignment and memory region.
117+
#ifndef OS_OBJ_PTR_CHECK
118+
#define OS_OBJ_PTR_CHECK 0
119+
#endif
120+
121+
// <q>SVC Function Pointer checking
122+
// <i> Check SVC function pointer alignment and memory region.
123+
// <i> User needs to define a linker execution region RTX_SVC_VENEERS
124+
// <i> containing input sections: rtx_*.o (.text.os.svc.veneer.*)
125+
#ifndef OS_SVC_PTR_CHECK
126+
#define OS_SVC_PTR_CHECK 0
127+
#endif
128+
129+
// </e>
130+
76131
// <o>ISR FIFO Queue
77132
// <4=> 4 entries <8=> 8 entries <12=> 12 entries <16=> 16 entries
78133
// <24=> 24 entries <32=> 32 entries <48=> 48 entries <64=> 64 entries
@@ -146,6 +201,20 @@
146201
#define OS_IDLE_THREAD_TZ_MOD_ID 0
147202
#endif
148203

204+
// <o>Idle Thread Safety Class <0-15>
205+
// <i> Defines the Safety Class number.
206+
// <i> Default: 0
207+
#ifndef OS_IDLE_THREAD_CLASS
208+
#define OS_IDLE_THREAD_CLASS 0
209+
#endif
210+
211+
// <o>Idle Thread Zone <0-127>
212+
// <i> Defines Thread Zone.
213+
// <i> Default: 0
214+
#ifndef OS_IDLE_THREAD_ZONE
215+
#define OS_IDLE_THREAD_ZONE 0
216+
#endif
217+
149218
// <q>Stack overrun checking
150219
// <i> Enables stack overrun check at thread switch (requires RTX source variant).
151220
// <i> Enabling this option increases slightly the execution time of a thread switch.
@@ -160,10 +229,10 @@
160229
#define OS_STACK_WATERMARK 0
161230
#endif
162231

163-
// <o>Processor mode for Thread execution
232+
// <o>Default Processor mode for Thread execution
164233
// <0=> Unprivileged mode
165234
// <1=> Privileged mode
166-
// <i> Default: Privileged mode
235+
// <i> Default: Unprivileged mode
167236
#ifndef OS_PRIVILEGE_MODE
168237
#define OS_PRIVILEGE_MODE 1
169238
#endif
@@ -215,6 +284,20 @@
215284
#define OS_TIMER_THREAD_TZ_MOD_ID 0
216285
#endif
217286

287+
// <o>Timer Thread Safety Class <0-15>
288+
// <i> Defines the Safety Class number.
289+
// <i> Default: 0
290+
#ifndef OS_TIMER_THREAD_CLASS
291+
#define OS_TIMER_THREAD_CLASS 0
292+
#endif
293+
294+
// <o>Timer Thread Zone <0-127>
295+
// <i> Defines Thread Zone.
296+
// <i> Default: 0
297+
#ifndef OS_TIMER_THREAD_ZONE
298+
#define OS_TIMER_THREAD_ZONE 0
299+
#endif
300+
218301
// <o>Timer Callback Queue entries <0-256>
219302
// <i> Number of concurrent active timer callback functions.
220303
// <i> May be set to 0 when timers are not used.

Projects/Middleware/USB/Device/MassStorage/RTE/USB/USBD_Config_0.c

Lines changed: 5 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*------------------------------------------------------------------------------
22
* MDK Middleware - Component ::USB:Device
3-
* Copyright (c) 2004-2019 Arm Limited (or its affiliates). All rights reserved.
3+
* Copyright (c) 2004-2023 Arm Limited (or its affiliates). All rights reserved.
44
*------------------------------------------------------------------------------
55
* Name: USBD_Config_0.c
66
* Purpose: USB Device Configuration
7-
* Rev.: V5.2.0
7+
* Rev.: V5.3.0
88
*------------------------------------------------------------------------------
99
* Use the following configuration settings in the Device Class configuration
1010
* files to assign a Device Class to this USB Device 0.
@@ -71,11 +71,11 @@
7171

7272
// <s.126>Manufacturer String
7373
// <i>String Descriptor describing Manufacturer.
74-
#define USBD0_STR_DESC_MAN L"Keil Software"
74+
#define USBD0_STR_DESC_MAN_RAW "Keil Software"
7575

7676
// <s.126>Product String
7777
// <i>String Descriptor describing Product.
78-
#define USBD0_STR_DESC_PROD L"Keil USB Device 0"
78+
#define USBD0_STR_DESC_PROD_RAW "Keil USB Device 0"
7979

8080
// <e.0>Serial Number String
8181
// <i>Enable Serial Number String.
@@ -84,7 +84,7 @@
8484

8585
// <s.126>Default value
8686
// <i>Default device's Serial Number String.
87-
#define USBD0_STR_DESC_SER L"0001A0000000"
87+
#define USBD0_STR_DESC_SER_RAW "0001A0000000"
8888

8989
// <o.0..7>Maximum Length (in characters) <0-126>
9090
// <i>Specifies the maximum number of Serial Number String characters that can be set at run-time.
@@ -124,83 +124,4 @@
124124
// </h>
125125

126126

127-
#include "RTE_Components.h"
128-
129-
#ifdef RTE_USB_Device_CustomClass_0
130-
#include "USBD_Config_CustomClass_0.h"
131-
#endif
132-
#ifdef RTE_USB_Device_CustomClass_1
133-
#include "USBD_Config_CustomClass_1.h"
134-
#endif
135-
#ifdef RTE_USB_Device_CustomClass_2
136-
#include "USBD_Config_CustomClass_2.h"
137-
#endif
138-
#ifdef RTE_USB_Device_CustomClass_3
139-
#include "USBD_Config_CustomClass_3.h"
140-
#endif
141-
142-
#ifdef RTE_USB_Device_HID_0
143-
#include "USBD_Config_HID_0.h"
144-
#endif
145-
#ifdef RTE_USB_Device_HID_1
146-
#include "USBD_Config_HID_1.h"
147-
#endif
148-
#ifdef RTE_USB_Device_HID_2
149-
#include "USBD_Config_HID_2.h"
150-
#endif
151-
#ifdef RTE_USB_Device_HID_3
152-
#include "USBD_Config_HID_3.h"
153-
#endif
154-
155-
#ifdef RTE_USB_Device_MSC_0
156-
#include "USBD_Config_MSC_0.h"
157-
#endif
158-
#ifdef RTE_USB_Device_MSC_1
159-
#include "USBD_Config_MSC_1.h"
160-
#endif
161-
#ifdef RTE_USB_Device_MSC_2
162-
#include "USBD_Config_MSC_2.h"
163-
#endif
164-
#ifdef RTE_USB_Device_MSC_3
165-
#include "USBD_Config_MSC_3.h"
166-
#endif
167-
168-
#ifdef RTE_USB_Device_CDC_0
169-
#include "USBD_Config_CDC_0.h"
170-
#endif
171-
#ifdef RTE_USB_Device_CDC_1
172-
#include "USBD_Config_CDC_1.h"
173-
#endif
174-
#ifdef RTE_USB_Device_CDC_2
175-
#include "USBD_Config_CDC_2.h"
176-
#endif
177-
#ifdef RTE_USB_Device_CDC_3
178-
#include "USBD_Config_CDC_3.h"
179-
#endif
180-
#ifdef RTE_USB_Device_CDC_4
181-
#include "USBD_Config_CDC_4.h"
182-
#endif
183-
#ifdef RTE_USB_Device_CDC_5
184-
#include "USBD_Config_CDC_5.h"
185-
#endif
186-
#ifdef RTE_USB_Device_CDC_6
187-
#include "USBD_Config_CDC_6.h"
188-
#endif
189-
#ifdef RTE_USB_Device_CDC_7
190-
#include "USBD_Config_CDC_7.h"
191-
#endif
192-
193-
#ifdef RTE_USB_Device_ADC_0
194-
#include "USBD_Config_ADC_0.h"
195-
#endif
196-
#ifdef RTE_USB_Device_ADC_1
197-
#include "USBD_Config_ADC_1.h"
198-
#endif
199-
#ifdef RTE_USB_Device_ADC_2
200-
#include "USBD_Config_ADC_2.h"
201-
#endif
202-
#ifdef RTE_USB_Device_ADC_3
203-
#include "USBD_Config_ADC_3.h"
204-
#endif
205-
206127
#include "usbd_config.h"

0 commit comments

Comments
 (0)