freeRTOS + lwip hangs

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

freeRTOS + lwip hangs

3,181件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by srinidhi M on Thu Jul 17 01:02:51 MST 2014
Hello ,

Am trying lwip on lpc4330, tcp echo demo is working fine but i modified that to receive data using UDP its going to hang after recieving aroung 70 to 80 packets (each of 1024 bytes). is there any problem with lwip ?

Thank you
Srinidhi
ラベル(1)
0 件の賞賛
返信
8 返答(返信)

2,683件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by srinidhi M on Wed Jul 23 05:47:17 MST 2014
Hi Sundarapandian,

Thanks for the replay, I'll check and inform the result.

Thank you
Srinidhi M
0 件の賞賛
返信

2,683件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sundarapandian on Tue Jul 22 10:02:13 MST 2014
If you are using heap3 then there is a possible race condition in directly using malloc so add the following to your lwipopts.h (before the last line "#endif")

#define mem_free vPortFree

#define mem_malloc  pvPortMalloc

STATIC INLINE void *pvPortCalloc(size_t nmemb, size_t size)
{
void *x = mem_malloc(nmemb * size);
if (x != NULL)
memset(x, 0, nmemb * size);
return x;
}

#define mem_calloc pvPortCalloc
0 件の賞賛
返信

2,683件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by srinidhi M on Tue Jul 22 03:04:28 MST 2014
Hello ,

Here is the call flow of my program,

main->tcpecho demo (in the tcp echo demo i just removed while(1) condition "which is used for checking link status") -> from tcp echo am calling my udp_func.

inside udp_func call flow is :
create socket,
setsocketopt,
bind and recvfrom.

After receiving few packets am getting HardFault, please help me to fix this issue. 
0 件の賞賛
返信

2,683件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by srinidhi M on Mon Jul 21 05:37:14 MST 2014
Hello ,

I am trying to debug but am not getting what exactly the problem, whether its because of reading from ethernet when its powered down or because of stack over write.

I checked by increasing the stack size, initial stack size was 0X4000 and i update to 0XE000 and also i modified DEFAULT_THREAD_STACKSIZE and also TCPIP_THREAD_STACKSIZE but still am getting the hardfault.

And now am thinking its because of reading ethernet when its not being clocked , but i am not getting how to check and how to come out. please help me to fix this issue.

Thank you
Srinidhi
0 件の賞賛
返信

2,683件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by srinidhi M on Sun Jul 20 21:27:52 MST 2014
Thanks for the replay, I'll check the FAQ and i'll update the further.

Thank you
Srinidhi
0 件の賞賛
返信

2,683件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Sat Jul 19 10:50:07 MST 2014
You need to fix your application to stop it causing the hard fault... See this FAQ.

http://www.lpcware.com/content/faq/lpcxpresso/debugging-hard-fault
0 件の賞賛
返信

2,683件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by srinidhi M on Sat Jul 19 06:00:53 MST 2014
Hello ,

One thing i just came to know is it was going to HardFault_Handler , I checked HFSR register value , in that 30th bit was enabled that is FORCED bit is enabled. I am not getting how to fix that.

I am not able to reset the HFSR register value even though it is having RW permission. please suggest me to come over this problem.

Thank you
SRINIDHI   
0 件の賞賛
返信

2,683件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by srinidhi M on Thu Jul 17 01:06:25 MST 2014
If i put some prints after sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); call in api_lib.c it wont hangs but receives very less number of packets.
0 件の賞賛
返信