Ram Usage of PSoC4

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.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        Can someone tell me what the 1300 bytes go for a program like this?   
Bob   
0 Likes
9 Replies
Anonymous
Not applicable
        Hi Bob   
It's consumed by srand() / mathematical group   
   
Flash used: 1280 of 32768 bytes (3.9%).   
SRAM used: 228 of 4096 bytes (5.6%).   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@PSoC73:

   

Yes, of course I know that srand() is consuming my sram! (Sometimes I may look stupid, but I am not!)

   

The point is that there is no math routine (not even srand()) that may take 1000 bytes of precious sram for nothing!

   

This is obviously a(nother) library error with the m0 libs. And: Yes, I already filed a MyCase and will keep you all informed.

   

 

   

Bob

0 Likes
Anonymous
Not applicable
        Hi   
I see there is no math routines except srand.   
But, I think srand come with other math group routines.   
Maybe these are consume sram, even if you didn use.   
It is no help.   
0 Likes
Anonymous
Not applicable
        When refine the project setting   
Optimize for SIZE and turn off DEBUG   
sram consumption can reduce 2,400 to 1,300 byte.   
   
Flash used: 2216 of 32768 bytes (6.8%).   
SRAM used: 1300 of 4096 bytes (31.7%).   
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I must be blind, did not Bob originally state his SRAM consumption was 1300

   

bytes, are your last numbers incorrect PSOc73 ? They show only FLASH change.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable
        Oh, that was wrong   
I am confusing original SRAM consumption as 2,400bytes.   
Optimizing and DEGUG flag will no help for it.   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I dug a bit further into that matter and evovled this to be a library problem.

   

When a library function is used, rather often a global returncode is set named "errno" which allows for analyzing the reason of ailure. This is commonly used for OSses and since GCC libraries are used for this, "errno.h" is included which in turn loads a library "reentrant.h" which allocates data-structures of 1kbyte size just to maintain multitask- and context switching which so far would be a bit too much for a PSoC4.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The "Linux" conundrum, GCC, public tools vs commercial tools.

   

In charge of ones own destiny, or not.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Cypress has resolved this issue in their upcoming version of Creator i.e Creator 3.0. This will be released in October, 13.

   

I got the beta version of Creator and this issue is no more available in Creator. They have updated the compiler of PSoC4 to later releases in Creator 3.0.

   

Regards,

   

Rave

0 Likes