memory leakage for AT operation

Post your RTL8710 based projects and build logs here
kuriel
Posts: 2
Joined: Tue May 09, 2017 6:22 pm

memory leakage for AT operation

Postby kuriel » Tue May 09, 2017 6:34 pm

Hi All,

just recently tried B&T RTL8710 (default firmware) using serial port for AT operation, i found that when creating and closing connection, the heap is not released, this would be a problem if an application require the module to operate on different kind of connection recurringly, after about 5-6 connect-close operation the module refused to open another connection, which mean i must restart the module

Code: Select all

# AT




[MEM] After do cmd, available heap 6816

 

# ATPC=0,"google.com",80

[ATPC]: _AT_TRANSPORT_START_CLIENT

[ATPC] Found name 'google.com' = 74.125.68.113



[MEM] After do cmd, available heap 4656

 

# OK to create sock_fd!

Connect to Server successful!

ATPD=0

[ATPD]: _AT_TRANSPORT_CLOSE_CONNECTION




[MEM] After do cmd, available heap 4656

 

#



at the example you can see that at first the module has 6816 bytes of heap, when i opened a new connection the heap size turn to 4656, but when i close the connection the heap didn't back to 6816, even though i have terminate all connection

kuriel
Posts: 2
Joined: Tue May 09, 2017 6:22 pm

Re: memory leakage for AT operation

Postby kuriel » Wed May 17, 2017 5:43 am

looks like the default firmware for AT command forgot to referenced the task handler, therefore for every client connection opened, task handler won't be released causing memory leakage

here's the snapshot of the code:

Code: Select all

if(xTaskCreate(client_start_task, ((const char*)"client_start_task"), ATCP_STACK_SIZE, clientnode, ATCMD_LWIP_TASK_PRIORITY, NULL) != pdPASS)

to

Code: Select all

if(xTaskCreate(client_start_task, ((const char*)"client_start_task"), ATCP_STACK_SIZE, clientnode, ATCMD_LWIP_TASK_PRIORITY, &clientnode->handletask) != pdPASS)


i already submit the patch to https://github.com/rtlduino/RTL8710AF_GCC, waiting to be approved


Return to “Projects and builds”

Who is online

Users browsing this forum: Google [Bot] and 1 guest