Skip to content

USB: update USB Host config file #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions .ci/USB/Host/RTE/USB/USBH_Config_0.h
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH0_HC_NUM 0

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH0_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH0_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH0_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH0_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH0_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH0_HC_MEM_POOL_SECTION_NAME ".driver.usbh0"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH0_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions .ci/USB/Host/RTE/USB/USBH_Config_0.h.base@8.0.0
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH0_HC_NUM 0

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH0_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH0_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH0_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH0_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH0_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH0_HC_MEM_POOL_SECTION_NAME ".driver.usbh0"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH0_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions .ci/USB/Host/RTE/USB/USBH_Config_1.h
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH1_HC_NUM 1

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH1_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH1_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH1_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH1_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH1_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH1_HC_MEM_POOL_SECTION_NAME ".driver.usbh1"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH1_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions .ci/USB/Host/RTE/USB/USBH_Config_1.h.base@8.0.0
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH1_HC_NUM 1

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH1_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH1_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH1_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH1_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH1_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH1_HC_MEM_POOL_SECTION_NAME ".driver.usbh1"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH1_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions .ci/USB/Host/RTE/USB/USBH_Config_2.h
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH2_HC_NUM 2

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH2_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH2_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH2_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH2_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH2_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH2_HC_MEM_POOL_SECTION_NAME ".driver.usbh2"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH2_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions .ci/USB/Host/RTE/USB/USBH_Config_2.h.base@8.0.0
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH2_HC_NUM 2

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH2_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH2_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH2_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH2_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH2_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH2_HC_MEM_POOL_SECTION_NAME ".driver.usbh2"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH2_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions .ci/USB/Host/RTE/USB/USBH_Config_3.h
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH3_HC_NUM 3

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH3_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH3_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH3_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH3_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH3_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH3_HC_MEM_POOL_SECTION_NAME ".driver.usbh3"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH3_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions .ci/USB/Host/RTE/USB/USBH_Config_3.h.base@8.0.0
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH3_HC_NUM 3

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH3_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH3_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH3_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH3_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH3_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH3_HC_MEM_POOL_SECTION_NAME ".driver.usbh3"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH3_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions Components/USB/Config/USBH_Config.h
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH%Instance%_HC_NUM %Instance%

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH%Instance%_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH%Instance%_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH%Instance%_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH%Instance%_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH%Instance%_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH%Instance%_HC_MEM_POOL_SECTION_NAME ".driver.usbh%Instance%"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH%Instance%_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
18 changes: 9 additions & 9 deletions Components/USB/Source/usbh_config.c
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ extern void USBH_SignalPipeEvent (uint8_t ctrl, ARM_USBH_EP_HANDLE ep_hndl, uin
static const uint8_t usbh0_power = (uint8_t)(USBH0_HC_POWER / 2);
static const uint32_t usbh0_pipe_num = USBH0_HC_PIPE_NUM;
static const uint32_t usbh0_mem_pool_size = USBH0_HC_MEM_POOL_SIZE;
static const uint8_t usbh0_mem_pool_reloc = USBH0_HC_MEM_POOL_RELOC;
static const uint8_t usbh0_mem_pool_locate = USBH0_HC_MEM_POOL_LOCATE;
USBH_PIPE usbh0_pipe [USBH0_HC_PIPE_NUM];
static uint32_t usbh0_mem_pool [USBH0_HC_MEM_POOL_SIZE / 4] USBH0_HC_MEM_POOL_SECTION;
static ARM_DRIVER_USBH *usbh0_hcd_ptr = &USBHn_DRIVER(USBH0_HC_NUM);
@@ -99,7 +99,7 @@ static const osThreadAttr_t usbh0_core_thread_attr = {
static const uint8_t usbh1_power = (uint8_t)(USBH1_HC_POWER / 2);
static const uint32_t usbh1_pipe_num = USBH1_HC_PIPE_NUM;
static const uint32_t usbh1_mem_pool_size = USBH1_HC_MEM_POOL_SIZE;
static const uint8_t usbh1_mem_pool_reloc = USBH1_HC_MEM_POOL_RELOC;
static const uint8_t usbh1_mem_pool_locate = USBH1_HC_MEM_POOL_LOCATE;
USBH_PIPE usbh1_pipe [USBH1_HC_PIPE_NUM];
static uint32_t usbh1_mem_pool [USBH1_HC_MEM_POOL_SIZE / 4] USBH1_HC_MEM_POOL_SECTION;
static ARM_DRIVER_USBH *usbh1_hcd_ptr = &USBHn_DRIVER(USBH1_HC_NUM);
@@ -141,7 +141,7 @@ static const osThreadAttr_t usbh1_core_thread_attr = {
static const uint8_t usbh2_power = (uint8_t)(USBH2_HC_POWER / 2);
static const uint32_t usbh2_pipe_num = USBH2_HC_PIPE_NUM;
static const uint32_t usbh2_mem_pool_size = USBH2_HC_MEM_POOL_SIZE;
static const uint8_t usbh2_mem_pool_reloc = USBH2_HC_MEM_POOL_RELOC;
static const uint8_t usbh2_mem_pool_locate = USBH2_HC_MEM_POOL_LOCATE;
USBH_PIPE usbh2_pipe [USBH2_HC_PIPE_NUM];
static uint32_t usbh2_mem_pool [USBH2_HC_MEM_POOL_SIZE / 4] USBH2_HC_MEM_POOL_SECTION;
static ARM_DRIVER_USBH *usbh2_hcd_ptr = &USBHn_DRIVER(USBH2_HC_NUM);
@@ -183,7 +183,7 @@ static const osThreadAttr_t usbh2_core_thread_attr = {
static const uint8_t usbh3_power = (uint8_t)(USBH3_HC_POWER / 2);
static const uint32_t usbh3_pipe_num = USBH3_HC_PIPE_NUM;
static const uint32_t usbh3_mem_pool_size = USBH3_HC_MEM_POOL_SIZE;
static const uint8_t usbh3_mem_pool_reloc = USBH3_HC_MEM_POOL_RELOC;
static const uint8_t usbh3_mem_pool_locate = USBH3_HC_MEM_POOL_LOCATE;
USBH_PIPE usbh3_pipe [USBH3_HC_PIPE_NUM];
static uint32_t usbh3_mem_pool [USBH3_HC_MEM_POOL_SIZE / 4] USBH3_HC_MEM_POOL_SECTION;
static ARM_DRIVER_USBH *usbh3_hcd_ptr = &USBHn_DRIVER(USBH3_HC_NUM);
@@ -254,18 +254,18 @@ const uint8_t * const usbh_power_ptr [USBH_HC_NUM] = {
#endif
};

const uint8_t * const usbh_mem_pool_reloc_ptr [USBH_HC_NUM] = {
const uint8_t * const usbh_mem_pool_locate_ptr [USBH_HC_NUM] = {
#ifdef RTE_USB_Host_0
&usbh0_mem_pool_reloc
&usbh0_mem_pool_locate
#endif
#ifdef RTE_USB_Host_1
, &usbh1_mem_pool_reloc
, &usbh1_mem_pool_locate
#endif
#ifdef RTE_USB_Host_2
, &usbh2_mem_pool_reloc
, &usbh2_mem_pool_locate
#endif
#ifdef RTE_USB_Host_3
, &usbh3_mem_pool_reloc
, &usbh3_mem_pool_locate
#endif
};

2 changes: 1 addition & 1 deletion Components/USB/Source/usbh_config.h
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ extern USBH_PIPE usbh3_pipe[];
#endif

extern const uint8_t * const usbh_power_ptr [];
extern const uint8_t * const usbh_mem_pool_reloc_ptr [];
extern const uint8_t * const usbh_mem_pool_locate_ptr[];
extern uint32_t * const usbh_mem_pool_ptr [];
extern const uint32_t * const usbh_mem_pool_size_ptr [];
extern USBH_PIPE * const usbh_pipe_ptr [];
6 changes: 3 additions & 3 deletions Components/USB/Source/usbh_lib_core.c
Original file line number Diff line number Diff line change
@@ -833,7 +833,7 @@ usbStatus USBH_PipeReceive (USBH_PIPE_HANDLE pipe_hndl, uint8_t *buf, uint32_t l

remain_len = len;
max_data_len = len;
if (*usbh_mem_pool_reloc_ptr[ctrl] != 0U) { // If memory relocation is enabled
if (*usbh_mem_pool_locate_ptr[ctrl] != 0U) { // If memory pool location is enabled
if (remain_len == 0U) { // If ZLP is requested
alloc_mem = false;
} else {
@@ -1106,7 +1106,7 @@ usbStatus USBH_PipeSend (USBH_PIPE_HANDLE pipe_hndl, const uint8_t *buf, uint32_

remain_len = len;
max_data_len = len;
if (*usbh_mem_pool_reloc_ptr[ctrl] != 0U) { // If memory relocation is enabled
if (*usbh_mem_pool_locate_ptr[ctrl] != 0U) { // If memory pool location is enabled
if (len == 0U) { // If ZLP is requested
alloc_mem = false;
} else {
@@ -2552,7 +2552,7 @@ static usbStatus USBH_PipeSendSetup (USBH_PIPE_HANDLE pipe_hndl, const USB_SETUP

ptr_pipe->locked = 1U;

if (*usbh_mem_pool_reloc_ptr[ctrl] != 0U) { // If memory relocation is enabled
if (*usbh_mem_pool_locate_ptr[ctrl] != 0U) { // If memory pool location is enabled
alloc_mem = !USBH_MemoryIsInPool (ctrl, (const uint8_t *)setup_packet);
if (alloc_mem) {
// If memory for USB must be relocated, allocate 8 bytes for SETUP packet
8 changes: 4 additions & 4 deletions Components/USB/Source/usbh_section.h
Original file line number Diff line number Diff line change
@@ -16,31 +16,31 @@
#define USBHn_HC_MEM_POOL_SECTION_(str) __attribute__((section(str)))

#ifdef USBH0_HC_NUM
#if (USBH0_HC_MEM_POOL_RELOC == 1)
#if (USBH0_HC_MEM_POOL_LOCATE == 1)
#define USBH0_HC_MEM_POOL_SECTION USBHn_HC_MEM_POOL_SECTION_(USBH0_HC_MEM_POOL_SECTION_NAME)
#else
#define USBH0_HC_MEM_POOL_SECTION
#endif
#endif

#ifdef USBH1_HC_NUM
#if (USBH1_HC_MEM_POOL_RELOC == 1)
#if (USBH1_HC_MEM_POOL_LOCATE == 1)
#define USBH1_HC_MEM_POOL_SECTION USBHn_HC_MEM_POOL_SECTION_(USBH1_HC_MEM_POOL_SECTION_NAME)
#else
#define USBH1_HC_MEM_POOL_SECTION
#endif
#endif

#ifdef USBH2_HC_NUM
#if (USBH2_HC_MEM_POOL_RELOC == 1)
#if (USBH2_HC_MEM_POOL_LOCATE == 1)
#define USBH2_HC_MEM_POOL_SECTION USBHn_HC_MEM_POOL_SECTION_(USBH2_HC_MEM_POOL_SECTION_NAME)
#else
#define USBH2_HC_MEM_POOL_SECTION
#endif
#endif

#ifdef USBH3_HC_NUM
#if (USBH3_HC_MEM_POOL_RELOC == 1)
#if (USBH3_HC_MEM_POOL_LOCATE == 1)
#define USBH3_HC_MEM_POOL_SECTION USBHn_HC_MEM_POOL_SECTION_(USBH3_HC_MEM_POOL_SECTION_NAME)
#else
#define USBH3_HC_MEM_POOL_SECTION
Binary file modified Documentation/Doxygen/USB/src/images/usbh_config_0_h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions Documentation/Doxygen/USB/src/rl_usb.txt
Original file line number Diff line number Diff line change
@@ -4867,14 +4867,14 @@ The USB Host configuration file <b>USBH_Config_<i>n</i>.h</b> contains the follo
- <b>Maximum Port Power Consumption</b> specifies maximum current that a port can source (in mA).
USB Devices exceeding this requirement will not be usable by the USB Host.
- <b>Maximum Pipes in system</b> specifies the maximum number of active pipes (pipe is a communication channel to an USB Device endpoint).
- <b>Memory Pool Size</b> specifies the size of the memory pool used by the USB Host Component.
It has to be larger than maximum packet size on any endpoint for typically 128 bytes, making this a default size of 640 bytes to
cover 512 bytes bulk endpoint maximum packet size.
- <b>Relocate Memory Pool</b> specifies if the memory pool is relocated to a specific memory address (via the linker script).
This is usually necessary in case that USB Controller has some specific requirements regarding memory for transfers.
For example if USB Controller can only access specific memory, or if this memory needs to be non-cacheable.
- <b>Memory Pool section name</b> specifies the section name for the memory pool that is used by the linker script to position it in memory.
Default section name is <c>.driver.usbh<instance></c>, for example for USB Controller 0 the default section name is <c>.driver.usbh0</c>.
- <b>Memory Pool</b> specifies the size of the USB memory pool and is also used for locating the USB memory pool in specific memory.
- <b>Size</b> specifies the size of the USB memory pool (in bytes) that the USB Host controller will use for the USB communication data.
This size should be at least equal to the size of the maximum expected packet + 128 bytes.
- <b>Locate</b> specifies if the USB memory pool is located in a specific memory (via the linker script).
This is usually necessary in case that USB Controller has some specific requirements regarding memory for USB transfers.
For example if USB Controller can only access specific memory, or if this memory needs to be non-cacheable.
- <b>Section Name</b> specifies the section name for the USB memory pool that is used by the linker script to position it in memory.
Default section name is <c>.driver.usbh<instance></c>, for example for USB Controller 0 the default section name is <c>.driver.usbh0</c>.
- Use the <b>OS Resources Settings</b> to optimize the usage of OS resources.
- The default <b>Core Thread Stack Size</b> is \a 2048 bytes.
- The default Core Thread priority is <b>osPriorityAboveNormal</b>.
2 changes: 1 addition & 1 deletion Documentation/Doxygen/USB/src/usb.txt
Original file line number Diff line number Diff line change
@@ -923,7 +923,7 @@ The <b>USBH_Config_<i>n</i>.h</b> file contains additional settings for the spec
- <b>Power Consumption</b> can be configured according to hardware capability of the USB Host Controller.
- <b>Maximum Pipes</b> can be specified according to expected USB Device classes that are expected to be used by the USB Host.
- <b>Memory Pool</b> parameters can be configured that are necessary for USB Host operation.
This memory pool can also be relocated to specific memory via the linker script.
This memory pool can also be located to specific memory via the linker script.

Refer to \ref usbh_coreFunctions_conf for a detailed list of all available settings.

35 changes: 20 additions & 15 deletions Examples/USB/Host/Keyboard/RTE/USB/USBH_Config_0.h
Original file line number Diff line number Diff line change
@@ -20,31 +20,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH0_HC_NUM CMSIS_DRIVER_USBH

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH0_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH0_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH0_HC_MEM_POOL_SIZE 4224

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH0_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH0_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH0_HC_MEM_POOL_SECTION_NAME ".driver.usbh0"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -53,5 +57,6 @@

// Core Thread Priority
#define USBH0_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions Examples/USB/Host/Keyboard/RTE/USB/USBH_Config_0.h.base@8.0.0
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH0_HC_NUM 0

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH0_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH0_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH0_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH0_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH0_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH0_HC_MEM_POOL_SECTION_NAME ".driver.usbh0"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH0_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions Examples/USB/Host/MassStorage/RTE/USB/USBH_Config_0.h
Original file line number Diff line number Diff line change
@@ -20,31 +20,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH0_HC_NUM CMSIS_DRIVER_USBH

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH0_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH0_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH0_HC_MEM_POOL_SIZE 4224

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH0_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH0_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH0_HC_MEM_POOL_SECTION_NAME ".driver.usbh0"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -53,5 +57,6 @@

// Core Thread Priority
#define USBH0_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>
35 changes: 20 additions & 15 deletions Examples/USB/Host/MassStorage/RTE/USB/USBH_Config_0.h.base@8.0.0
Original file line number Diff line number Diff line change
@@ -14,31 +14,35 @@
// <i>Specifies instance of the Host Controller hardware interface.
#define USBH0_HC_NUM 0

// <o>Maximum Port Power Consumption<2-500:2>
// <i>Specifies the maximum power consumption per port (in mA)
// <o>Maximum Port Power Delivery (in mA) <2-500:2>
// <i>Specifies the maximum power delivery per port.
#define USBH0_HC_POWER 500

// <o>Maximum Pipes in system
// <o>Maximum Pipes in System
// <i>Specifies the maximum number of Pipes that will be used by
// <i>the USB Host controller in the system simultaneously.
#define USBH0_HC_PIPE_NUM 3

// <o>Memory Pool Size <640-1048576:4>
// <i>Specifies the size of the memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to
// <i>size of maximum expected packet + 128 bytes.
// <h>Memory Pool
// <o>Size <640-1048576:4>
// <i>Specifies the size of the USB memory pool (in bytes) that
// <i>the USB Host controller will use for the USB communication data.
// <i>This size should be at least equal to the size
// <i>of the maximum expected packet + 128 bytes.
#define USBH0_HC_MEM_POOL_SIZE 640

// <e>Relocate Memory Pool
// <i>Specifies if the memory pool is located at a specific address
// <i>(via linker script).
#define USBH0_HC_MEM_POOL_RELOC 0
// <e>Locate
// <i>Specifies if the USB memory pool is located in a specific memory
// <i>(via the linker script).
#define USBH0_HC_MEM_POOL_LOCATE 0

// <s.128>Memory Pool section name
// <i>Specifies the section name of the Memory Pool
// <s.128>Section Name
// <i>Specifies the section name for the USB memory pool
// <i>(for positioning via the linker script).
#define USBH0_HC_MEM_POOL_SECTION_NAME ".driver.usbh0"
// </e>

// </e>
// </h>

// <h>OS Resources Settings
// <i>These settings are used to optimize usage of OS resources.
@@ -47,5 +51,6 @@

// Core Thread Priority
#define USBH0_CORE_THREAD_PRIORITY osPriorityAboveNormal

// </h>
// </h>