diff options
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a921604..8ec8115 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,15 +11,19 @@ set(PICO_SDK_PATH "/home/pi/pico/pico-sdk") include(pico_sdk_import.cmake) project(pico-watch C CXX) -add_compile_definitions(PICO_DEBUG_MALLOC PICO_DEBUG_MALLOC_LOW_WATER=1)# PICO_MALLOC_PANIC) + +# PICO_USE_STACK_GUARDS=1 for testing, might leave as is. +add_compile_definitions(PICO_DEBUG_MALLOC PICO_DEBUG_MALLOC_LOW_WATER=0 PICO_USE_STACK_GUARDS=1)# PICO_MALLOC_PANIC) # Increase heap size, this should leave: # sram_size = SRAM_END(=0x20042000) - SRAM_BASE(=0x20000000) = 0x42000 # stack_size = 0x800 (default) # heap_size = 0x5000 (changed) # mem_left = sram_size - (stack_size + heap_size) = 0x3c800 -# If still having problems: see __malloc_current_mallinfo.arena variable in debugger. See also https://stackoverflow.com/a/12825223 for arena definition. -add_compile_definitions(PICO_HEAP_SIZE=0x5000) +# We still have to factor in global variables, so this is not precise. The best place for information seems to be the pico-wath.elf.map file. + +# Small size used for testing, seems to work fine. +add_compile_definitions(PICO_HEAP_SIZE=0x200) # Initialise the Pico SDK pico_sdk_init() |