Cyw20719B2 RAM Usage / Utility

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

cross mob
lock attach
Attachments are accessible only for community members.
HaPo_4773321
Level 1
Level 1
First reply posted First question asked Welcome!

Hello ,

I calculated RAM usage and Utilization in compile time and  RUN time (using wiced_memory_get_free_bytes() API)

I used Empty_BTSDK_App Example Code to Calculate RAM Utility.

As per  Memory Layout Document, RAM should be 448 KB, But I am getting only 274 KB as per below Calculation.

Please find Compile time Data and Calculation below:

  • RAM Usage Compile time

Empty_BTSDK_App

Empty BT Application - SDK

 

   

Start

End

Patch Code Size

7604

 

0x270400

0x277A04

Patch RAM Size

1264

 

0x2129AC

0x212E9C

Text

400

 

0x212E9C

0x21302C

Rodata

445

 

0x21302C

0x2131E9

Data

39

 

0x2131EC

0x213213

Bss

2

 

0x213214

0x213216

Setup

128

 

0x213218

0x213298

RAM USED

1020

B

 

 

 

  • Run Time RAM Availability using API.

Start RAM Left

278892

 

  • Total RAM As per Above Calculation

Total RAM

279912

B

 

273.3516

KB

 

Can anyone please tell me where (448 - 273  = 175 KB )  RAM Used ?

 

Thanks & Regards,

Hardik

0 Likes
1 Solution
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

The free RAM given by wiced_memory_get_free_bytes() API is the RAM left for the application usage. You can use this much memory for your application logic. The remaining memory is consumed by the ROM initializations, dynamic usages, etc. 

Thanks,

-Dheeraj.P.K

View solution in original post

0 Likes
5 Replies
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

The free RAM given by wiced_memory_get_free_bytes() API is the RAM left for the application usage. You can use this much memory for your application logic. The remaining memory is consumed by the ROM initializations, dynamic usages, etc. 

Thanks,

-Dheeraj.P.K

0 Likes
HaPo_4773321
Level 1
Level 1
First reply posted First question asked Welcome!

Hi Dheeraj,

Thanks for your response.

The remaining memory is 175 KB.  ROM initialization will not take much memory and I am not allocating any dynamic memory in my application. 

Can you please give any reference / Document to Dynamic usages or ROM initialization Memory usage?

Is there any other way i can calculate Usage/ Utilization of memory ?

Thanks & Regards,

Hardik Pokar

0 Likes
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi, 

wiced_memory_get_free_bytes() returns the free memory available after all static and dynamic memory allocation. This can be used for your application logic. Around 100KB will be used bt the FW & Stack initialization till it reaches the Application_init. 

We don't have a document which explains the ROM initialization memory usage.  May I know why do you want to calculate it? 

Thanks,

-Dheeraj.P.K

0 Likes
HaPo_4773321
Level 1
Level 1
First reply posted First question asked Welcome!

Hi Dheeraj,

I was calculating my Application Buffer Requirement and Available User Space. So I can plan my memory management in that way. 

Thanks & Regards,

Hardik

0 Likes
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

I would suggest to go ahead with the memory management planning with the return value given by wiced_memory_get_free_bytes() since it is the actual memory which can be used by the developer for their application logic. 

In wiced_memory.h you can find APIs to monitor the buffer usage as well to track it. Please have a look.

Thanks,

-Dheeraj.P.K

 

0 Likes