Skip to content

Commit 1cec005

Browse files
committed
examples/device/*_freertos: expand stack size when needed
All four of these examples immediately crashed on stack overflow when connected, at least on a FRDM_K64F board. In 46fd822 the default freertos stack size was increased, but _only_ for stm32? Perhaps either all platform examples need the default increased, rather than increasing the problem task stacks as is done here. Signed-off-by: Karl Palsson <[email protected]>
1 parent 43e6c9d commit 1cec005

File tree

4 files changed

+4
-4
lines changed
  • examples
    • device
    • host/cdc_msc_hid_freertos/src

4 files changed

+4
-4
lines changed

examples/device/cdc_msc_freertos/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2) * (CFG_TUSB_DEBUG ? 2 : 1)
3838
#endif
3939

40-
#define CDC_STACK_SIZE configMINIMAL_STACK_SIZE
40+
#define CDC_STACK_SIZE 2*configMINIMAL_STACK_SIZE
4141
#define BLINKY_STACK_SIZE configMINIMAL_STACK_SIZE
4242

4343
//--------------------------------------------------------------------+

examples/device/hid_composite_freertos/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2) * (CFG_TUSB_DEBUG ? 2 : 1)
5454
#endif
5555

56-
#define HID_STACK_SZIE configMINIMAL_STACK_SIZE
56+
#define HID_STACK_SZIE 2*configMINIMAL_STACK_SIZE
5757

5858
//--------------------------------------------------------------------+
5959
// MACRO CONSTANT TYPEDEF PROTYPES

examples/device/midi_test_freertos/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#endif
4949

5050
#define BLINKY_STACK_SIZE configMINIMAL_STACK_SIZE
51-
#define MIDI_STACK_SIZE configMINIMAL_STACK_SIZE
51+
#define MIDI_STACK_SIZE 2*configMINIMAL_STACK_SIZE
5252

5353
// static task
5454
#if configSUPPORT_STATIC_ALLOCATION

examples/host/cdc_msc_hid_freertos/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#define USBH_STACK_SIZE 4096
3535
#else
3636
// Increase stack size when debug log is enabled
37-
#define USBH_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2) * (CFG_TUSB_DEBUG ? 2 : 1)
37+
#define USBH_STACK_SIZE (4*configMINIMAL_STACK_SIZE/2) * (CFG_TUSB_DEBUG ? 2 : 1)
3838
#endif
3939

4040

0 commit comments

Comments
 (0)