From a62044d89bae480209f01e2f660cd92079a86a71 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Wed, 28 Sep 2022 16:05:02 +0200 Subject: [PATCH] targets: do not set stack size per board The needed stack size is hard to determine by the compiler. It will try, but will fail in many common cases. Therefore, the runtime will pick a fixed stack size. There is a tradeoff between avoiding stack overflows and wasting RAM. This tradeoff depends on the application: some don't need large stack sizes but do need a lot of memory, while others need deep stacks but aren't so memory constrained. That's why I've added a flag to do this on the command line: https://github.com/tinygo-org/tinygo/pull/3159 It may be reasonable to use a different stack size per chip, for example chips with lots of RAM could default to a larger stack size. But I don't think it's a good idea to do this per board. --- targets/atsame54-xpro.json | 3 +-- targets/feather-m4-can.json | 3 +-- targets/qtpy-rp2040.json | 3 +-- targets/teensy40.json | 1 - targets/teensy41.json | 1 - 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/targets/atsame54-xpro.json b/targets/atsame54-xpro.json index 1ab7c4ee..b50e79f3 100644 --- a/targets/atsame54-xpro.json +++ b/targets/atsame54-xpro.json @@ -3,6 +3,5 @@ "build-tags": ["atsame54_xpro"], "serial": "usb", "flash-method": "openocd", - "openocd-interface": "cmsis-dap", - "default-stack-size": 4096 + "openocd-interface": "cmsis-dap" } diff --git a/targets/feather-m4-can.json b/targets/feather-m4-can.json index c7a37c7c..8a74e81f 100644 --- a/targets/feather-m4-can.json +++ b/targets/feather-m4-can.json @@ -6,6 +6,5 @@ "flash-1200-bps-reset": "true", "flash-method": "msd", "msd-volume-name": "FTHRCANBOOT", - "msd-firmware-name": "firmware.uf2", - "default-stack-size": 4096 + "msd-firmware-name": "firmware.uf2" } diff --git a/targets/qtpy-rp2040.json b/targets/qtpy-rp2040.json index e1675ee8..9ed6e762 100644 --- a/targets/qtpy-rp2040.json +++ b/targets/qtpy-rp2040.json @@ -7,6 +7,5 @@ "linkerscript": "targets/qtpy-rp2040.ld", "extra-files": [ "targets/qtpy-rp2040-boot-stage2.S" - ], - "default-stack-size": 4096 + ] } diff --git a/targets/teensy40.json b/targets/teensy40.json index c530003b..223db6f6 100644 --- a/targets/teensy40.json +++ b/targets/teensy40.json @@ -3,7 +3,6 @@ "build-tags": ["teensy40", "teensy", "mimxrt1062", "nxp"], "serial": "uart", "automatic-stack-size": false, - "default-stack-size": 4096, "linkerscript": "targets/mimxrt1062-teensy40.ld", "extra-files": [ "src/device/nxp/mimxrt1062.s", diff --git a/targets/teensy41.json b/targets/teensy41.json index 85c93ff9..8866bc48 100644 --- a/targets/teensy41.json +++ b/targets/teensy41.json @@ -3,7 +3,6 @@ "build-tags": ["teensy41", "teensy", "mimxrt1062", "nxp"], "serial": "uart", "automatic-stack-size": false, - "default-stack-size": 4096, "linkerscript": "targets/mimxrt1062-teensy40.ld", "extra-files": [ "src/device/nxp/mimxrt1062.s",