Skip to content

Commit 232e89f

Browse files
committed
Release 6.2.0
1 parent cd55ec7 commit 232e89f

File tree

139 files changed

+3942
-977
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+3942
-977
lines changed

README.md

Lines changed: 69 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,106 +2,105 @@
22

33
A high-performance USB host, device, and on-the-go (OTG) embedded stack, Azure RTOS USBX is fully integrated with Azure RTOS ThreadX and available for all Azure RTOS ThreadX–supported processors. Like Azure RTOS ThreadX, Azure RTOS USBX is designed to have a small footprint and high performance, making it ideal for deeply embedded applications that require an interface with USB devices.
44

5-
## Documentation
5+
Here are the key features and modules of USBX:
66

7-
Documentation for this library can be found here: http://docs.microsoft.com/azure/rtos/usbx
7+
![USBX Key Features](./docs/usbx-features.png)
88

9-
# Understanding inter-component dependencies
9+
## Getting Started
1010

11-
The main components of Azure RTOS are each provided in their own repository, but there are dependencies between them--shown in the following graph--that are important to understand when setting up your builds.
11+
Azure RTOS USBX as part of Azure RTOS has been integrated to the semiconductor's SDKs and development environment. You can develop using the tools of choice from [STMicroelectronics](https://www.st.com/content/st_com/en/campaigns/x-cube-azrtos-azure-rtos-stm32.html), [NXP](https://www.nxp.com/design/software/embedded-software/azure-rtos-for-nxp-microcontrollers:AZURE-RTOS), [Renesas](https://github.com/renesas/azure-rtos) and [Microchip](https://mu.microchip.com/get-started-simplifying-your-iot-design-with-azure-rtos).
1212

