Reduce MQX/RTCS RAM usage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reduce MQX/RTCS RAM usage

1,030 Views
jesperevertsson
Contributor IV

Hi, we have a mk60fx512 cpu on which we run our own software together with MQX 4.2 and the RTCS stack. Recently we've been running in to some RAM memory shortage problems and we've had to make some compromises to make sure the application has enough memory. Right now we are looking at differant ways to reduce the RAM usage. We are making optimizations to our own code, but we can see that the RTCS seem to use a lot of RAM and we would like to try and reduce this as well (if possible).

For example when we examine the Lightweight Memory Block Summary we see this one entry called "Ethernet Buffers" that uses 18288 bytes of RAM. Is it possible to decrease this without compromising the functionality of the RTCS stack? or are there some other configurations we can change to get a smaller footprint from MQX and the RTCS?

Labels (1)
0 Kudos
2 Replies

634 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Jesper:

Yes, you can decrease the tx and rx buffers for your requirements

Please check this document for more details

MQX RTCS Memory Configuration Parameters Introduction

Regards

Daniel

0 Kudos

634 Views
jesperevertsson
Contributor IV

Hi Daniel, I looked at the document you linked but it doesn't seem to help.

I tried using

setsockopt(sock, SOL_TCP,OPT_TBSIZE,&value,sizeof(value));

setsockopt(sock, SOL_TCP,OPT_RBSIZE,&value,sizeof(value));

setsockopt(sock, SOL_UDP,OPT_RBSIZE,&value,sizeof(value));

on some of our TCP and UDP sockets, but that didn't change anything. I also tried changing the buffer sizes in the user_config.h by doing this:

#define TCP_DEFAULT_SBSIZE  2190
#define TCP_DEFAULT_RBSIZE  2190

#define RTCSCFG_UDP_RX_BUFFER_SIZE 1024

but that didn't change anything either. "Ethernet buffers" are still at the size of 18288 and the overall RAM usage is the same

0 Kudos