From e50ad40814b077d19f07447afec27b374e495e7a Mon Sep 17 00:00:00 2001 From: mojyack Date: Thu, 27 Nov 2025 17:16:14 +0900 Subject: [PATCH] usb: increase usb thread stack size Change-Id: I07283a68056e095efba8019dac2aa37d65c0ef6c --- firmware/usb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/firmware/usb.c b/firmware/usb.c index c3e35d22b3..ae9778c299 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -86,7 +86,12 @@ static int usb_mmc_countdown = 0; #ifndef USB_EXTRA_STACK # define USB_EXTRA_STACK 0x0 /*Define in firmware/export/config/[target].h*/ #endif -static long usb_stack[(DEFAULT_STACK_SIZE*4 + DUMP_BMP_LINESIZE + USB_EXTRA_STACK)/sizeof(long)]; +#ifdef USB_ENABLE_IAP +#define IAP_EXTRA_STACK DEFAULT_STACK_SIZE*2 +#else +#define IAP_EXTRA_STACK 0 +#endif +static long usb_stack[(DEFAULT_STACK_SIZE*4 + DUMP_BMP_LINESIZE + IAP_EXTRA_STACK + USB_EXTRA_STACK)/sizeof(long)]; static const char usb_thread_name[] = "usb"; static unsigned int usb_thread_entry = 0; static bool usb_monitor_enabled = false;