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

cross mob
Wilson_Sun8
Level 1
Level 1
First like received 25 sign-ins 10 sign-ins

Dear Sir:

We are currently evaluating the RAM&ROM size of CY8C4149AZS-S595(RAM 32KB, Flash 384KB) + FreeRTOS
The result is only using the hello word program built in ModusToolbox 3.0, without adding Freertos, the Heap memeory uses 30.55KB, and it is impossible to add peripherals, such as GPIO to control LED, CAN bus/UART driver.

I have the following question
1. Is this large heap size a problem with ModusToolbox3.0?
2. How to analyze where RAM (heap/stack) is used? (By file show heap size ? How to configure this function in GCC compiler ?)
3. Does PSOC creator 4.4 not support CY8C4149AZS-S595? Because I can't find this paerts when creating a new project

Untitled.png

0 Likes
1 Solution
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @Wilson_Sun8 ,

The Heap usage calculation is incorrect in ModusToolBox 3.0.
The memory calculation will be fixed in the next releases.

Warm Regards,
Gautami J

View solution in original post

10 Replies
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @Wilson_Sun8 

Can you please confirm the device you are using? Is it CY8C4149AZI-S595? This device is available in ModusToolbox but not available in PSoC Creator.

Thanks and Regards,
Leo

0 Likes

Dear Leo:

In order to avoid confusion, we must follow the Infineon official documents to clarify the problem. We followed Infineon-ModusToolbox_3.0_Eclipse_IDE_QSG-GettingStarted-v01_00-EN.pdf to generate the Hello world program, but when selecting the BSP, we chose "CY8CKIT-041S- MAX", and so on. But after building code heap is always used 31292B = 30.55KB.

We suspect that the modustoolbox 3.0 tool has a BUG for the new MCU (CY8C4149AZS-S595), so that's why I mentioned PSoC creator support for CY8C4149AZS-S595 MCU!!

 

You can do it once and I'm sure you'll get the same result.

Thanks!

Wilson Sun

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @Wilson_Sun8 

I was able to recreate the issue from my end. I will report this bug to the internal team.

Also, I believe this discussion can help you with analyzing the RAM (heap/stack) used:

https://community.infineon.com/t5/ModusToolbox-General/Memory-analyze-with-ModusToolbox/td-p/161943

Thanks and Regards,
Leo

0 Likes

Dear Leo:

Thanks for your suggestion ! Because I don’t have a CY8CKIT-041S-MAX evb board, I can’t dynamically debug and check the memory size. Can modustoolbox check the memory size statically? Like keil 8051. After the build code is completed, I can get the data from .map or .lst , data, idata(internal RAM) and xdata(External RAM) .. to calculate the memeory size ?

Thanks!

Wilson

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @Wilson_Sun8 

A .map file is also generated for ModusToolbox after build, and we can view the memory size as shown below:

LeoMathews_0-1682338342953.png

 

The .map file can be located at the Project\build\APP_CY8CKIT-041S-MAX\Debug\ folder.

Thanks and Regards,
Leo

0 Likes

Dear Leo:

Thank you for your reply, what we need is not only the total memory size (see in .map file), but also the memory size used by each file (.lst file), because we need to know which file uses more memory and reduce the memory usage to fix it.

 

Thanks!

 

Wilson Sun

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @Wilson_Sun8 

I believe this tool can be helpful to check the memory size statically. But please note the .heap section shows '0' size as the original heap memory size is a variable that changes during the running of the application. The heap section is utilized whenever there is a dynamic memory allocation during program execution.

LeoMathews_0-1682413137338.png

After downloading the tool execute the following command in command prompt to view the memory breakdown of different sections.

amap.exe -g Path\to\.map\file

Since you are only building the project the .map file can show only the static data.

Thanks and Regards,
Leo

 

0 Likes

Dear Leo:

I was able to recreate the issue from my end. I will report this bug to the internal team.

-> As you mention before  could I know when this problem can be fixed, so that we can know that the dynamic memory configuration is like PSoC creator after the code is built ?

Thanks!

Wilson Sun

 

0 Likes

Dear Leo:

In the Hello World application, I used the link flag to print out the memory usage as follows,

make build LDFLAGS+=-Wl, --print-memory-usage

Result RAM usage 100%
Memory region Used Size Region Size Usage Used
FLASH: 5964 B 384 KB 1.52%
RAM: 32 KB 32 KB 100.00%

 

Thanks!

Wilson Sun

0 Likes
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @Wilson_Sun8 ,

The Heap usage calculation is incorrect in ModusToolBox 3.0.
The memory calculation will be fixed in the next releases.

Warm Regards,
Gautami J