Saving SRAM on mbed

I’m trying to make a project on my bluepill_f103c8 but i’m running out of SRAM during runtime and it causes freezes.
My .ini:

[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
framework = mbed
build_flags = -DDEVICE_RTC=0  -DPIO_FRAMEWORK_MBED_EVENTS_PRESENT  -DPIO_FRAMEWORK_MBED_RTOS_PRESENT 
upload_protocol = stlink

Any ideas how to save up on SRAM?

i’m already using newlib-nano

See following blogs on the mbed website:
https://os.mbed.com/blog/entry/Reducing-memory-usage-with-a-custom-prin/
https://os.mbed.com/blog/entry/visualizing-linker-stats/

Also try re-writing the program with no RTOS, that can save a lot.

RTOS is a must due to internet connnection and lots of other processes

These blogs are mostly about FLASH than about SRAM, maybe the printf could save a little

Might be helpful Mbed Build Error - RTOS 'osKernelGetTickCount' - #9 by valeros

Already using that :frowning: