What do I need to do to get around this? I can't believe an empty project already fills up 2kB of RAM just for the Arduino core. If there really IS something demanding that much RAM, how could I find out what it is? I know there's also the ldscript.ld file, but I don't dare yet to change anything there, because I don't know what I'm doing

In the end the MCU should just react to two buttons, control two LEDs, read two ADC channels and control a PWM output based on that. I also need a calibration value, which is why I chose the L011D4 in the first place (it's one of the few with an EEPROM). The L011D4 should be plenty for that.
My project is configured as follows. I am using Visual Studio Code with platformIO for all my MCU (STM32, AVR, ESP32) programming, usually always with the Arduino framework. platformIO does not have a board definition for a generic L011D4, so I created a custom one based the "nucleo_l031k6" board. I just changed the lines
Code: Select all
"extra_flags": "-DSTM32L0 -DSTM32L031xx",
"mcu": "stm32l031k6t6",
"product_line": "STM32L031xx",
"variant": "STM32L0xx/L031K(4-6)T_L041K6T"
Code: Select all
"extra_flags": "-DSTM32L0 -DSTM32L011xx",
"mcu": "stm32l011d4p6",
"product_line": "STM32L0x1",
"variant": "STM32L0xx/L011D(3-4)P_L021D4P"