diff --git a/.ci/USB/Device/RTE/USB/USBD_Config_0.h b/.ci/USB/Device/RTE/USB/USBD_Config_0.h index 8508d108..0e941fbf 100644 --- a/.ci/USB/Device/RTE/USB/USBD_Config_0.h +++ b/.ci/USB/Device/RTE/USB/USBD_Config_0.h @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD0_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD0_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD0_BUF_MEM_SECTION_NAME ".driver.usbd0" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/.ci/USB/Device/RTE/USB/USBD_Config_0.h.base@8.0.0 b/.ci/USB/Device/RTE/USB/USBD_Config_0.h.base@8.0.0 index 8508d108..0e941fbf 100644 --- a/.ci/USB/Device/RTE/USB/USBD_Config_0.h.base@8.0.0 +++ b/.ci/USB/Device/RTE/USB/USBD_Config_0.h.base@8.0.0 @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD0_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD0_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD0_BUF_MEM_SECTION_NAME ".driver.usbd0" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/.ci/USB/Device/RTE/USB/USBD_Config_1.h b/.ci/USB/Device/RTE/USB/USBD_Config_1.h index eb2286fa..57edf45b 100644 --- a/.ci/USB/Device/RTE/USB/USBD_Config_1.h +++ b/.ci/USB/Device/RTE/USB/USBD_Config_1.h @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD1_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD1_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD1_BUF_MEM_SECTION_NAME ".driver.usbd1" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/.ci/USB/Device/RTE/USB/USBD_Config_1.h.base@8.0.0 b/.ci/USB/Device/RTE/USB/USBD_Config_1.h.base@8.0.0 index eb2286fa..57edf45b 100644 --- a/.ci/USB/Device/RTE/USB/USBD_Config_1.h.base@8.0.0 +++ b/.ci/USB/Device/RTE/USB/USBD_Config_1.h.base@8.0.0 @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD1_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD1_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD1_BUF_MEM_SECTION_NAME ".driver.usbd1" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/.ci/USB/Device/RTE/USB/USBD_Config_2.h b/.ci/USB/Device/RTE/USB/USBD_Config_2.h index 24198956..e99f4b22 100644 --- a/.ci/USB/Device/RTE/USB/USBD_Config_2.h +++ b/.ci/USB/Device/RTE/USB/USBD_Config_2.h @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD2_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD2_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD2_BUF_MEM_SECTION_NAME ".driver.usbd2" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/.ci/USB/Device/RTE/USB/USBD_Config_2.h.base@8.0.0 b/.ci/USB/Device/RTE/USB/USBD_Config_2.h.base@8.0.0 index 24198956..e99f4b22 100644 --- a/.ci/USB/Device/RTE/USB/USBD_Config_2.h.base@8.0.0 +++ b/.ci/USB/Device/RTE/USB/USBD_Config_2.h.base@8.0.0 @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD2_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD2_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD2_BUF_MEM_SECTION_NAME ".driver.usbd2" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/.ci/USB/Device/RTE/USB/USBD_Config_3.h b/.ci/USB/Device/RTE/USB/USBD_Config_3.h index 10ff5a1a..73823a3b 100644 --- a/.ci/USB/Device/RTE/USB/USBD_Config_3.h +++ b/.ci/USB/Device/RTE/USB/USBD_Config_3.h @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD3_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD3_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD3_BUF_MEM_SECTION_NAME ".driver.usbd3" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/.ci/USB/Device/RTE/USB/USBD_Config_3.h.base@8.0.0 b/.ci/USB/Device/RTE/USB/USBD_Config_3.h.base@8.0.0 index 10ff5a1a..73823a3b 100644 --- a/.ci/USB/Device/RTE/USB/USBD_Config_3.h.base@8.0.0 +++ b/.ci/USB/Device/RTE/USB/USBD_Config_3.h.base@8.0.0 @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD3_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD3_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD3_BUF_MEM_SECTION_NAME ".driver.usbd3" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/Components/USB/Config/USBD_Config.h b/Components/USB/Config/USBD_Config.h index 4f5c4435..3a689d45 100644 --- a/Components/USB/Config/USBD_Config.h +++ b/Components/USB/Config/USBD_Config.h @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD%Instance%_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD%Instance%_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD%Instance%_BUF_MEM_SECTION_NAME ".driver.usbd%Instance%" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/Components/USB/Script/Headers/usbd_config_def_x.h b/Components/USB/Script/Headers/usbd_config_def_x.h index 1b51a3ae..0e790ab3 100644 --- a/Components/USB/Script/Headers/usbd_config_def_x.h +++ b/Components/USB/Script/Headers/usbd_config_def_x.h @@ -8209,4 +8209,4 @@ #error Device $x High-speed setting requires Maximum Endpoint 0 Packet Size of 64 bytes! #endif -#endif // USBD_CONFIG_DEF_$x_H_ +#endif // USBD_CONFIG_DEF_$x_H_ diff --git a/Components/USB/Script/Headers/usbd_config_dev_x.c b/Components/USB/Script/Headers/usbd_config_dev_x.c index a2dbc906..a0eddf38 100644 --- a/Components/USB/Script/Headers/usbd_config_dev_x.c +++ b/Components/USB/Script/Headers/usbd_config_dev_x.c @@ -15,7 +15,7 @@ uint8_t usbd$x_alt_setting [USBD$x_IF_CNT]; uint8_t usbd$x_alt_setting [USBD$x_IF_CNT]; extern uint8_t usbd$x_ep0_buf [((USBD$x_EP0_BUF_SIZE+31)/32)*32]; -uint8_t usbd$x_ep0_buf [((USBD$x_EP0_BUF_SIZE+31)/32)*32] __ALIGNED(32); +uint8_t usbd$x_ep0_buf [((USBD$x_EP0_BUF_SIZE+31)/32)*32] __ALIGNED(32) USBD$x_DEV_BUF_MEM_SECTION; extern usbd_data_t usbd$x_data; usbd_data_t usbd$x_data; diff --git a/Components/USB/Source/usbd_compatibility.h b/Components/USB/Source/usbd_compatibility.h index 808928a3..c75f39dc 100644 --- a/Components/USB/Source/usbd_compatibility.h +++ b/Components/USB/Source/usbd_compatibility.h @@ -40,6 +40,9 @@ #ifndef USBD0_EP0_BUF_SIZE #define USBD0_EP0_BUF_SIZE (USBD0_MAX_PACKET0) #endif +#ifndef USBD0_BUF_MEM_RELOC +#define USBD0_BUF_MEM_RELOC (0) +#endif #ifndef USBD1_CORE_THREAD_STACK_SIZE #define USBD1_CORE_THREAD_STACK_SIZE (0U) @@ -59,6 +62,9 @@ #ifndef USBD1_EP0_BUF_SIZE #define USBD1_EP0_BUF_SIZE (USBD1_MAX_PACKET0) #endif +#ifndef USBD1_BUF_MEM_RELOC +#define USBD1_BUF_MEM_RELOC (0) +#endif #ifndef USBD2_CORE_THREAD_STACK_SIZE #define USBD2_CORE_THREAD_STACK_SIZE (0U) @@ -78,6 +84,9 @@ #ifndef USBD2_EP0_BUF_SIZE #define USBD2_EP0_BUF_SIZE (USBD2_MAX_PACKET0) #endif +#ifndef USBD2_BUF_MEM_RELOC +#define USBD2_BUF_MEM_RELOC (0) +#endif #ifndef USBD3_CORE_THREAD_STACK_SIZE #define USBD3_CORE_THREAD_STACK_SIZE (0U) @@ -97,6 +106,9 @@ #ifndef USBD3_EP0_BUF_SIZE #define USBD3_EP0_BUF_SIZE (USBD3_MAX_PACKET0) #endif +#ifndef USBD3_BUF_MEM_RELOC +#define USBD3_BUF_MEM_RELOC (0) +#endif /*------------------------------------------------------------------------------ diff --git a/Components/USB/Source/usbd_config.c b/Components/USB/Source/usbd_config.c index e78912f2..e0326c67 100644 --- a/Components/USB/Source/usbd_config.c +++ b/Components/USB/Source/usbd_config.c @@ -122,6 +122,8 @@ #include "usbd_compatibility.h" +#include "usbd_section.h" + /*------------------------------------------------------------------------------ * USB Device Global Macros *----------------------------------------------------------------------------*/ @@ -1292,12 +1294,12 @@ void *usbd_adc_thread_id [USBD_ADC_NUM]; #if (USBD_ADC0_EP_ISO_OUT_EN) extern uint8_t usbd_adc0_out_data_buf [RUP32(USBD_ADC0_OUT_BUF_SIZE*USBD_ADC0_OUT_BSUBFRAMESIZE)]; -uint8_t usbd_adc0_out_data_buf [RUP32(USBD_ADC0_OUT_BUF_SIZE*USBD_ADC0_OUT_BSUBFRAMESIZE)] __ALIGNED(32); +uint8_t usbd_adc0_out_data_buf [RUP32(USBD_ADC0_OUT_BUF_SIZE*USBD_ADC0_OUT_BSUBFRAMESIZE)] __ALIGNED(32) USBD_ADC0_BUF_MEM_SECTION; #endif #if (USBD_ADC0_EP_ISO_IN_EN) extern uint8_t usbd_adc0_in_data_buf [USBD_ADC0_IN_BUF_SIZE*USBD_ADC0_IN_BSUBFRAMESIZE]; -uint8_t usbd_adc0_in_data_buf [USBD_ADC0_IN_BUF_SIZE*USBD_ADC0_IN_BSUBFRAMESIZE] __ALIGNED(4); +uint8_t usbd_adc0_in_data_buf [USBD_ADC0_IN_BUF_SIZE*USBD_ADC0_IN_BSUBFRAMESIZE] __ALIGNED(4) USBD_ADC0_BUF_MEM_SECTION; #endif #endif @@ -1305,12 +1307,12 @@ uint8_t usbd_adc0_in_data_buf [USBD_ADC0_IN_BUF_SIZE*USBD_ADC0_IN_BSUBFRAMESIZE #if (USBD_ADC1_EP_ISO_OUT_EN) extern uint8_t usbd_adc1_out_data_buf [RUP32(USBD_ADC1_OUT_BUF_SIZE*USBD_ADC1_OUT_BSUBFRAMESIZE)]; -uint8_t usbd_adc1_out_data_buf [RUP32(USBD_ADC1_OUT_BUF_SIZE*USBD_ADC1_OUT_BSUBFRAMESIZE)] __ALIGNED(32); +uint8_t usbd_adc1_out_data_buf [RUP32(USBD_ADC1_OUT_BUF_SIZE*USBD_ADC1_OUT_BSUBFRAMESIZE)] __ALIGNED(32) USBD_ADC1_BUF_MEM_SECTION; #endif #if (USBD_ADC1_EP_ISO_IN_EN) extern uint8_t usbd_adc1_in_data_buf [USBD_ADC1_IN_BUF_SIZE*USBD_ADC1_IN_BSUBFRAMESIZE]; -uint8_t usbd_adc1_in_data_buf [USBD_ADC1_IN_BUF_SIZE*USBD_ADC1_IN_BSUBFRAMESIZE] __ALIGNED(4); +uint8_t usbd_adc1_in_data_buf [USBD_ADC1_IN_BUF_SIZE*USBD_ADC1_IN_BSUBFRAMESIZE] __ALIGNED(4) USBD_ADC1_BUF_MEM_SECTION; #endif #endif @@ -1318,12 +1320,12 @@ uint8_t usbd_adc1_in_data_buf [USBD_ADC1_IN_BUF_SIZE*USBD_ADC1_IN_BSUBFRAMESIZE #if (USBD_ADC2_EP_ISO_OUT_EN) extern uint8_t usbd_adc2_out_data_buf [RUP32(USBD_ADC2_OUT_BUF_SIZE*USBD_ADC2_OUT_BSUBFRAMESIZE)]; -uint8_t usbd_adc2_out_data_buf [RUP32(USBD_ADC2_OUT_BUF_SIZE*USBD_ADC2_OUT_BSUBFRAMESIZE)] __ALIGNED(32); +uint8_t usbd_adc2_out_data_buf [RUP32(USBD_ADC2_OUT_BUF_SIZE*USBD_ADC2_OUT_BSUBFRAMESIZE)] __ALIGNED(32) USBD_ADC2_BUF_MEM_SECTION; #endif #if (USBD_ADC2_EP_ISO_IN_EN) extern uint8_t usbd_adc2_in_data_buf [USBD_ADC2_IN_BUF_SIZE*USBD_ADC2_IN_BSUBFRAMESIZE]; -uint8_t usbd_adc2_in_data_buf [USBD_ADC2_IN_BUF_SIZE*USBD_ADC2_IN_BSUBFRAMESIZE] __ALIGNED(4); +uint8_t usbd_adc2_in_data_buf [USBD_ADC2_IN_BUF_SIZE*USBD_ADC2_IN_BSUBFRAMESIZE] __ALIGNED(4) USBD_ADC2_BUF_MEM_SECTION; #endif #endif @@ -1331,12 +1333,12 @@ uint8_t usbd_adc2_in_data_buf [USBD_ADC2_IN_BUF_SIZE*USBD_ADC2_IN_BSUBFRAMESIZE #if (USBD_ADC3_EP_ISO_OUT_EN) extern uint8_t usbd_adc3_out_data_buf [RUP32(USBD_ADC3_OUT_BUF_SIZE*USBD_ADC3_OUT_BSUBFRAMESIZE)]; -uint8_t usbd_adc3_out_data_buf [RUP32(USBD_ADC3_OUT_BUF_SIZE*USBD_ADC3_OUT_BSUBFRAMESIZE)] __ALIGNED(32); +uint8_t usbd_adc3_out_data_buf [RUP32(USBD_ADC3_OUT_BUF_SIZE*USBD_ADC3_OUT_BSUBFRAMESIZE)] __ALIGNED(32) USBD_ADC3_BUF_MEM_SECTION; #endif #if (USBD_ADC3_EP_ISO_IN_EN) extern uint8_t usbd_adc3_in_data_buf [USBD_ADC3_IN_BUF_SIZE*USBD_ADC3_IN_BSUBFRAMESIZE]; -uint8_t usbd_adc3_in_data_buf [USBD_ADC3_IN_BUF_SIZE*USBD_ADC3_IN_BSUBFRAMESIZE] __ALIGNED(4); +uint8_t usbd_adc3_in_data_buf [USBD_ADC3_IN_BUF_SIZE*USBD_ADC3_IN_BSUBFRAMESIZE] __ALIGNED(4) USBD_ADC3_BUF_MEM_SECTION; #endif #endif @@ -1702,19 +1704,19 @@ void *usbd_cdc_bulk_thread_id [USBD_CDC_NUM]; #if USBD_CDC0_ACM extern uint8_t usbd_cdc0_send_buf [USBD_CDC0_ACM_SEND_BUF_SIZE]; -uint8_t usbd_cdc0_send_buf [USBD_CDC0_ACM_SEND_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc0_send_buf [USBD_CDC0_ACM_SEND_BUF_SIZE] __ALIGNED(4) USBD_CDC0_BUF_MEM_SECTION; extern uint8_t usbd_cdc0_receive_buf [USBD_CDC0_ACM_RECEIVE_BUF_SIZE]; -uint8_t usbd_cdc0_receive_buf [USBD_CDC0_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc0_receive_buf [USBD_CDC0_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4) USBD_CDC0_BUF_MEM_SECTION; extern uint8_t usbd_cdc0_notify_buf [10]; -uint8_t usbd_cdc0_notify_buf [10] __ALIGNED(4); +uint8_t usbd_cdc0_notify_buf [10] __ALIGNED(4) USBD_CDC0_BUF_MEM_SECTION; extern uint8_t usbd_cdc0_send_mps_buf [USBD_CDC0_MAX_PACKET1]; -uint8_t usbd_cdc0_send_mps_buf [USBD_CDC0_MAX_PACKET1] __ALIGNED(4); +uint8_t usbd_cdc0_send_mps_buf [USBD_CDC0_MAX_PACKET1] __ALIGNED(4) USBD_CDC0_BUF_MEM_SECTION; extern uint8_t usbd_cdc0_receive_mps_buf[RUP32(USBD_CDC0_MAX_PACKET1)]; -uint8_t usbd_cdc0_receive_mps_buf[RUP32(USBD_CDC0_MAX_PACKET1)] __ALIGNED(32); +uint8_t usbd_cdc0_receive_mps_buf[RUP32(USBD_CDC0_MAX_PACKET1)] __ALIGNED(32) USBD_CDC0_BUF_MEM_SECTION; #elif USBD_CDC0_NCM #if (USBD_CDC0_NCM_RAW_ENABLE == 0) #if (USBD_CDC0_NCM_NTB_IN_BUF_CNT == 0) @@ -1731,17 +1733,17 @@ uint8_t usbd_cdc0_receive_mps_buf[RUP32(USBD_CDC0_MAX_PACKET1)] __ALIGN #define USBD_CDC0_NCM_NTB_OUT_BUF_SIZE (USBD_CDC0_NCM_NTB_OUT_BUF_CNT*USBD_CDC0_NCM_DW_NTB_OUT_MAX_SIZE) extern uint8_t usbd_cdc0_send_buf [USBD_CDC0_NCM_NTB_IN_BUF_SIZE]; -uint8_t usbd_cdc0_send_buf [USBD_CDC0_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc0_send_buf [USBD_CDC0_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4) USBD_CDC0_BUF_MEM_SECTION; extern uint8_t usbd_cdc0_receive_buf [RUP32(USBD_CDC0_NCM_NTB_OUT_BUF_SIZE)]; -uint8_t usbd_cdc0_receive_buf [RUP32(USBD_CDC0_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_cdc0_receive_buf [RUP32(USBD_CDC0_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32) USBD_CDC0_BUF_MEM_SECTION; #else #define USBD_CDC0_NCM_NTB_IN_BUF_SIZE (0) #define USBD_CDC0_NCM_NTB_OUT_BUF_SIZE (0) #endif extern uint8_t usbd_cdc0_notify_buf [16]; -uint8_t usbd_cdc0_notify_buf [16] __ALIGNED(4); +uint8_t usbd_cdc0_notify_buf [16] __ALIGNED(4) USBD_CDC0_BUF_MEM_SECTION; #endif #endif @@ -1749,19 +1751,19 @@ uint8_t usbd_cdc0_notify_buf [16] __ALIGN #if USBD_CDC1_ACM extern uint8_t usbd_cdc1_send_buf [USBD_CDC1_ACM_SEND_BUF_SIZE]; -uint8_t usbd_cdc1_send_buf [USBD_CDC1_ACM_SEND_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc1_send_buf [USBD_CDC1_ACM_SEND_BUF_SIZE] __ALIGNED(4) USBD_CDC1_BUF_MEM_SECTION; extern uint8_t usbd_cdc1_receive_buf [USBD_CDC1_ACM_RECEIVE_BUF_SIZE]; -uint8_t usbd_cdc1_receive_buf [USBD_CDC1_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc1_receive_buf [USBD_CDC1_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4) USBD_CDC1_BUF_MEM_SECTION; extern uint8_t usbd_cdc1_notify_buf [10]; -uint8_t usbd_cdc1_notify_buf [10] __ALIGNED(4); +uint8_t usbd_cdc1_notify_buf [10] __ALIGNED(4) USBD_CDC1_BUF_MEM_SECTION; extern uint8_t usbd_cdc1_send_mps_buf [USBD_CDC1_MAX_PACKET1]; -uint8_t usbd_cdc1_send_mps_buf [USBD_CDC1_MAX_PACKET1] __ALIGNED(4); +uint8_t usbd_cdc1_send_mps_buf [USBD_CDC1_MAX_PACKET1] __ALIGNED(4) USBD_CDC1_BUF_MEM_SECTION; extern uint8_t usbd_cdc1_receive_mps_buf[RUP32(USBD_CDC1_MAX_PACKET1)]; -uint8_t usbd_cdc1_receive_mps_buf[RUP32(USBD_CDC1_MAX_PACKET1)] __ALIGNED(32); +uint8_t usbd_cdc1_receive_mps_buf[RUP32(USBD_CDC1_MAX_PACKET1)] __ALIGNED(32) USBD_CDC1_BUF_MEM_SECTION; #elif USBD_CDC1_NCM #if (USBD_CDC1_NCM_RAW_ENABLE == 0) #if (USBD_CDC1_NCM_NTB_IN_BUF_CNT == 0) @@ -1778,17 +1780,17 @@ uint8_t usbd_cdc1_receive_mps_buf[RUP32(USBD_CDC1_MAX_PACKET1)] __ALIGN #define USBD_CDC1_NCM_NTB_OUT_BUF_SIZE (USBD_CDC1_NCM_NTB_OUT_BUF_CNT*USBD_CDC1_NCM_DW_NTB_OUT_MAX_SIZE) extern uint8_t usbd_cdc1_send_buf [USBD_CDC1_NCM_NTB_IN_BUF_SIZE]; -uint8_t usbd_cdc1_send_buf [USBD_CDC1_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc1_send_buf [USBD_CDC1_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4) USBD_CDC1_BUF_MEM_SECTION; extern uint8_t usbd_cdc1_receive_buf [RUP32(USBD_CDC1_NCM_NTB_OUT_BUF_SIZE)]; -uint8_t usbd_cdc1_receive_buf [RUP32(USBD_CDC1_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_cdc1_receive_buf [RUP32(USBD_CDC1_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32) USBD_CDC1_BUF_MEM_SECTION; #else #define USBD_CDC1_NCM_NTB_IN_BUF_SIZE (0) #define USBD_CDC1_NCM_NTB_OUT_BUF_SIZE (0) #endif extern uint8_t usbd_cdc1_notify_buf [16]; -uint8_t usbd_cdc1_notify_buf [16] __ALIGNED(4); +uint8_t usbd_cdc1_notify_buf [16] __ALIGNED(4) USBD_CDC1_BUF_MEM_SECTION; #endif #endif @@ -1796,19 +1798,19 @@ uint8_t usbd_cdc1_notify_buf [16] __ALIGN #if USBD_CDC2_ACM extern uint8_t usbd_cdc2_send_buf [USBD_CDC2_ACM_SEND_BUF_SIZE]; -uint8_t usbd_cdc2_send_buf [USBD_CDC2_ACM_SEND_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc2_send_buf [USBD_CDC2_ACM_SEND_BUF_SIZE] __ALIGNED(4) USBD_CDC2_BUF_MEM_SECTION; extern uint8_t usbd_cdc2_receive_buf [USBD_CDC2_ACM_RECEIVE_BUF_SIZE]; -uint8_t usbd_cdc2_receive_buf [USBD_CDC2_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc2_receive_buf [USBD_CDC2_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4) USBD_CDC2_BUF_MEM_SECTION; extern uint8_t usbd_cdc2_notify_buf [10]; -uint8_t usbd_cdc2_notify_buf [10] __ALIGNED(4); +uint8_t usbd_cdc2_notify_buf [10] __ALIGNED(4) USBD_CDC2_BUF_MEM_SECTION; extern uint8_t usbd_cdc2_send_mps_buf [USBD_CDC2_MAX_PACKET1]; -uint8_t usbd_cdc2_send_mps_buf [USBD_CDC2_MAX_PACKET1] __ALIGNED(4); +uint8_t usbd_cdc2_send_mps_buf [USBD_CDC2_MAX_PACKET1] __ALIGNED(4) USBD_CDC2_BUF_MEM_SECTION; extern uint8_t usbd_cdc2_receive_mps_buf[RUP32(USBD_CDC2_MAX_PACKET1)]; -uint8_t usbd_cdc2_receive_mps_buf[RUP32(USBD_CDC2_MAX_PACKET1)] __ALIGNED(32); +uint8_t usbd_cdc2_receive_mps_buf[RUP32(USBD_CDC2_MAX_PACKET1)] __ALIGNED(32) USBD_CDC2_BUF_MEM_SECTION; #elif USBD_CDC2_NCM #if (USBD_CDC2_NCM_RAW_ENABLE == 0) #if (USBD_CDC2_NCM_NTB_IN_BUF_CNT == 0) @@ -1825,17 +1827,17 @@ uint8_t usbd_cdc2_receive_mps_buf[RUP32(USBD_CDC2_MAX_PACKET1)] __ALIGN #define USBD_CDC2_NCM_NTB_OUT_BUF_SIZE (USBD_CDC2_NCM_NTB_OUT_BUF_CNT*USBD_CDC2_NCM_DW_NTB_OUT_MAX_SIZE) extern uint8_t usbd_cdc2_send_buf [USBD_CDC2_NCM_NTB_IN_BUF_SIZE]; -uint8_t usbd_cdc2_send_buf [USBD_CDC2_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc2_send_buf [USBD_CDC2_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4) USBD_CDC2_BUF_MEM_SECTION; extern uint8_t usbd_cdc2_receive_buf [RUP32(USBD_CDC2_NCM_NTB_OUT_BUF_SIZE)]; -uint8_t usbd_cdc2_receive_buf [RUP32(USBD_CDC2_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_cdc2_receive_buf [RUP32(USBD_CDC2_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32) USBD_CDC2_BUF_MEM_SECTION; #else #define USBD_CDC2_NCM_NTB_IN_BUF_SIZE (0) #define USBD_CDC2_NCM_NTB_OUT_BUF_SIZE (0) #endif extern uint8_t usbd_cdc2_notify_buf [16]; -uint8_t usbd_cdc2_notify_buf [16] __ALIGNED(4); +uint8_t usbd_cdc2_notify_buf [16] __ALIGNED(4) USBD_CDC2_BUF_MEM_SECTION; #endif #endif @@ -1843,19 +1845,19 @@ uint8_t usbd_cdc2_notify_buf [16] __ALIGN #if USBD_CDC3_ACM extern uint8_t usbd_cdc3_send_buf [USBD_CDC3_ACM_SEND_BUF_SIZE]; -uint8_t usbd_cdc3_send_buf [USBD_CDC3_ACM_SEND_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc3_send_buf [USBD_CDC3_ACM_SEND_BUF_SIZE] __ALIGNED(4) USBD_CDC3_BUF_MEM_SECTION; extern uint8_t usbd_cdc3_receive_buf [USBD_CDC3_ACM_RECEIVE_BUF_SIZE]; -uint8_t usbd_cdc3_receive_buf [USBD_CDC3_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc3_receive_buf [USBD_CDC3_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4) USBD_CDC3_BUF_MEM_SECTION; extern uint8_t usbd_cdc3_notify_buf [10]; -uint8_t usbd_cdc3_notify_buf [10] __ALIGNED(4); +uint8_t usbd_cdc3_notify_buf [10] __ALIGNED(4) USBD_CDC3_BUF_MEM_SECTION; extern uint8_t usbd_cdc3_send_mps_buf [USBD_CDC3_MAX_PACKET1]; -uint8_t usbd_cdc3_send_mps_buf [USBD_CDC3_MAX_PACKET1] __ALIGNED(4); +uint8_t usbd_cdc3_send_mps_buf [USBD_CDC3_MAX_PACKET1] __ALIGNED(4) USBD_CDC3_BUF_MEM_SECTION; extern uint8_t usbd_cdc3_receive_mps_buf[RUP32(USBD_CDC3_MAX_PACKET1)]; -uint8_t usbd_cdc3_receive_mps_buf[RUP32(USBD_CDC3_MAX_PACKET1)] __ALIGNED(32); +uint8_t usbd_cdc3_receive_mps_buf[RUP32(USBD_CDC3_MAX_PACKET1)] __ALIGNED(32) USBD_CDC3_BUF_MEM_SECTION; #elif USBD_CDC3_NCM #if (USBD_CDC3_NCM_RAW_ENABLE == 0) #if (USBD_CDC3_NCM_NTB_IN_BUF_CNT == 0) @@ -1872,17 +1874,17 @@ uint8_t usbd_cdc3_receive_mps_buf[RUP32(USBD_CDC3_MAX_PACKET1)] __ALIGN #define USBD_CDC3_NCM_NTB_OUT_BUF_SIZE (USBD_CDC3_NCM_NTB_OUT_BUF_CNT*USBD_CDC3_NCM_DW_NTB_OUT_MAX_SIZE) extern uint8_t usbd_cdc3_send_buf [USBD_CDC3_NCM_NTB_IN_BUF_SIZE]; -uint8_t usbd_cdc3_send_buf [USBD_CDC3_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc3_send_buf [USBD_CDC3_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4) USBD_CDC3_BUF_MEM_SECTION; extern uint8_t usbd_cdc3_receive_buf [RUP32(USBD_CDC3_NCM_NTB_OUT_BUF_SIZE)]; -uint8_t usbd_cdc3_receive_buf [RUP32(USBD_CDC3_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_cdc3_receive_buf [RUP32(USBD_CDC3_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32) USBD_CDC3_BUF_MEM_SECTION; #else #define USBD_CDC3_NCM_NTB_IN_BUF_SIZE (0) #define USBD_CDC3_NCM_NTB_OUT_BUF_SIZE (0) #endif extern uint8_t usbd_cdc3_notify_buf [16]; -uint8_t usbd_cdc3_notify_buf [16] __ALIGNED(4); +uint8_t usbd_cdc3_notify_buf [16] __ALIGNED(4) USBD_CDC3_BUF_MEM_SECTION; #endif #endif @@ -1890,19 +1892,19 @@ uint8_t usbd_cdc3_notify_buf [16] __ALIGN #if USBD_CDC4_ACM extern uint8_t usbd_cdc4_send_buf [USBD_CDC4_ACM_SEND_BUF_SIZE]; -uint8_t usbd_cdc4_send_buf [USBD_CDC4_ACM_SEND_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc4_send_buf [USBD_CDC4_ACM_SEND_BUF_SIZE] __ALIGNED(4) USBD_CDC4_BUF_MEM_SECTION; extern uint8_t usbd_cdc4_receive_buf [USBD_CDC4_ACM_RECEIVE_BUF_SIZE]; -uint8_t usbd_cdc4_receive_buf [USBD_CDC4_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc4_receive_buf [USBD_CDC4_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4) USBD_CDC4_BUF_MEM_SECTION; extern uint8_t usbd_cdc4_notify_buf [10]; -uint8_t usbd_cdc4_notify_buf [10] __ALIGNED(4); +uint8_t usbd_cdc4_notify_buf [10] __ALIGNED(4) USBD_CDC4_BUF_MEM_SECTION; extern uint8_t usbd_cdc4_send_mps_buf [USBD_CDC4_MAX_PACKET1]; -uint8_t usbd_cdc4_send_mps_buf [USBD_CDC4_MAX_PACKET1] __ALIGNED(4); +uint8_t usbd_cdc4_send_mps_buf [USBD_CDC4_MAX_PACKET1] __ALIGNED(4) USBD_CDC4_BUF_MEM_SECTION; extern uint8_t usbd_cdc4_receive_mps_buf[RUP32(USBD_CDC4_MAX_PACKET1)]; -uint8_t usbd_cdc4_receive_mps_buf[RUP32(USBD_CDC4_MAX_PACKET1)] __ALIGNED(32); +uint8_t usbd_cdc4_receive_mps_buf[RUP32(USBD_CDC4_MAX_PACKET1)] __ALIGNED(32) USBD_CDC4_BUF_MEM_SECTION; #elif USBD_CDC4_NCM #if (USBD_CDC4_NCM_RAW_ENABLE == 0) #if (USBD_CDC4_NCM_NTB_IN_BUF_CNT == 0) @@ -1919,17 +1921,17 @@ uint8_t usbd_cdc4_receive_mps_buf[RUP32(USBD_CDC4_MAX_PACKET1)] __ALIGN #define USBD_CDC4_NCM_NTB_OUT_BUF_SIZE (USBD_CDC4_NCM_NTB_OUT_BUF_CNT*USBD_CDC4_NCM_DW_NTB_OUT_MAX_SIZE) extern uint8_t usbd_cdc4_send_buf [USBD_CDC4_NCM_NTB_IN_BUF_SIZE]; -uint8_t usbd_cdc4_send_buf [USBD_CDC4_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc4_send_buf [USBD_CDC4_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4) USBD_CDC4_BUF_MEM_SECTION; extern uint8_t usbd_cdc4_receive_buf [RUP32(USBD_CDC4_NCM_NTB_OUT_BUF_SIZE)]; -uint8_t usbd_cdc4_receive_buf [RUP32(USBD_CDC4_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_cdc4_receive_buf [RUP32(USBD_CDC4_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32) USBD_CDC4_BUF_MEM_SECTION; #else #define USBD_CDC4_NCM_NTB_IN_BUF_SIZE (0) #define USBD_CDC4_NCM_NTB_OUT_BUF_SIZE (0) #endif extern uint8_t usbd_cdc4_notify_buf [16]; -uint8_t usbd_cdc4_notify_buf [16] __ALIGNED(4); +uint8_t usbd_cdc4_notify_buf [16] __ALIGNED(4) USBD_CDC4_BUF_MEM_SECTION; #endif #endif @@ -1937,19 +1939,19 @@ uint8_t usbd_cdc4_notify_buf [16] __ALIGN #if USBD_CDC5_ACM extern uint8_t usbd_cdc5_send_buf [USBD_CDC5_ACM_SEND_BUF_SIZE]; -uint8_t usbd_cdc5_send_buf [USBD_CDC5_ACM_SEND_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc5_send_buf [USBD_CDC5_ACM_SEND_BUF_SIZE] __ALIGNED(4) USBD_CDC5_BUF_MEM_SECTION; extern uint8_t usbd_cdc5_receive_buf [USBD_CDC5_ACM_RECEIVE_BUF_SIZE]; -uint8_t usbd_cdc5_receive_buf [USBD_CDC5_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc5_receive_buf [USBD_CDC5_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4) USBD_CDC5_BUF_MEM_SECTION; extern uint8_t usbd_cdc5_notify_buf [10]; -uint8_t usbd_cdc5_notify_buf [10] __ALIGNED(4); +uint8_t usbd_cdc5_notify_buf [10] __ALIGNED(4) USBD_CDC5_BUF_MEM_SECTION; extern uint8_t usbd_cdc5_send_mps_buf [USBD_CDC5_MAX_PACKET1]; -uint8_t usbd_cdc5_send_mps_buf [USBD_CDC5_MAX_PACKET1] __ALIGNED(4); +uint8_t usbd_cdc5_send_mps_buf [USBD_CDC5_MAX_PACKET1] __ALIGNED(4) USBD_CDC5_BUF_MEM_SECTION; extern uint8_t usbd_cdc5_receive_mps_buf[RUP32(USBD_CDC5_MAX_PACKET1)]; -uint8_t usbd_cdc5_receive_mps_buf[RUP32(USBD_CDC5_MAX_PACKET1)] __ALIGNED(32); +uint8_t usbd_cdc5_receive_mps_buf[RUP32(USBD_CDC5_MAX_PACKET1)] __ALIGNED(32) USBD_CDC5_BUF_MEM_SECTION; #elif USBD_CDC5_NCM #if (USBD_CDC5_NCM_RAW_ENABLE == 0) #if (USBD_CDC5_NCM_NTB_IN_BUF_CNT == 0) @@ -1966,17 +1968,17 @@ uint8_t usbd_cdc5_receive_mps_buf[RUP32(USBD_CDC5_MAX_PACKET1)] __ALIGN #define USBD_CDC5_NCM_NTB_OUT_BUF_SIZE (USBD_CDC5_NCM_NTB_OUT_BUF_CNT*USBD_CDC5_NCM_DW_NTB_OUT_MAX_SIZE) extern uint8_t usbd_cdc5_send_buf [USBD_CDC5_NCM_NTB_IN_BUF_SIZE]; -uint8_t usbd_cdc5_send_buf [USBD_CDC5_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc5_send_buf [USBD_CDC5_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4) USBD_CDC5_BUF_MEM_SECTION; extern uint8_t usbd_cdc5_receive_buf [RUP32(USBD_CDC5_NCM_NTB_OUT_BUF_SIZE)]; -uint8_t usbd_cdc5_receive_buf [RUP32(USBD_CDC5_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_cdc5_receive_buf [RUP32(USBD_CDC5_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32) USBD_CDC5_BUF_MEM_SECTION; #else #define USBD_CDC5_NCM_NTB_IN_BUF_SIZE (0) #define USBD_CDC5_NCM_NTB_OUT_BUF_SIZE (0) #endif extern uint8_t usbd_cdc5_notify_buf [16]; -uint8_t usbd_cdc5_notify_buf [16] __ALIGNED(4); +uint8_t usbd_cdc5_notify_buf [16] __ALIGNED(4) USBD_CDC5_BUF_MEM_SECTION; #endif #endif @@ -1984,19 +1986,19 @@ uint8_t usbd_cdc5_notify_buf [16] __ALIGN #if USBD_CDC6_ACM extern uint8_t usbd_cdc6_send_buf [USBD_CDC6_ACM_SEND_BUF_SIZE]; -uint8_t usbd_cdc6_send_buf [USBD_CDC6_ACM_SEND_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc6_send_buf [USBD_CDC6_ACM_SEND_BUF_SIZE] __ALIGNED(4) USBD_CDC6_BUF_MEM_SECTION; extern uint8_t usbd_cdc6_receive_buf [USBD_CDC6_ACM_RECEIVE_BUF_SIZE]; -uint8_t usbd_cdc6_receive_buf [USBD_CDC6_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc6_receive_buf [USBD_CDC6_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4) USBD_CDC6_BUF_MEM_SECTION; extern uint8_t usbd_cdc6_notify_buf [10]; -uint8_t usbd_cdc6_notify_buf [10] __ALIGNED(4); +uint8_t usbd_cdc6_notify_buf [10] __ALIGNED(4) USBD_CDC6_BUF_MEM_SECTION; extern uint8_t usbd_cdc6_send_mps_buf [USBD_CDC6_MAX_PACKET1]; -uint8_t usbd_cdc6_send_mps_buf [USBD_CDC6_MAX_PACKET1] __ALIGNED(4); +uint8_t usbd_cdc6_send_mps_buf [USBD_CDC6_MAX_PACKET1] __ALIGNED(4) USBD_CDC6_BUF_MEM_SECTION; extern uint8_t usbd_cdc6_receive_mps_buf[RUP32(USBD_CDC6_MAX_PACKET1)]; -uint8_t usbd_cdc6_receive_mps_buf[RUP32(USBD_CDC6_MAX_PACKET1)] __ALIGNED(32); +uint8_t usbd_cdc6_receive_mps_buf[RUP32(USBD_CDC6_MAX_PACKET1)] __ALIGNED(32) USBD_CDC6_BUF_MEM_SECTION; #elif USBD_CDC6_NCM #if (USBD_CDC6_NCM_RAW_ENABLE == 0) #if (USBD_CDC6_NCM_NTB_IN_BUF_CNT == 0) @@ -2013,17 +2015,17 @@ uint8_t usbd_cdc6_receive_mps_buf[RUP32(USBD_CDC6_MAX_PACKET1)] __ALIGN #define USBD_CDC6_NCM_NTB_OUT_BUF_SIZE (USBD_CDC6_NCM_NTB_OUT_BUF_CNT*USBD_CDC6_NCM_DW_NTB_OUT_MAX_SIZE) extern uint8_t usbd_cdc6_send_buf [USBD_CDC6_NCM_NTB_IN_BUF_SIZE]; -uint8_t usbd_cdc6_send_buf [USBD_CDC6_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc6_send_buf [USBD_CDC6_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4) USBD_CDC6_BUF_MEM_SECTION; extern uint8_t usbd_cdc6_receive_buf [RUP32(USBD_CDC6_NCM_NTB_OUT_BUF_SIZE)]; -uint8_t usbd_cdc6_receive_buf [RUP32(USBD_CDC6_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_cdc6_receive_buf [RUP32(USBD_CDC6_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32) USBD_CDC6_BUF_MEM_SECTION; #else #define USBD_CDC6_NCM_NTB_IN_BUF_SIZE (0) #define USBD_CDC6_NCM_NTB_OUT_BUF_SIZE (0) #endif extern uint8_t usbd_cdc6_notify_buf [16]; -uint8_t usbd_cdc6_notify_buf [16] __ALIGNED(4); +uint8_t usbd_cdc6_notify_buf [16] __ALIGNED(4) USBD_CDC6_BUF_MEM_SECTION; #endif #endif @@ -2031,19 +2033,19 @@ uint8_t usbd_cdc6_notify_buf [16] __ALIGN #if USBD_CDC7_ACM extern uint8_t usbd_cdc7_send_buf [USBD_CDC7_ACM_SEND_BUF_SIZE]; -uint8_t usbd_cdc7_send_buf [USBD_CDC7_ACM_SEND_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc7_send_buf [USBD_CDC7_ACM_SEND_BUF_SIZE] __ALIGNED(4) USBD_CDC7_BUF_MEM_SECTION; extern uint8_t usbd_cdc7_receive_buf [USBD_CDC7_ACM_RECEIVE_BUF_SIZE]; -uint8_t usbd_cdc7_receive_buf [USBD_CDC7_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc7_receive_buf [USBD_CDC7_ACM_RECEIVE_BUF_SIZE] __ALIGNED(4) USBD_CDC7_BUF_MEM_SECTION; extern uint8_t usbd_cdc7_notify_buf [10]; -uint8_t usbd_cdc7_notify_buf [10] __ALIGNED(4); +uint8_t usbd_cdc7_notify_buf [10] __ALIGNED(4) USBD_CDC7_BUF_MEM_SECTION; extern uint8_t usbd_cdc7_send_mps_buf [USBD_CDC7_MAX_PACKET1]; -uint8_t usbd_cdc7_send_mps_buf [USBD_CDC7_MAX_PACKET1] __ALIGNED(4); +uint8_t usbd_cdc7_send_mps_buf [USBD_CDC7_MAX_PACKET1] __ALIGNED(4) USBD_CDC7_BUF_MEM_SECTION; extern uint8_t usbd_cdc7_receive_mps_buf[RUP32(USBD_CDC7_MAX_PACKET1)]; -uint8_t usbd_cdc7_receive_mps_buf[RUP32(USBD_CDC7_MAX_PACKET1)] __ALIGNED(32); +uint8_t usbd_cdc7_receive_mps_buf[RUP32(USBD_CDC7_MAX_PACKET1)] __ALIGNED(32) USBD_CDC7_BUF_MEM_SECTION; #elif USBD_CDC7_NCM #if (USBD_CDC7_NCM_RAW_ENABLE == 0) #if (USBD_CDC7_NCM_NTB_IN_BUF_CNT == 0) @@ -2060,17 +2062,17 @@ uint8_t usbd_cdc7_receive_mps_buf[RUP32(USBD_CDC7_MAX_PACKET1)] __ALIGN #define USBD_CDC7_NCM_NTB_OUT_BUF_SIZE (USBD_CDC7_NCM_NTB_OUT_BUF_CNT*USBD_CDC7_NCM_DW_NTB_OUT_MAX_SIZE) extern uint8_t usbd_cdc7_send_buf [USBD_CDC7_NCM_NTB_IN_BUF_SIZE]; -uint8_t usbd_cdc7_send_buf [USBD_CDC7_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4); +uint8_t usbd_cdc7_send_buf [USBD_CDC7_NCM_NTB_IN_BUF_SIZE] __ALIGNED(4) USBD_CDC7_BUF_MEM_SECTION; extern uint8_t usbd_cdc7_receive_buf [RUP32(USBD_CDC7_NCM_NTB_OUT_BUF_SIZE)]; -uint8_t usbd_cdc7_receive_buf [RUP32(USBD_CDC7_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_cdc7_receive_buf [RUP32(USBD_CDC7_NCM_NTB_OUT_BUF_SIZE)] __ALIGNED(32) USBD_CDC7_BUF_MEM_SECTION; #else #define USBD_CDC7_NCM_NTB_IN_BUF_SIZE (0) #define USBD_CDC7_NCM_NTB_OUT_BUF_SIZE (0) #endif extern uint8_t usbd_cdc7_notify_buf [16]; -uint8_t usbd_cdc7_notify_buf [16] __ALIGNED(4); +uint8_t usbd_cdc7_notify_buf [16] __ALIGNED(4) USBD_CDC7_BUF_MEM_SECTION; #endif #endif @@ -2738,13 +2740,13 @@ uint8_t usbd_hid0_idle_set [USBD_HID0_IN_REPORT_NUM]; uint8_t usbd_hid0_idle_set [USBD_HID0_IN_REPORT_NUM]; extern uint8_t usbd_hid0_in_report [USBD_HID0_IN_REPORT_MAX_SZ +(USBD_HID0_IN_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid0_in_report [USBD_HID0_IN_REPORT_MAX_SZ +(USBD_HID0_IN_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid0_in_report [USBD_HID0_IN_REPORT_MAX_SZ +(USBD_HID0_IN_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID0_BUF_MEM_SECTION; extern uint8_t usbd_hid0_out_report [RUP32(USBD_HID0_OUT_REPORT_MAX_SZ +(USBD_HID0_OUT_REPORT_MAX_SZ>1))]; -uint8_t usbd_hid0_out_report [RUP32(USBD_HID0_OUT_REPORT_MAX_SZ +(USBD_HID0_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32); +uint8_t usbd_hid0_out_report [RUP32(USBD_HID0_OUT_REPORT_MAX_SZ +(USBD_HID0_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32) USBD_HID0_BUF_MEM_SECTION; extern uint8_t usbd_hid0_feat_report[USBD_HID0_FEAT_REPORT_MAX_SZ+(USBD_HID0_FEAT_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid0_feat_report[USBD_HID0_FEAT_REPORT_MAX_SZ+(USBD_HID0_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid0_feat_report[USBD_HID0_FEAT_REPORT_MAX_SZ+(USBD_HID0_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID0_BUF_MEM_SECTION; #endif #ifdef RTE_USB_Device_HID_1 @@ -2759,13 +2761,13 @@ uint8_t usbd_hid1_idle_set [USBD_HID1_IN_REPORT_NUM]; uint8_t usbd_hid1_idle_set [USBD_HID1_IN_REPORT_NUM]; extern uint8_t usbd_hid1_in_report [USBD_HID1_IN_REPORT_MAX_SZ +(USBD_HID1_IN_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid1_in_report [USBD_HID1_IN_REPORT_MAX_SZ +(USBD_HID1_IN_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid1_in_report [USBD_HID1_IN_REPORT_MAX_SZ +(USBD_HID1_IN_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID1_BUF_MEM_SECTION; extern uint8_t usbd_hid1_out_report [RUP32(USBD_HID1_OUT_REPORT_MAX_SZ +(USBD_HID1_OUT_REPORT_MAX_SZ>1))]; -uint8_t usbd_hid1_out_report [RUP32(USBD_HID1_OUT_REPORT_MAX_SZ +(USBD_HID1_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32); +uint8_t usbd_hid1_out_report [RUP32(USBD_HID1_OUT_REPORT_MAX_SZ +(USBD_HID1_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32) USBD_HID1_BUF_MEM_SECTION; extern uint8_t usbd_hid1_feat_report[USBD_HID1_FEAT_REPORT_MAX_SZ+(USBD_HID1_FEAT_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid1_feat_report[USBD_HID1_FEAT_REPORT_MAX_SZ+(USBD_HID1_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid1_feat_report[USBD_HID1_FEAT_REPORT_MAX_SZ+(USBD_HID1_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID1_BUF_MEM_SECTION; #endif #ifdef RTE_USB_Device_HID_2 @@ -2780,13 +2782,13 @@ uint8_t usbd_hid2_idle_set [USBD_HID2_IN_REPORT_NUM]; uint8_t usbd_hid2_idle_set [USBD_HID2_IN_REPORT_NUM]; extern uint8_t usbd_hid2_in_report [USBD_HID2_IN_REPORT_MAX_SZ +(USBD_HID2_IN_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid2_in_report [USBD_HID2_IN_REPORT_MAX_SZ +(USBD_HID2_IN_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid2_in_report [USBD_HID2_IN_REPORT_MAX_SZ +(USBD_HID2_IN_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID2_BUF_MEM_SECTION; extern uint8_t usbd_hid2_out_report [RUP32(USBD_HID2_OUT_REPORT_MAX_SZ +(USBD_HID2_OUT_REPORT_MAX_SZ>1))]; -uint8_t usbd_hid2_out_report [RUP32(USBD_HID2_OUT_REPORT_MAX_SZ +(USBD_HID2_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32); +uint8_t usbd_hid2_out_report [RUP32(USBD_HID2_OUT_REPORT_MAX_SZ +(USBD_HID2_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32) USBD_HID2_BUF_MEM_SECTION; extern uint8_t usbd_hid2_feat_report[USBD_HID2_FEAT_REPORT_MAX_SZ+(USBD_HID2_FEAT_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid2_feat_report[USBD_HID2_FEAT_REPORT_MAX_SZ+(USBD_HID2_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid2_feat_report[USBD_HID2_FEAT_REPORT_MAX_SZ+(USBD_HID2_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID2_BUF_MEM_SECTION; #endif #ifdef RTE_USB_Device_HID_3 @@ -2801,13 +2803,13 @@ uint8_t usbd_hid3_idle_set [USBD_HID3_IN_REPORT_NUM]; uint8_t usbd_hid3_idle_set [USBD_HID3_IN_REPORT_NUM]; extern uint8_t usbd_hid3_in_report [USBD_HID3_IN_REPORT_MAX_SZ +(USBD_HID3_IN_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid3_in_report [USBD_HID3_IN_REPORT_MAX_SZ +(USBD_HID3_IN_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid3_in_report [USBD_HID3_IN_REPORT_MAX_SZ +(USBD_HID3_IN_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID3_BUF_MEM_SECTION; extern uint8_t usbd_hid3_out_report [RUP32(USBD_HID3_OUT_REPORT_MAX_SZ +(USBD_HID3_OUT_REPORT_MAX_SZ>1))]; -uint8_t usbd_hid3_out_report [RUP32(USBD_HID3_OUT_REPORT_MAX_SZ +(USBD_HID3_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32); +uint8_t usbd_hid3_out_report [RUP32(USBD_HID3_OUT_REPORT_MAX_SZ +(USBD_HID3_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32) USBD_HID3_BUF_MEM_SECTION; extern uint8_t usbd_hid3_feat_report[USBD_HID3_FEAT_REPORT_MAX_SZ+(USBD_HID3_FEAT_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid3_feat_report[USBD_HID3_FEAT_REPORT_MAX_SZ+(USBD_HID3_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid3_feat_report[USBD_HID3_FEAT_REPORT_MAX_SZ+(USBD_HID3_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID3_BUF_MEM_SECTION; #endif #ifdef RTE_USB_Device_HID_4 @@ -2822,13 +2824,13 @@ uint8_t usbd_hid4_idle_set [USBD_HID4_IN_REPORT_NUM]; uint8_t usbd_hid4_idle_set [USBD_HID4_IN_REPORT_NUM]; extern uint8_t usbd_hid4_in_report [USBD_HID4_IN_REPORT_MAX_SZ +(USBD_HID4_IN_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid4_in_report [USBD_HID4_IN_REPORT_MAX_SZ +(USBD_HID4_IN_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid4_in_report [USBD_HID4_IN_REPORT_MAX_SZ +(USBD_HID4_IN_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID4_BUF_MEM_SECTION; extern uint8_t usbd_hid4_out_report [RUP32(USBD_HID4_OUT_REPORT_MAX_SZ +(USBD_HID4_OUT_REPORT_MAX_SZ>1))]; -uint8_t usbd_hid4_out_report [RUP32(USBD_HID4_OUT_REPORT_MAX_SZ +(USBD_HID4_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32); +uint8_t usbd_hid4_out_report [RUP32(USBD_HID4_OUT_REPORT_MAX_SZ +(USBD_HID4_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32) USBD_HID4_BUF_MEM_SECTION; extern uint8_t usbd_hid4_feat_report[USBD_HID4_FEAT_REPORT_MAX_SZ+(USBD_HID4_FEAT_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid4_feat_report[USBD_HID4_FEAT_REPORT_MAX_SZ+(USBD_HID4_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid4_feat_report[USBD_HID4_FEAT_REPORT_MAX_SZ+(USBD_HID4_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID4_BUF_MEM_SECTION; #endif #ifdef RTE_USB_Device_HID_5 @@ -2843,13 +2845,13 @@ uint8_t usbd_hid5_idle_set [USBD_HID5_IN_REPORT_NUM]; uint8_t usbd_hid5_idle_set [USBD_HID5_IN_REPORT_NUM]; extern uint8_t usbd_hid5_in_report [USBD_HID5_IN_REPORT_MAX_SZ +(USBD_HID5_IN_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid5_in_report [USBD_HID5_IN_REPORT_MAX_SZ +(USBD_HID5_IN_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid5_in_report [USBD_HID5_IN_REPORT_MAX_SZ +(USBD_HID5_IN_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID5_BUF_MEM_SECTION; extern uint8_t usbd_hid5_out_report [RUP32(USBD_HID5_OUT_REPORT_MAX_SZ +(USBD_HID5_OUT_REPORT_MAX_SZ>1))]; -uint8_t usbd_hid5_out_report [RUP32(USBD_HID5_OUT_REPORT_MAX_SZ +(USBD_HID5_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32); +uint8_t usbd_hid5_out_report [RUP32(USBD_HID5_OUT_REPORT_MAX_SZ +(USBD_HID5_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32) USBD_HID5_BUF_MEM_SECTION; extern uint8_t usbd_hid5_feat_report[USBD_HID5_FEAT_REPORT_MAX_SZ+(USBD_HID5_FEAT_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid5_feat_report[USBD_HID5_FEAT_REPORT_MAX_SZ+(USBD_HID5_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid5_feat_report[USBD_HID5_FEAT_REPORT_MAX_SZ+(USBD_HID5_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID5_BUF_MEM_SECTION; #endif #ifdef RTE_USB_Device_HID_6 @@ -2864,13 +2866,13 @@ uint8_t usbd_hid6_idle_set [USBD_HID6_IN_REPORT_NUM]; uint8_t usbd_hid6_idle_set [USBD_HID6_IN_REPORT_NUM]; extern uint8_t usbd_hid6_in_report [USBD_HID6_IN_REPORT_MAX_SZ +(USBD_HID6_IN_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid6_in_report [USBD_HID6_IN_REPORT_MAX_SZ +(USBD_HID6_IN_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid6_in_report [USBD_HID6_IN_REPORT_MAX_SZ +(USBD_HID6_IN_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID6_BUF_MEM_SECTION; extern uint8_t usbd_hid6_out_report [RUP32(USBD_HID6_OUT_REPORT_MAX_SZ +(USBD_HID6_OUT_REPORT_MAX_SZ>1))]; -uint8_t usbd_hid6_out_report [RUP32(USBD_HID6_OUT_REPORT_MAX_SZ +(USBD_HID6_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32); +uint8_t usbd_hid6_out_report [RUP32(USBD_HID6_OUT_REPORT_MAX_SZ +(USBD_HID6_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32) USBD_HID6_BUF_MEM_SECTION; extern uint8_t usbd_hid6_feat_report[USBD_HID6_FEAT_REPORT_MAX_SZ+(USBD_HID6_FEAT_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid6_feat_report[USBD_HID6_FEAT_REPORT_MAX_SZ+(USBD_HID6_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid6_feat_report[USBD_HID6_FEAT_REPORT_MAX_SZ+(USBD_HID6_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID6_BUF_MEM_SECTION; #endif #ifdef RTE_USB_Device_HID_7 @@ -2885,13 +2887,13 @@ uint8_t usbd_hid7_idle_set [USBD_HID7_IN_REPORT_NUM]; uint8_t usbd_hid7_idle_set [USBD_HID7_IN_REPORT_NUM]; extern uint8_t usbd_hid7_in_report [USBD_HID7_IN_REPORT_MAX_SZ +(USBD_HID7_IN_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid7_in_report [USBD_HID7_IN_REPORT_MAX_SZ +(USBD_HID7_IN_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid7_in_report [USBD_HID7_IN_REPORT_MAX_SZ +(USBD_HID7_IN_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID7_BUF_MEM_SECTION; extern uint8_t usbd_hid7_out_report [RUP32(USBD_HID7_OUT_REPORT_MAX_SZ +(USBD_HID7_OUT_REPORT_MAX_SZ>1))]; -uint8_t usbd_hid7_out_report [RUP32(USBD_HID7_OUT_REPORT_MAX_SZ +(USBD_HID7_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32); +uint8_t usbd_hid7_out_report [RUP32(USBD_HID7_OUT_REPORT_MAX_SZ +(USBD_HID7_OUT_REPORT_MAX_SZ>1))] __ALIGNED(32) USBD_HID7_BUF_MEM_SECTION; extern uint8_t usbd_hid7_feat_report[USBD_HID7_FEAT_REPORT_MAX_SZ+(USBD_HID7_FEAT_REPORT_MAX_SZ>1)]; -uint8_t usbd_hid7_feat_report[USBD_HID7_FEAT_REPORT_MAX_SZ+(USBD_HID7_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4); +uint8_t usbd_hid7_feat_report[USBD_HID7_FEAT_REPORT_MAX_SZ+(USBD_HID7_FEAT_REPORT_MAX_SZ>1)] __ALIGNED(4) USBD_HID7_BUF_MEM_SECTION; #endif extern @@ -3194,28 +3196,28 @@ void *usbd_msc_thread_id [USBD_MSC_NUM]; extern void USBD_MSC0_Thread (void const *arg); extern uint8_t usbd_msc0_bulk_buf [RUP32(USBD_MSC0_BULK_BUF_SIZE)]; -uint8_t usbd_msc0_bulk_buf [RUP32(USBD_MSC0_BULK_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_msc0_bulk_buf [RUP32(USBD_MSC0_BULK_BUF_SIZE)] __ALIGNED(32) USBD_MSC0_BUF_MEM_SECTION; #endif #ifdef RTE_USB_Device_MSC_1 extern void USBD_MSC1_Thread (void const *arg); extern uint8_t usbd_msc1_bulk_buf [RUP32(USBD_MSC1_BULK_BUF_SIZE)]; -uint8_t usbd_msc1_bulk_buf [RUP32(USBD_MSC1_BULK_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_msc1_bulk_buf [RUP32(USBD_MSC1_BULK_BUF_SIZE)] __ALIGNED(32) USBD_MSC1_BUF_MEM_SECTION; #endif #ifdef RTE_USB_Device_MSC_2 extern void USBD_MSC2_Thread (void const *arg); extern uint8_t usbd_msc2_bulk_buf [RUP32(USBD_MSC2_BULK_BUF_SIZE)]; -uint8_t usbd_msc2_bulk_buf [RUP32(USBD_MSC2_BULK_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_msc2_bulk_buf [RUP32(USBD_MSC2_BULK_BUF_SIZE)] __ALIGNED(32) USBD_MSC2_BUF_MEM_SECTION; #endif #ifdef RTE_USB_Device_MSC_3 extern void USBD_MSC3_Thread (void const *arg); extern uint8_t usbd_msc3_bulk_buf [RUP32(USBD_MSC3_BULK_BUF_SIZE)]; -uint8_t usbd_msc3_bulk_buf [RUP32(USBD_MSC3_BULK_BUF_SIZE)] __ALIGNED(32); +uint8_t usbd_msc3_bulk_buf [RUP32(USBD_MSC3_BULK_BUF_SIZE)] __ALIGNED(32) USBD_MSC3_BUF_MEM_SECTION; #endif extern diff --git a/Components/USB/Source/usbd_config_dev_0.c b/Components/USB/Source/usbd_config_dev_0.c index 59dd9e99..1eccb889 100644 --- a/Components/USB/Source/usbd_config_dev_0.c +++ b/Components/USB/Source/usbd_config_dev_0.c @@ -15,7 +15,7 @@ uint8_t usbd0_alt_setting [USBD0_IF_CNT]; uint8_t usbd0_alt_setting [USBD0_IF_CNT]; extern uint8_t usbd0_ep0_buf [((USBD0_EP0_BUF_SIZE+31)/32)*32]; -uint8_t usbd0_ep0_buf [((USBD0_EP0_BUF_SIZE+31)/32)*32] __ALIGNED(32); +uint8_t usbd0_ep0_buf [((USBD0_EP0_BUF_SIZE+31)/32)*32] __ALIGNED(32) USBD0_DEV_BUF_MEM_SECTION; extern usbd_data_t usbd0_data; usbd_data_t usbd0_data; diff --git a/Components/USB/Source/usbd_config_dev_1.c b/Components/USB/Source/usbd_config_dev_1.c index 9e556fd1..875fd481 100644 --- a/Components/USB/Source/usbd_config_dev_1.c +++ b/Components/USB/Source/usbd_config_dev_1.c @@ -15,7 +15,7 @@ uint8_t usbd1_alt_setting [USBD1_IF_CNT]; uint8_t usbd1_alt_setting [USBD1_IF_CNT]; extern uint8_t usbd1_ep0_buf [((USBD1_EP0_BUF_SIZE+31)/32)*32]; -uint8_t usbd1_ep0_buf [((USBD1_EP0_BUF_SIZE+31)/32)*32] __ALIGNED(32); +uint8_t usbd1_ep0_buf [((USBD1_EP0_BUF_SIZE+31)/32)*32] __ALIGNED(32) USBD1_DEV_BUF_MEM_SECTION; extern usbd_data_t usbd1_data; usbd_data_t usbd1_data; diff --git a/Components/USB/Source/usbd_config_dev_2.c b/Components/USB/Source/usbd_config_dev_2.c index 69eb299d..00f33cbc 100644 --- a/Components/USB/Source/usbd_config_dev_2.c +++ b/Components/USB/Source/usbd_config_dev_2.c @@ -15,7 +15,7 @@ uint8_t usbd2_alt_setting [USBD2_IF_CNT]; uint8_t usbd2_alt_setting [USBD2_IF_CNT]; extern uint8_t usbd2_ep0_buf [((USBD2_EP0_BUF_SIZE+31)/32)*32]; -uint8_t usbd2_ep0_buf [((USBD2_EP0_BUF_SIZE+31)/32)*32] __ALIGNED(32); +uint8_t usbd2_ep0_buf [((USBD2_EP0_BUF_SIZE+31)/32)*32] __ALIGNED(32) USBD2_DEV_BUF_MEM_SECTION; extern usbd_data_t usbd2_data; usbd_data_t usbd2_data; diff --git a/Components/USB/Source/usbd_config_dev_3.c b/Components/USB/Source/usbd_config_dev_3.c index acdd1449..28894389 100644 --- a/Components/USB/Source/usbd_config_dev_3.c +++ b/Components/USB/Source/usbd_config_dev_3.c @@ -15,7 +15,7 @@ uint8_t usbd3_alt_setting [USBD3_IF_CNT]; uint8_t usbd3_alt_setting [USBD3_IF_CNT]; extern uint8_t usbd3_ep0_buf [((USBD3_EP0_BUF_SIZE+31)/32)*32]; -uint8_t usbd3_ep0_buf [((USBD3_EP0_BUF_SIZE+31)/32)*32] __ALIGNED(32); +uint8_t usbd3_ep0_buf [((USBD3_EP0_BUF_SIZE+31)/32)*32] __ALIGNED(32) USBD3_DEV_BUF_MEM_SECTION; extern usbd_data_t usbd3_data; usbd_data_t usbd3_data; diff --git a/Components/USB/Source/usbd_section.h b/Components/USB/Source/usbd_section.h new file mode 100644 index 00000000..184848e0 --- /dev/null +++ b/Components/USB/Source/usbd_section.h @@ -0,0 +1,153 @@ +/*------------------------------------------------------------------------------ + * MDK Middleware - Component ::USB:Device + * Copyright (c) 2024 Arm Limited (or its affiliates). All rights reserved. + *------------------------------------------------------------------------------ + * Name: usbd_section.h + * Purpose: USB Device (USBD) - Section definitions + *----------------------------------------------------------------------------*/ + +#ifndef USBD_SECTION_ +#define USBD_SECTION_ + +/*------------------------------------------------------------------------------ + * USB Device 0..3 section defines + *----------------------------------------------------------------------------*/ + +#define USBDn_DEV_BUF_MEM_SECTION_(str) __attribute__((section(str))) + +#ifdef USBD0_PORT +#if (USBD0_BUF_MEM_RELOC == 1) +#define USBD0_DEV_BUF_MEM_SECTION USBDn_DEV_BUF_MEM_SECTION_(USBD0_BUF_MEM_SECTION_NAME) +#else +#define USBD0_DEV_BUF_MEM_SECTION +#endif +#endif + +#ifdef USBD1_PORT +#if (USBD1_BUF_MEM_RELOC == 1) +#define USBD1_DEV_BUF_MEM_SECTION USBDn_DEV_BUF_MEM_SECTION_(USBD1_BUF_MEM_SECTION_NAME) +#else +#define USBD1_DEV_BUF_MEM_SECTION +#endif +#endif + +#ifdef USBD2_PORT +#if (USBD2_BUF_MEM_RELOC == 1) +#define USBD2_DEV_BUF_MEM_SECTION USBDn_DEV_BUF_MEM_SECTION_(USBD2_BUF_MEM_SECTION_NAME) +#else +#define USBD2_DEV_BUF_MEM_SECTION +#endif +#endif + +#ifdef USBD3_PORT +#if (USBD3_BUF_MEM_RELOC == 1) +#define USBD3_DEV_BUF_MEM_SECTION USBDn_DEV_BUF_MEM_SECTION_(USBD3_BUF_MEM_SECTION_NAME) +#else +#define USBD3_DEV_BUF_MEM_SECTION +#endif +#endif + +#define USBDn_BUF_MEM_SECTION__(dev) USBD##dev##_DEV_BUF_MEM_SECTION +#define USBDn_BUF_MEM_SECTION_(dev) USBDn_BUF_MEM_SECTION__(dev) + +/*------------------------------------------------------------------------------ + * USB Device ADC 0..3 section defines + *----------------------------------------------------------------------------*/ + +#define USBD_ADCn_BUF_MEM_SECTION(n) USBDn_BUF_MEM_SECTION_(USBD_ADC##n##_DEV) + +#ifdef RTE_USB_Device_ADC_0 +#define USBD_ADC0_BUF_MEM_SECTION USBD_ADCn_BUF_MEM_SECTION(0) +#endif +#ifdef RTE_USB_Device_ADC_1 +#define USBD_ADC1_BUF_MEM_SECTION USBD_ADCn_BUF_MEM_SECTION(1) +#endif +#ifdef RTE_USB_Device_ADC_2 +#define USBD_ADC2_BUF_MEM_SECTION USBD_ADCn_BUF_MEM_SECTION(2) +#endif +#ifdef RTE_USB_Device_ADC_3 +#define USBD_ADC3_BUF_MEM_SECTION USBD_ADCn_BUF_MEM_SECTION(3) +#endif + +/*------------------------------------------------------------------------------ + * USB Device CDC 0..7 section defines + *----------------------------------------------------------------------------*/ + +#define USBD_CDCn_BUF_MEM_SECTION(n) USBDn_BUF_MEM_SECTION_(USBD_CDC##n##_DEV) + +#ifdef RTE_USB_Device_CDC_0 +#define USBD_CDC0_BUF_MEM_SECTION USBD_CDCn_BUF_MEM_SECTION(0) +#endif +#ifdef RTE_USB_Device_CDC_1 +#define USBD_CDC1_BUF_MEM_SECTION USBD_CDCn_BUF_MEM_SECTION(1) +#endif +#ifdef RTE_USB_Device_CDC_2 +#define USBD_CDC2_BUF_MEM_SECTION USBD_CDCn_BUF_MEM_SECTION(2) +#endif +#ifdef RTE_USB_Device_CDC_3 +#define USBD_CDC3_BUF_MEM_SECTION USBD_CDCn_BUF_MEM_SECTION(3) +#endif +#ifdef RTE_USB_Device_CDC_4 +#define USBD_CDC4_BUF_MEM_SECTION USBD_CDCn_BUF_MEM_SECTION(4) +#endif +#ifdef RTE_USB_Device_CDC_5 +#define USBD_CDC5_BUF_MEM_SECTION USBD_CDCn_BUF_MEM_SECTION(5) +#endif +#ifdef RTE_USB_Device_CDC_6 +#define USBD_CDC6_BUF_MEM_SECTION USBD_CDCn_BUF_MEM_SECTION(6) +#endif +#ifdef RTE_USB_Device_CDC_7 +#define USBD_CDC7_BUF_MEM_SECTION USBD_CDCn_BUF_MEM_SECTION(7) +#endif + +/*------------------------------------------------------------------------------ + * USB Device HID 0..7 section defines + *----------------------------------------------------------------------------*/ + +#define USBD_HIDn_BUF_MEM_SECTION(n) USBDn_BUF_MEM_SECTION_(USBD_HID##n##_DEV) + +#ifdef RTE_USB_Device_HID_0 +#define USBD_HID0_BUF_MEM_SECTION USBD_HIDn_BUF_MEM_SECTION(0) +#endif +#ifdef RTE_USB_Device_HID_1 +#define USBD_HID1_BUF_MEM_SECTION USBD_HIDn_BUF_MEM_SECTION(1) +#endif +#ifdef RTE_USB_Device_HID_2 +#define USBD_HID2_BUF_MEM_SECTION USBD_HIDn_BUF_MEM_SECTION(2) +#endif +#ifdef RTE_USB_Device_HID_3 +#define USBD_HID3_BUF_MEM_SECTION USBD_HIDn_BUF_MEM_SECTION(3) +#endif +#ifdef RTE_USB_Device_HID_4 +#define USBD_HID4_BUF_MEM_SECTION USBD_HIDn_BUF_MEM_SECTION(4) +#endif +#ifdef RTE_USB_Device_HID_5 +#define USBD_HID5_BUF_MEM_SECTION USBD_HIDn_BUF_MEM_SECTION(5) +#endif +#ifdef RTE_USB_Device_HID_6 +#define USBD_HID6_BUF_MEM_SECTION USBD_HIDn_BUF_MEM_SECTION(6) +#endif +#ifdef RTE_USB_Device_HID_7 +#define USBD_HID7_BUF_MEM_SECTION USBD_HIDn_BUF_MEM_SECTION(7) +#endif + +/*------------------------------------------------------------------------------ + * USB Device MSC 0..3 section defines + *----------------------------------------------------------------------------*/ + +#define USBD_MSCn_BUF_MEM_SECTION(n) USBDn_BUF_MEM_SECTION_(USBD_MSC##n##_DEV) + +#ifdef RTE_USB_Device_MSC_0 +#define USBD_MSC0_BUF_MEM_SECTION USBD_MSCn_BUF_MEM_SECTION(0) +#endif +#ifdef RTE_USB_Device_MSC_1 +#define USBD_MSC1_BUF_MEM_SECTION USBD_MSCn_BUF_MEM_SECTION(1) +#endif +#ifdef RTE_USB_Device_MSC_2 +#define USBD_MSC2_BUF_MEM_SECTION USBD_MSCn_BUF_MEM_SECTION(2) +#endif +#ifdef RTE_USB_Device_MSC_3 +#define USBD_MSC3_BUF_MEM_SECTION USBD_MSCn_BUF_MEM_SECTION(3) +#endif + +#endif // USBD_SECTION_ diff --git a/Documentation/Doxygen/USB/src/images/usbd_config_0_h.png b/Documentation/Doxygen/USB/src/images/usbd_config_0_h.png index 7ba6ae0a..636fd945 100644 Binary files a/Documentation/Doxygen/USB/src/images/usbd_config_0_h.png and b/Documentation/Doxygen/USB/src/images/usbd_config_0_h.png differ diff --git a/Documentation/Doxygen/USB/src/rl_usb.txt b/Documentation/Doxygen/USB/src/rl_usb.txt index 4df11196..3b9d8068 100644 --- a/Documentation/Doxygen/USB/src/rl_usb.txt +++ b/Documentation/Doxygen/USB/src/rl_usb.txt @@ -638,6 +638,10 @@ The configuration file USBD_Config_n.h contains the following sett - Enable OS String for device to contain Microsoft OS string descriptor. - Vendor Code specifies the vendor code used to retrieve associated feature descriptors. - Control Transfer Buffer Size specifies the maximum size of control transfer. +- Data Buffers specifies the relocation of the USB data buffers in memory. + - Relocate specifies if the USB data buffers are relocated to a specific memory address (via the linker script). + - Section Name specifies the section name for the USB data buffers that is used by the linker script to position it in memory. + Default section name is .driver.usbd, for example for USB Device 0 the default section name is .driver.usbd0. - Use the OS Resources Settings to optimize the usage of OS resources. - The default Core Thread Stack Size is \a 1024 bytes. - The default Core Thread priority is osPriorityAboveNormal. diff --git a/Examples/USB/Device/HID/RTE/USB/USBD_Config_0.h b/Examples/USB/Device/HID/RTE/USB/USBD_Config_0.h index 65d03056..6953d1a8 100644 --- a/Examples/USB/Device/HID/RTE/USB/USBD_Config_0.h +++ b/Examples/USB/Device/HID/RTE/USB/USBD_Config_0.h @@ -118,6 +118,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD0_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD0_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD0_BUF_MEM_SECTION_NAME ".driver.usbd0" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/Examples/USB/Device/HID/RTE/USB/USBD_Config_0.h.base@8.0.0 b/Examples/USB/Device/HID/RTE/USB/USBD_Config_0.h.base@8.0.0 index 8508d108..0e941fbf 100644 --- a/Examples/USB/Device/HID/RTE/USB/USBD_Config_0.h.base@8.0.0 +++ b/Examples/USB/Device/HID/RTE/USB/USBD_Config_0.h.base@8.0.0 @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD0_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD0_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD0_BUF_MEM_SECTION_NAME ".driver.usbd0" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/Examples/USB/Device/MassStorage/RTE/USB/USBD_Config_0.h b/Examples/USB/Device/MassStorage/RTE/USB/USBD_Config_0.h index 3d00252d..7adcfcb4 100644 --- a/Examples/USB/Device/MassStorage/RTE/USB/USBD_Config_0.h +++ b/Examples/USB/Device/MassStorage/RTE/USB/USBD_Config_0.h @@ -118,6 +118,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD0_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD0_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD0_BUF_MEM_SECTION_NAME ".driver.usbd0" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/Examples/USB/Device/MassStorage/RTE/USB/USBD_Config_0.h.base@8.0.0 b/Examples/USB/Device/MassStorage/RTE/USB/USBD_Config_0.h.base@8.0.0 index 8508d108..0e941fbf 100644 --- a/Examples/USB/Device/MassStorage/RTE/USB/USBD_Config_0.h.base@8.0.0 +++ b/Examples/USB/Device/MassStorage/RTE/USB/USBD_Config_0.h.base@8.0.0 @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD0_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD0_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD0_BUF_MEM_SECTION_NAME ".driver.usbd0" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/Examples/USB/Device/VirtualCOM/RTE/USB/USBD_Config_0.h b/Examples/USB/Device/VirtualCOM/RTE/USB/USBD_Config_0.h index b78f431b..355f615a 100644 --- a/Examples/USB/Device/VirtualCOM/RTE/USB/USBD_Config_0.h +++ b/Examples/USB/Device/VirtualCOM/RTE/USB/USBD_Config_0.h @@ -118,6 +118,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD0_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD0_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD0_BUF_MEM_SECTION_NAME ".driver.usbd0" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536> diff --git a/Examples/USB/Device/VirtualCOM/RTE/USB/USBD_Config_0.h.base@8.0.0 b/Examples/USB/Device/VirtualCOM/RTE/USB/USBD_Config_0.h.base@8.0.0 index 8508d108..0e941fbf 100644 --- a/Examples/USB/Device/VirtualCOM/RTE/USB/USBD_Config_0.h.base@8.0.0 +++ b/Examples/USB/Device/VirtualCOM/RTE/USB/USBD_Config_0.h.base@8.0.0 @@ -112,6 +112,19 @@ // It should be at least as big as maximum packet size for Endpoint 0. #define USBD0_EP0_BUF_SIZE 128 +// Data Buffers +// Relocate +// Specifies if the USB data buffers are located at a specific memory address +// (via the linker script). +#define USBD0_BUF_MEM_RELOC 0 + +// Section Name +// Specifies the section name for the USB data buffers +// (for positioning via the linker script). +#define USBD0_BUF_MEM_SECTION_NAME ".driver.usbd0" +// +// + // OS Resources Settings // These settings are used to optimize usage of OS resources. // Core Thread Stack Size <64-65536>