13-
![dependency graph](docs/deps.png)
13+
We also provide [samples](https://github.com/azure-rtos/samples) using hero development boards from semiconductors you can build and test with.
1414

15-
# Building and using the library
15+
See [Overview of Azure RTOS USBX](https://learn.microsoft.com/azure/rtos/usbx/overview-usbx) for the high-level overview, and all documentation and APIs can be found in: [Azure RTOS USBX documentation](https://learn.microsoft.com/azure/rtos/usbx/).
1616

17-
## Prerequisites
17+
## Repository Structure and Usage
1818

19-
Install the following tools:
19+
### Directory layout
2020

21-
* [CMake](https://cmake.org/download/) version 3.0 or later
22-
* [GCC compilers for arm-none-eabi](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
23-
* [Ninja](https://ninja-build.org/)
21+
.
22+
├── cmake # CMakeList files for building the project
23+
├── common # Core USBX files
24+
├── ports # Architecture and compiler specific files
25+
├── samples # Sample codes
26+
├── support # Misc platform configurations file used by USBX
27+
├── LICENSE.txt # License terms
28+
├── LICENSE-HARDWARE.txt # Licensed hardware from semiconductors
29+
├── CONTRIBUTING.md # Contribution guidance
30+
└── SECURITY.md # Microsoft repo security guidance
2431

25-
## Cloning the repo
32+
### Branches & Releases
2633

27-
```bash
28-
$ git clone https://github.com/azure-rtos/usbx.git
29-
```
34+
The master branch has the most recent code with all new features and bug fixes. It does not represent the latest General Availability (GA) release of the library. Each official release (preview or GA) will be tagged to mark the commit and push it into the Github releases tab, e.g. `v6.2-rel`.
3035

31-
## Building as a static library
36+
## Component dependencies
3237

33-
Each component of Azure RTOS comes with a composible CMake-based build system that supports many different MCUs and host systems. Integrating any of these components into your device app code is as simple as adding a git submodule and then including it in your build using the CMake command `add_subdirectory()`.
38+
The main components of Azure RTOS are each provided in their own repository, but there are dependencies between them, as shown in the following graph. This is important to understand when setting up your builds.
3439

35-
While the typical usage pattern is to include threadx into your device code source tree to be built & linked with your code, you can compile this project as a standalone static library to confirm your build is set up correctly.
40+
![dependency graph](docs/deps.png)
3641

37-
```bash
38-
$ cmake -Bbuild -DCMAKE_TOOLCHAIN_FILE=cmake/cortex_m4.cmake -GNinja .
42+
> You will have to take the dependency graph above into account when building anything other than ThreadX itself.
3943
40-
$ cmake --build ./build
41-
```
44+
### Building and using the library
4245

43-
NOTE: You will have to take the dependency graph above into account when building anything other than threadx itself.
46+
Instruction for building the USBX as static library using Arm GNU Toolchain and CMake. If you are using toolchain and IDE from semiconductor, you might follow its own instructions to use Azure RTOS components as explained in the [Getting Started](#getting-started) section.
4447

45-
# Repository Structure and Usage
48+
1. Install the following tools:
4649

47-
## Branches & Releases
50+
* [CMake](https://cmake.org/download/) version 3.0 or later
51+
* [Arm GNU Toolchain for arm-none-eabi](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads)
52+
* [Ninja](https://ninja-build.org/)
4853

49-
The master branch has the most recent code with all new features and bug fixes. It does not represent the latest General Availability (GA) release of the library.
54+
1. Build the [ThreadX library](https://github.com/azure-rtos/threadx#building-and-using-the-library) as the dependency.
5055

51-
## Releases
56+
1. Cloning the repo.
5257

53-
Each official release (preview or GA) will be tagged to mark the commit and push it into the Github releases tab, e.g. `v6.0-rel`.
58+
```bash
59+
$ git clone https://github.com/azure-rtos/usbx.git
60+
```
5461

55-
## Directory layout
62+
1. Define the features and addons you need in `ux_user.h` and build together with the component source code. You can refer to [`ux_user_sample.h`](https://github.com/azure-rtos/usbx/blob/master/common/core/inc/ux_user_sample.h) as an example.
5663

57-
```
58-
- cmake
59-
- common
60-
- inc
61-
- src
62-
- ports
63-
- cortex_m0/gnu
64-
- inc
65-
- src
66-
- cortex_m3/gnu
67-
- inc
68-
- src
69-
- cortex_m4/gnu
70-
- inc
71-
- src
72-
- cortex_m7/gnu
73-
- inc
74-
- src
75-
- samples
76-
```
64+
1. Building as a static library
7765

78-
# Security
66+
Each component of Azure RTOS comes with a composable CMake-based build system that supports many different MCUs and host systems. Integrating any of these components into your device app code is as simple as adding a git submodule and then including it in your build using the CMake `add_subdirectory()`.
7967
80-
Azure RTOS provides OEMs with components to secure communication and to create code and data isolation using underlying MCU/MPU hardware protection mechanisms. It is ultimately the responsibility of the device builder to ensure the device fully meets the evolving security requirements associated with its specific use case.
68+
While the typical usage pattern is to include USBX into your device code source tree to be built & linked with your code, you can compile this project as a standalone static library to confirm your build is set up correctly.
69+
70+
An example of building the library for Cortex-M4:
71+
72+
```bash
73+
$ cmake -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE=cmake/cortex_m4.cmake .
74+
75+
$ cmake --build ./build
76+
```
8177

82-
# Licensing
78+
## Professional support
8379

84-
License terms for using Azure RTOS are defined in the LICENSE.txt file of this repo. Please refer to this file for all definitive licensing information. No additional license fees are required for deploying Azure RTOS on hardware defined in the LICENSED-HARDWARE.txt file. If you are using hardware not defined in the LICENSED-HARDWARE.txt file or have licensing questions in general, please contact Microsoft directly at https://aka.ms/azrtos-license.
80+
[Professional support plans](https://azure.microsoft.com/support/options/) are available from Microsoft. For community support and others, see the [Resources](#resources) section below.
8581

86-
# Contribution, feedback, issues, and professional support
82+
## Licensing
8783

88-
If you encounter any bugs, have suggestions for new features, or if you would like to become an active contributor to this project, please follow the instructions provided in the contribution guideline for the corresponding repo.
84+
License terms for using Azure RTOS are defined in the LICENSE.txt file of this repo. Please refer to this file for all definitive licensing information. No additional license fees are required for deploying Azure RTOS on hardware defined in the [LICENSED-HARDWARE.txt](./LICENSED-HARDWARE.txt) file. If you are using hardware not listed in the file or having licensing questions in general, please contact Microsoft directly at https://aka.ms/azrtos-license.
8985

90-
For basic support, click Issues in the command bar or post a question to [Stack Overflow](http://stackoverflow.com/questions/tagged/azure-rtos+threadx) using the `threadx` and `azure-rtos` tags.
86+
## Resources
9187

92-
Professional support plans (https://azure.microsoft.com/en-us/support/options/) are available from Microsoft.
88+
The following are references to additional Azure RTOS resources:
89+
90+
- **Product introduction and white papers**: https://azure.com/rtos
91+
- **General technical questions**: https://aka.ms/QnA/azure-rtos
92+
- **Product issues and bugs, or feature requests**: https://github.com/azure-rtos/usbx/issues
93+
- **Licensing and sales questions**: https://aka.ms/azrtos-license
94+
- **Product roadmap and support policy**: https://aka.ms/azrtos/lts
95+
- **Blogs and videos**: http://msiotblog.com and https://aka.ms/iotshow
96+
- **Azure RTOS TraceX Installer**: https://aka.ms/azrtos-tracex-installer
97+
98+
You can also check [previous questions](https://stackoverflow.com/questions/tagged/azure-rtos+usbx) or ask new ones on StackOverflow using the `azure-rtos` and `usbx` tags.
99+
100+
## Security
101+
102+
Azure RTOS provides OEMs with components to secure communication and to create code and data isolation using underlying MCU/MPU hardware protection mechanisms. It is ultimately the responsibility of the device builder to ensure the device fully meets the evolving security requirements associated with its specific use case.
93103

94-
# Additional Resources
104+
## Contribution
95105

96-
The following are references to additional Azure RTOS and Azure IoT in general:
97-
| Content | Link |
98-
|---|---|
99-
| TraceX Installer | https://aka.ms/azrtos-tracex-installer |
100-
| Azure RTOS Documentation and Guides: | https://docs.microsoft.com/azure/rtos |
101-
| Azure RTOS Website: | https://azure.microsoft.com/services/rtos/ |
102-
| Azure RTOS Sales Questions: | https://aka.ms/azrtos-license |
103-
| Azure RTOS Product Support Policy | https://aka.ms/azrtos/lts |
104-
| Azure RTOS Functional Safety Artifacts | https://aka.ms/azrtos/tuv |
105-
| For technical questions check out Microsoft Q/A for Azure IoT | https://aka.ms/QnA/azure-rtos |
106-
| Internet of Things Show for latest announcements and online training | https://aka.ms/iotshow |
107-
| IoT Tech Community | https://aka.ms/community/azure-rtos |
106+
Please follow the instructions provided in the [CONTRIBUTING.md](./CONTRIBUTING.md) for the corresponding repository.

common/core/inc/ux_api.h

100755100644
Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* APPLICATION INTERFACE DEFINITION RELEASE */
2727
/* */
2828
/* ux_api.h PORTABLE C */
29-
/* 6.1.12 */
29+
/* 6.2.0 */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -122,6 +122,12 @@
122122
/* added shared device config */
123123
/* descriptor for enum scan, */
124124
/* resulting in version 6.1.12 */
125+
/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
126+
/* added some ETH error codes, */
127+
/* allowed align minimal def, */
128+
/* added interface instance */
129+
/* creation strategy control, */
130+
/* resulting in version 6.2.0 */
125131
/* */
126132
/**************************************************************************/
127133

@@ -288,8 +294,8 @@ typedef signed char SCHAR;
288294
/* Define basic constants for the USBX Stack. */
289295
#define AZURE_RTOS_USBX
290296
#define USBX_MAJOR_VERSION 6
291-
#define USBX_MINOR_VERSION 1
292-
#define USBX_PATCH_VERSION 12
297+
#define USBX_MINOR_VERSION 2
298+
#define USBX_PATCH_VERSION 0
293299

294300
/* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */
295301

@@ -1102,7 +1108,6 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL
11021108

11031109
#define UX_NO_ALIGN 0u
11041110
#define UX_ALIGN_16 0x0fu
1105-
#define UX_ALIGN_MIN 0x0fu
11061111
#define UX_ALIGN_32 0x1fu
11071112
#define UX_ALIGN_64 0x3fu
11081113
#define UX_ALIGN_128 0x7fu
@@ -1113,6 +1118,9 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL
11131118
#define UX_ALIGN_4096 0xfffu
11141119
#define UX_SAFE_ALIGN 0xffffffffu
11151120
#define UX_MAX_SCATTER_GATHER_ALIGNMENT 4096
1121+
#ifndef UX_ALIGN_MIN
1122+
#define UX_ALIGN_MIN UX_ALIGN_16
1123+
#endif
11161124

11171125
#define UX_MAX_USB_DEVICES 127
11181126

@@ -1483,6 +1491,10 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL
14831491
#define UX_HOST_CLASS_AUDIO_WRONG_FREQUENCY 0x82
14841492

14851493
#define UX_CLASS_CDC_ECM_LINK_STATE_DOWN_ERROR 0x90
1494+
#define UX_CLASS_ETH_LINK_STATE_DOWN_ERROR 0x90
1495+
#define UX_CLASS_ETH_PACKET_POOL_ERROR 0x91
1496+
#define UX_CLASS_ETH_PACKET_ERROR 0x92
1497+
#define UX_CLASS_ETH_SIZE_ERROR 0x93
14861498

14871499

14881500
/* Define USBX HCD API function constants. */
@@ -2049,6 +2061,12 @@ typedef struct UX_CONFIGURATION_STRUCT
20492061
ULONG ux_configuration_iad_protocol;
20502062
} UX_CONFIGURATION;
20512063

2064+
#define UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_ALL 0 /* Default: all things created. */
2065+
#define UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_OWNED 1 /* Owned: class owned things created. */
2066+
#ifndef UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_CONTROL
2067+
#define UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_CONTROL UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_ALL
2068+
#endif
2069+
20522070

20532071
/* Define USBX Interface Descriptor structure. */
20542072

common/core/inc/ux_user_sample.h

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* PORT SPECIFIC C INFORMATION RELEASE */
2727
/* */
2828
/* ux_user.h PORTABLE C */
29-
/* 6.1.12 */
29+
/* 6.2.0 */
3030
/* */
3131
/* AUTHOR */
3232
/* */
@@ -83,6 +83,12 @@
8383
/* added device CDC_ACM and */
8484
/* printer write auto ZLP, */
8585
/* resulting in version 6.1.12 */
86+
/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
87+
/* deprecated ECM pool option, */
88+
/* added align minimal config, */
89+
/* added host stack instance */
90+
/* creation strategy control, */
91+
/* resulting in version 6.2.0 */
8692
/* */
8793
/**************************************************************************/
8894

@@ -116,6 +122,10 @@
116122
/* Override various options with default values already assigned in ux_api.h or ux_port.h. Please
117123
also refer to ux_port.h for descriptions on each of these options. */
118124

125+
/* Defined, this value represents minimal allocated memory alignment in number of bytes.
126+
The default is UX_ALIGN_16 (0x0f) to align allocated memory to 16 bytes. */
127+
/* #define UX_ALIGN_MIN UX_ALIGN_16 */
128+
119129
/* Defined, this value represents how many ticks per seconds for a specific hardware platform.
120130
The default is 1000 indicating 1 tick per millisecond. */
121131

@@ -317,7 +327,9 @@
317327

318328
/* #define UX_HOST_CLASS_CDC_ECM_PACKET_POOL_INSTANCE_WAIT 10 */
319329

320-
/* Defined, this enables CDC ECM class to use the packet pool from NetX instance. */
330+
/* Defined, this enables CDC ECM class to use the packet pool from NetX instance.
331+
It's deprecated, packet pool from NetX instance is always used now.
332+
*/
321333

322334
/* #define UX_HOST_CLASS_CDC_ECM_USE_PACKET_POOL_FROM_NETX */
323335

@@ -427,6 +439,15 @@
427439
/* Defined, host audio optional interrupt endpoint is support. */
428440
/* #define UX_HOST_CLASS_AUDIO_INTERRUPT_SUPPORT */
429441

442+
/* Defined, this value controls host configuration instance creation, include all
443+
interfaces and endpoints physical resources.
444+
Possible settings:
445+
UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_ALL (0) - The default, create all inside configuration.
446+
UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_OWNED (1) - Create things owned by class driver.
447+
Not defined, default setting is applied.
448+
*/
449+
/* #define UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_CONTROL UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_OWNED */
450+
430451
/* Defined, this value will only enable the host side of usbx. */
431452
/* #define UX_HOST_SIDE_ONLY */
432453

0 commit comments

Comments
 (0)