Skip to content

Increase CPX stack size slightly #2393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
// Explanation of how a user got into safe mode.
#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up"

// Increase stack size slightly due to CPX library import nesting
#define CIRCUITPY_DEFAULT_STACK_SIZE (4504)

#define DEFAULT_I2C_BUS_SCL (&pin_PB03)
#define DEFAULT_I2C_BUS_SDA (&pin_PB02)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
// Explanation of how a user got into safe mode.
#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up"

// Increase stack size slightly due to CPX library import nesting
#define CIRCUITPY_DEFAULT_STACK_SIZE (4504)

#define DEFAULT_I2C_BUS_SCL (&pin_PB03)
#define DEFAULT_I2C_BUS_SDA (&pin_PB02)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
// Explanation of how a user got into safe mode.
#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up"

// Increase stack size slightly due to CPX library import nesting.
#define CIRCUITPY_DEFAULT_STACK_SIZE (4504) // divisible by 8

#define DEFAULT_I2C_BUS_SCL (&pin_PB03)
#define DEFAULT_I2C_BUS_SDA (&pin_PB02)

Expand Down
11 changes: 8 additions & 3 deletions ports/atmel-samd/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#define CIRCUITPY_MCU_FAMILY samd21
#define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21"
#define SPI_FLASH_MAX_BAUDRATE 8000000
#define CIRCUITPY_DEFAULT_STACK_SIZE 4096
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0)
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0)
#define MICROPY_PY_FUNCTION_ATTRS (0)
Expand Down Expand Up @@ -74,8 +73,6 @@
#define CIRCUITPY_MCU_FAMILY samd51
#define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51"
#define SPI_FLASH_MAX_BAUDRATE 24000000
// 24kiB stack
#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
#define MICROPY_PY_FUNCTION_ATTRS (1)
Expand Down Expand Up @@ -108,6 +105,10 @@
#define CIRCUITPY_INTERNAL_NVM_SIZE (256)
#endif

#ifndef CIRCUITPY_DEFAULT_STACK_SIZE
#define CIRCUITPY_DEFAULT_STACK_SIZE 4096
#endif

#endif // SAMD21

////////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -118,6 +119,10 @@
#define CIRCUITPY_INTERNAL_NVM_SIZE (8192)
#endif

#ifndef CIRCUITPY_DEFAULT_STACK_SIZE
#define CIRCUITPY_DEFAULT_STACK_SIZE (24*1024)
#endif

// If CIRCUITPY is internal, use half of flash for it.
#if INTERNAL_FLASH_FILESYSTEM
#ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE
Expand Down
2 changes: 1 addition & 1 deletion tools/build_memory_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
free_flash = firmware_region - text - data
free_ram = ram_region - data - bss
print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, firmware_region, firmware_region / 1024))
print("{} bytes free in ram for heap out of {} bytes ({}kB).".format(free_ram, ram_region, ram_region / 1024))
print("{} bytes free in ram for stack and heap out of {} bytes ({}kB).".format(free_ram, ram_region, ram_region / 1024))
print()

# Check that we have free flash space. GCC doesn't fail when the text + data
Expand Down