Using FreeRTOS in tight RAM spaces is hard. You might want to avoid using heap and write your program that will work with minimal heap. You can create your all RTOS related things (semaphores, queues, tasks etc.) in stack and you can avoid creation of them in runtime, but still, after all that you might left out with very limited RAM. You can change your heap scheme to a simpler one like heap_1 or 2. If not necessary, try to avoid using FreeRTOS in MCUs that have low memory since it's possible to write the program without an OS requirement. But if it's a necessity, I was able to create an RTOS project with I2C, SPI and UART enabled. You can:
That way, i was able to build the project and still left with 1.36kb of RAM space
You can find the example .ioc file here
Please keep in mind that I have never used stm32 with heap size of 0. Please share your experiences after testing.