Smallest BSS possible for XMC1100

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User8683
Level 4
Level 4
First like received
Hello,

My application needs just over 14KB of SRAM, but what I have found is that an empty DAVE project requires 2068 bytes of BSS so I have just under 14KB. Is there any way to release any of that memory by removing certain include libraries or taking other steps?

Any suggestions are appreciated as I am finding that my questions are rarely answered in these forums.

Thanks,

Jason
0 Likes
6 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
What apps are you running in your projects?
0 Likes
User8683
Level 4
Level 4
First like received
Hello,

It is not about the apps in my case. I need a lot of RAM for analyzing the ADC signal that I will be measuring. The 2068 bytes that I refer to is the bss size that results when I create a program without any apps in it at all. If a new DAVE project with a Main.c file is created in the IDE, this is the bss size that will result.

Jason
0 Likes
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

You can reduce the memory allocated for the stack in the linker script.
In your project open the file .ld and search for the line containing:
stack_size = 2048;


Change the stack size according to the needs of your application.

Best regards,
Jesus
0 Likes
User8683
Level 4
Level 4
First like received
Thanks for that info. As a suggestion, it would make sense to write a tool to determine this size from the code rather than set an arbitrary value. This is a common task.
0 Likes
User8734
Level 4
Level 4
Good day longtimer,

Sorry for asking - if you use -O2 (-Os) option as reccomended?

I am as well curious about what application you try to built.

As far I myself plan to use FFT functions. If you aware about CMSIS library integrated in DAVE already?
Some nice examples exist there, which can be imported into DAVE:
../CMSIS/DSP_Lib/Examples_M4/

BR
K
0 Likes
User8683
Level 4
Level 4
First like received
Hi XmCfAn2014,

I have played with the optimization settings but the biggest size difference was 4 additional bytes so that wasn't proving useful. That is why I hoped I could get some freed up.

My application is a fuzzy logic application for signal monitoring in fleet management

Thanks for the tip about CMSIS DSP. Some of the functions could be very handy in future. I had thought CMSIS was only RTOS related and was not relevant for me. Some of the statistical functions could be useful.
0 Likes