From c1fbb4ae5641bc1318d67834522fd202074fdb04 Mon Sep 17 00:00:00 2001 From: sakimisu <1203593632@qq.com> Date: Fri, 26 May 2023 19:33:30 +0800 Subject: [PATCH] copy desc into nocache ram --- core/usbd_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/usbd_core.c b/core/usbd_core.c index 4d1701cb..48723df9 100644 --- a/core/usbd_core.c +++ b/core/usbd_core.c @@ -289,7 +289,8 @@ static bool usbd_get_descriptor(uint16_t type_index, uint8_t **data, uint32_t *l return false; } - *data = (uint8_t *)msosv1_desc->string; + //*data = (uint8_t *)msosv1_desc->string; + memcpy(*data, (uint8_t *)msosv1_desc->string, msosv1_desc->string_len); *len = msosv1_desc->string_len; return true; @@ -300,7 +301,8 @@ static bool usbd_get_descriptor(uint16_t type_index, uint8_t **data, uint32_t *l return false; } - *data = bos_desc->string; + //*data = bos_desc->string; + memcpy(*data, (uint8_t *)bos_desc->string, bos_desc->string_len); *len = bos_desc->string_len; return true; }