Hi
We have a project using MQX 4.1 that sends and receives UDP data via a GPRS modem. To do this it uses PPP_init() to get the PPP link and then sockets to communicate. It all works perfectly! When the modem drops the PPP link due to bad coverage etc, the socket is closed and the PPP shutdown with PPP_release(), the equipment then attempts to establish the connection again and this is where the problem is. Every time PPP_init() is called the peak RAM usage (using _mem_get_highwater) goes up 944 bytes and eventually the unit runs out of RAM and stops. I tried PPP_pause() and PPP_resume() which didn’t increase the peak memory usage, but it failed to resume after 19 successful attempts with an error message.
Thinking we must be doing something wrong I had a play with the GPRS project example included in MQX4.2. I’ve got it running on the K60 Tower connected to a Sierra Wireless modem. It successfully pings a server on our APN. To make it more like our project I then modified it to continually re open the PPP connection, ping and close the PPP connection. On running this I also found that peak RAM usage goes up, just in a slightly different way.
To monitor the RAM usage I use _mem_get_highwater(). This works really well on our project, but using it with the GPRS example it seems to:
So I guess my questions are:
Many thanks
Graeme
Hi Graeme,
have you tried MQX4.2 with MQX4.2.0.1 patch? Please note that RTCS is deeply modified by MQX patches. Please also not that it is coming soon (Q1 2016) MQX4.2.0.2 patch. I have reported some PPP issues that will be adressed in this version.
Best regards,
Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Carlos,
Thanks for the suggestion to try MQX 4.2.0.1. Unfortunately it is still leaking memory.
Any update on when the MQX 4.2.0.2 patch will be released? I did a bit of searching on MQX and was a bit alarmed to find:
"MQX RTOS v4.2 is the last major release planned in the classic MQX product line."
I know it states that "Technical support, maintenance releases, and professional services will continue to be available" but how much effort will be put into MQX now there is the Kinetis SDK?
Regards
Graeme
Hi Graeme,
Besides Task Aware Debugger tool you can use Performace Tool provided by MQX to verify the stack usage. You can find related documentation in MQX_PerfTool_Getting_Started.pdf located in MQX installation path C:\Freescale\Freescale_MQX_4_2\doc\tools\cw
Please note that _mem_get_highwater() returns the highest pointer used in the memory pool. But memory pool is taken from the heap. This does not mean that all the RAM in lower locations outside the heap is used. Moreover, the memory handler can free some space in lower locations of the pool when there is some other memory space allocated in a highest address.
Regarding MQX, we will continue providing support for MQX4.2 for a long timeand as long as costumers keep using it.
Best regards,
Carlos
Carlos, I've fixed the leaks:
Solution for memory leaks in MQX 4.1’s PPP_init() and PPP_release()
Could you verify what I've done please?
Cheers
Graeme