If stm32 compilation is too large to fit, you can try using 1 in keil. 2. Open Function Tuning

One ELF Section per Function

3. Remove assertion information if necessary

//#define USE_FULL_ASSERT 1U