CY8CPROTO-062S3-4343W Reduce the use volume of sram

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

cross mob
Edwin
Level 1
Level 1
First question asked Welcome!

Here is a system sample program hello_world. The sram usage rate of the program after the default compilation is too high, I now want to reduce the sram usage volume. I have tried to delete some unused libraries in the library manager, but it seems to have no effect. May I ask this How to solve it

Edwin_0-1634967017177.png

 

0 Likes
1 Solution
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @Edwin ,

We can reduce the size of .heap section by increasing the size of stack.

  1. In your MakeFile, you will find a variable called DEFINES, in that you add the following macro definition. This makes sure you don’t have to edit the .S startup files.

Krupashankar_0-1635255164941.png

        2. In your linker script of CM4, under C:\Users\brvi\mtw\Hello_World\libs\TARGET_CY8CKIT-062-                                     BLE\COMPONENT_CM4\TOOLCHAIN_GCC_ARM\ cy8c6xx7_cm4_dual.ld, you will find a variable                                 STACK_SIZE change it to

Krupashankar_1-1635255164947.png

 

So automatically heap size will be reduced so SRAM utilization reduces.

 

Thanks,

Krupashankar

 

View solution in original post

0 Likes
2 Replies
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @Edwin ,

From your attached screenshot the we can see that maximum SRAM is utilized by .heap section

 
 

Edwin_0-1634967017177-edit.png

All unutilized memory will be automatically assigned to .heap section so SRAM utilization will be same so we are discussing with our internal team how to reduce this utilization.

 

Thanks,

Krupashankar

 

0 Likes
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @Edwin ,

We can reduce the size of .heap section by increasing the size of stack.

  1. In your MakeFile, you will find a variable called DEFINES, in that you add the following macro definition. This makes sure you don’t have to edit the .S startup files.

Krupashankar_0-1635255164941.png

        2. In your linker script of CM4, under C:\Users\brvi\mtw\Hello_World\libs\TARGET_CY8CKIT-062-                                     BLE\COMPONENT_CM4\TOOLCHAIN_GCC_ARM\ cy8c6xx7_cm4_dual.ld, you will find a variable                                 STACK_SIZE change it to

Krupashankar_1-1635255164947.png

 

So automatically heap size will be reduced so SRAM utilization reduces.

 

Thanks,

Krupashankar

 

0 Likes