RTCS "accept" fails when elf file size increases beyond 1499 kBytes

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

RTCS "accept" fails when elf file size increases beyond 1499 kBytes

2,279 Views
GaneshOkade
Contributor I

Environment:

- MFC 52259 Demo Board

- MQX 3.5

- Code Warrior 7.2

 

Application: A TCP server application that initialises RTCS, binds the interface to an IP address and listens for connections requests on a specific TCP port and makes a blocking accept call waiting for connections.

 

Problem description: When a client application sends a connection request, the "accept" call returns and a successful connection is established on which further communication is also successful. However, if application logic is built into the project causing its ELF file size to increase beyond 1499 kBytes, "accept" stops responding to connection requests and never returns. After doing some tests I have confirmed that:

- the application logic itself does not make any difference as long as the total code size is below 1499 kB

- Even if the code size is 1500 kB, the accept call stops working. From this I have concluded that this problem is related to the code size itself.

 

Can someone give me pointers? Is this a license problem (I do not think so since my program compiles fine)? Does the RTCS library bundled with MQX have some limitation?

 

Thanks for the help.

 

Regards,

Ganesh Okade

RTips Technologies

Labels (1)
Tags (1)
0 Kudos
Reply
4 Replies

879 Views
GaneshOkade
Contributor I

Dear Experts,

     After doing some more experiments we have noticed that the problem has nothing to do with the code size. It rather has something to do with the total size of Global variables in the program. We wrote a test program with RTCS and added to this programs an array of integers with about 10,000 elements. Prior to adding of this array, "accept" worked fine. But after the array was added it stopped working. We reduced the size of this array by about 2000 elements and accept started working. In what way can global data affect RTCS?

 

Regards,

Ganesh Okade

RTips Technologies

0 Kudos
Reply

879 Views
CompilerGuru
NXP Employee
NXP Employee

I did never use MQX, so I don't know any specifics. But the description sounds as if you have a stack overflow issue, no? If so I would expect it to fail when using huge locals when calling accept. How to configure the stack in MQX, well I don't know.

0 Kudos
Reply

879 Views
GaneshOkade
Contributor I

Hi,

     Thanks for responding. In this case we know its not an issue with the stack because our "large arrays" are global and not local. There is something else that's affecting the RTCS stack operation.

 

Regards,

Ganesh

0 Kudos
Reply

879 Views
dpkkk
Contributor I

Hi Ganesh,

As the size of global variables increases, then heap is moving towards the stack area. Because mqx_kernal_data and heap is kept after the bss and data section and stack is at the end of ram. please check the LCF file.

MQX+Application is not  considering the stack size mentioned from the linker. Stack is growing independently.

and because of this code may be crashing. Please check after accept call MQX is working or not, or you are resetting the board.

Regards,

Darshan