Skip to content

Commit

Permalink
Documentation: add migration guide to the USB documentation (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloradCvjetkovic authored Jun 12, 2024
1 parent 2f79d37 commit 39d13b3
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/Doxygen/USB/USB.dxy.in
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,7 @@ INPUT = src/usb.txt \
src/usb_classes.txt \
src/usb_function_reference.txt \
src/usb_resource_requirements.txt \
src/usb_migration.txt \
src/Reference_Files.txt \
src/usb_structs.txt \
src/rl_usb.txt \
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Documentation/Doxygen/USB/src/usb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This user's guide contains the following chapters:
- \ref USB_Classes provides details about the supported USB Device Classes.
- \ref usb_function_reference lists the complete API of the USB Component.
- \ref usb_resource_requirements shows the configuration of system resources for USB Component in detail.
- \ref usb_migration contains information how to migrate projects to latest version of USB Component (v8).
- [**API Reference**](./modules.html) shows the directory and file organization and contains the detailed API description.

The <a class="el" href="https://www.usb.org/developers" target="_blank">USB-IF Developers Area</a> contains the complete
Expand Down
68 changes: 68 additions & 0 deletions Documentation/Doxygen/USB/src/usb_migration.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
/**
\page usb_migration Migration Guide

<b>MDK-Middleware v8</b> introduced the following changes:

- <b>General</b>:
- <b>MDK bundle</b> with source code replaces MDK-Pro and MDK-Plus bundles with pre-built libraries.
- <b>removed CORE component variants</b>.
- added requirement for C compiler version 11 (C11).
- removed support for legacy Arm Compiler 5.
- removed support for CMSIS-RTOS version 1.

- <b>USB debug</b>:
- <b>changed source configuration file to header</b> (USB_Debug.c -> USB_Debug.h).

- <b>USB Device specific</b>:
- <b>changed source configuration files to headers</b> (USBD_Config_0..3.c -> USBD_Config_0..3.h).

- <b>USB Host specific</b>:
- <b>changed source configuration files to headers</b> (USBH_Config_0..3.c -> USBH_Config_0..3.h).
- <b>removed OHCI and EHCI drivers (moved to CMSIS-Driver pack)</b>.

The following sections show how to migrate projects from previous version of the MDK-Middleware (v7):
- \ref usb_migration_component describes how to migrate the USB Component selection.
- \ref usb_migration_config describes how to migrate the USB Component configuration.

\section usb_migration_component Component migration

To migrate the USB Component make the following changes to component selection:
- <b>Keil::USB</b>: select <b>MDK</b> bundle instead MDK-Pro or MDK-Plus bundle.
- <b>Keil::USB:CORE</b>: deselect <b>Debug</b> or <b>Release</b> variant if one was selected.

\note If the <b>Event Recorder</b> was used for debugging, please select the <b>Event Recorder</b>
from the <b>CMSIS-View</b> pack instead the one from the <b>ARM_Compiler</b> pack.

\note USB Component requires C Compiler supporting C11 standard or higher

If any other component is used, like Network or File System, please refer to its Migration Guide.

\section usb_migration_config Configuration migration

Debug:
- if the <b>USB_Debug.c</b> file exists, then compare it with the new <b>USB_Debug.h</b> file and copy
old values into the new file:
- if the old file does not exist then debugging was not configured previously
- note that <b>USB Device Debug</b> and <b>USB Host Debug</b> order has swapped in the new configuration file.
- \image html usb_debug_migrate.png "Old USB_Debug.c to new USB_Debug.h" width=90%

USB Device:
- compare the existing <b>USBD_Config_0..3.c</b> files with the new <b>USBD_Config_0..3.h</b> files and copy
old values into the new files:
- \image html usbd_config_migrate.png "Old USBD_Config_0..3.c to new USBD_Config_0..3.h" width=90%

USB Host:
- compare the existing <b>USBH_Config_0..3.c</b> files with the new <b>USBH_Config_0..3.h</b> files and copy
old values into the new files:
- the <b>USBH_Config_0..3.h</b> does not contain separate settings for <b>Custom</b>, <b>OHCI</b> or <b>EHCI</b>
controllers anymore, so to migrate to the new configuration file note which <b>Controller Interface</b>
was selected in the old <b>USBH_Config_0..3.c</b> file and copy appropriate controller's previous settings
to the new configuration file.
- for <b>Memory Pool Size</b> update the new value by <b>adding 128</b> since old setting did not include
additional necessary space for memory pool internal operation.
- \image html usbh_config_migrate.png "Old USBD_Config_0..3.c to new USBD_Config_0..3.h" width=90%

\note <b>OHCI</b> and <b>EHCI</b> drivers are not a part of the <b>MDK-Middleware</b> anymore but are distributed separately
via the <b>CMSIS-Driver</b> pack, so please consult CMSIS-Driver documentation on configuring and using those drivers.
*/

0 comments on commit 39d13b3

Please sign in to comment.