Microchip
直播中

温洁

8年用户 200经验值
私信 关注
[问答]

我得到例外和其他TCPIP问题

我开始了一个新的线程,因为它使它更容易遵循。我相信代码是和谐2.04。至少当固件运行好一段时间时,它看起来可能是突然出乎意料的产品:1)SypRealSubExpRyLeR2(Simple),SysHelrOrthRebug TCP/IP堆栈:堆删除失败!SysHyrRoRyTrror TCP/IP堆栈:堆创建失败,类型:1SysSyrRoRyTrror TCP/IP堆栈:初始化失败1 -中止!之后,以太网变得不可访问,并且电缆必须被拔掉并被复制以恢复。对于一般的例外,我有用于TBL再填充的SENDATA总线错误加载/获取地址错误,ECP地址通常位于这个函数中:一个总线,地址是iMaMtxPcTeCKAcKeldFor()。我已经看了好几天,但是除了它在项目代码和ReunIalaleDead中有时被取消初始化之外,还没有结论它发生的原因。但是仅仅做了100次,BOT就产生了问题。在问题发生前从2小时到48小时。如果有人对可能的原因有任何想法,或者我能尝试什么,请告诉我。

以上来自于百度翻译


      以下为原文

    I am starting a new thread for this as it makes it easier to follow.
I believe the code is HARMony 2.04. At least it appears that way

Device PIC32MZ2048EFG100

When the firmware runs for a good while, it may suddenly out of the blue produce:
1) _general_exception_handler
2) _simple_tlb_refill_exception_handler

or:
SYS_ERROR_ERROR TCP/IP Stack: Heap Delete fail!
SYS_ERROR_ERROR TCP/IP Stack: Heap creation failed, type: 1
SYS_ERROR_ERROR TCP/IP Stack: Initialization failed 1 - Aborting!
after which the Ethernet becomes unreachable and the cable must be unplugged and replugged to recover.

For the _general_exception_handler
I have seen
data bus error
load/fetch address error

For TBL refill, the ECP address usually sits in this function:
_EnetPoolFreeDcptList()


Disassembly of section .text._EnetPoolFreeDcptList:
9d08bc08 <_EnetPoolFreeDcptList>:
9d08bc08: 27bdffe0 addiu sp,sp,-32
9d08bc0c: afbf001c sw ra,28(sp)
9d08bc10: afb20018 sw s2,24(sp)
9d08bc14: afb10014 sw s1,20(sp)
9d08bc18: afb00010 sw s0,16(sp)
9d08bc1c: 00808021 move s0,a0
9d08bc20: 00a08821 move s1,a1
9d08bc24: 00c09021 move s2,a2
9d08bc28 <.LBB347>:
9d08bc28: 8e040008 lw a0,8(s0)
9d08bc2c <.LVL19>:
9d08bc2c: 8e02000c lw v0,12(s0)
/////////////////////////////////////////////////
ECP address = 9d08bc30 for tbl_refill
////////////////////////////////////////////////

9d08bc30: 54820004 bnel a0,v0,9d08bc44 <.LBB350>
9d08bc34: 8c820000 lw v0,0(a0)
9d08bc38: ae00000c sw zero,12(s0)
9d08bc3c <.LBE347>:
9d08bc3c: 0b422f12 j 9d08bc48 <.LBE350>
9d08bc40: ae000008 sw zero,8(s0)
9d08bc44 <.LBB350>:
9d08bc44: ae020008 sw v0,8(s0)
9d08bc48 <.LBE350>:
9d08bc48: 10800007 beqz a0,9d08bc68 <.LVL21>
9d08bc4c: 8fbf001c lw ra,28(sp)
9d08bc50: 5220fff6 beqzl s1,9d08bc2c <.LVL19>
9d08bc54: 8e040008 lw a0,8(s0)
9d08bc58: 0220f809 jalr s1
9d08bc5c: 02402821 move a1,s2
9d08bc60 <.LVL20>:
9d08bc60: 0b422f0b j 9d08bc2c <.LVL19>
9d08bc64: 8e040008 lw a0,8(s0)
9d08bc68 <.LVL21>:
9d08bc68: 8fb20018 lw s2,24(sp)
9d08bc6c <.LVL22>:
9d08bc6c: 8fb10014 lw s1,20(sp)
9d08bc70 <.LVL23>:
9d08bc70: 8fb00010 lw s0,16(sp)
9d08bc74 <.LVL24>:
9d08bc74: 03e00008 jr ra
9d08bc78: 27bd0020 addiu sp,sp,32


For the general exception, data buss, the address is in
_MACTxPacketAckCallback()


9d09179c <_MACTxPacketAckCallback>:
9d09179c: 14a00010 bnez a1,9d0917e0 <.LVL361>
9d0917a0: 24050001 li a1,1
9d0917a4: 27bdffe8 addiu sp,sp,-24
9d0917a8: afbf0014 sw ra,20(sp)
9d0917ac: afb00010 sw s0,16(sp)
9d0917b0: 00c08021 move s0,a2
9d0917b4 <.LBB575>:
////////////////////////////////////////////
address points here: 9d0917b4
////////////////////////////////////////////
9d0917b4: 9483fffe lhu v1,-2(a0)
9d0917b8: 8cc20068 lw v0,104(a2)
9d0917bc: 00832023 subu a0,a0,v1
9d0917c0 <.LVL358>:
9d0917c0: 0040f809 jalr v0
9d0917c4: 24061040 li a2,4160
9d0917c8 <.LVL359>:
9d0917c8: 8e02012c lw v0,300(s0)
9d0917cc: 24420001 addiu v0,v0,1
9d0917d0: ae02012c sw v0,300(s0)
9d0917d4 <.LBE575>:
9d0917d4: 8fbf0014 lw ra,20(sp)
9d0917d8: 8fb00010 lw s0,16(sp)
9d0917dc <.LVL360>:
9d0917dc: 27bd0018 addiu sp,sp,24
9d0917e0 <.LVL361>:
9d0917e0: 03e00008 jr ra
9d0917e4: 00000000 nop


I have looked at this for several days but have no conclusion as to why it is happening except that the stack gets de-initalised  sometimes in the project code and re-initalised.

But just doing that a few 100 times has bot produced the problem.
It may take from 2 hours to 48 hours before the problem occurs.

If anyone has any ideas of the possible cause, or what else I can try, please let me know.

Best regards
X

回帖(11)

云达贞

2018-8-31 17:40:00
当你体验到这个和硬件平台时,请指定你正在运行的演示。此外,和谐的确切版本将有助于(查看你正在运行的演示应用程序的SyrSoCyf.h)。第一个要澄清的事情是为什么TCP/IP栈被去初始化,什么事件T?安装此调用以关闭堆栈?试着设置一个断点并检查这个调用的确切位置。希望这会带来一些启发。

以上来自于百度翻译


      以下为原文

    Please specify the demo you're running when you experience this and the hardware platform.
Also, the exact version of Harmony would help (look into the system_config.h for the demo app that you're running).
 
The 1st thing to clarify would be why is the TCP/IP stack getting de-initialized, what event triggers this call to shut down the stack? Try to set a breakpoint and check where exactly this is called from.
Hopefully this will throw some light.
  
举报

樊周依

2018-8-31 17:55:42
你好,Runad,GROMPE和声版本是2.04i,我不确定你的演示应用程序是什么意思。这是一个真正的应用程序。当以太网电缆被拉开,然后重新初始化时,堆栈就被取消了。我不知道为什么这样做,但是历史注释表明连接不能再被覆盖的问题。在任何情况下,堆栈应该能够。去初始化和重新初始化100%的时间。而且,95%的时间似乎起作用了。此外,堆删除问题是非常关心的。我已经尝试过代码,但无济于事。我不知道还有什么我可以尝试的时刻。

以上来自于百度翻译


      以下为原文

    Hello rainad, group
 
The harmony version is 2.04
I am not sure what you mean by demo app. This is a real application.
The stack gets de-initalised on purpose when the ethernet cable is pulled and then re-initalised.
I don not know why this was done but the history comments indicate that there were problems with connections not able to be re-covered.
 
In any case, the stack should be able to de-initalise and re-initialise 100% of the time. And, 95% of the time it seems to work. Also that heap deletion problem is very concerning.
 
I have tried stepping through the code but to no avail.
I am not sure what else I can try at the moment. 
举报

云达贞

2018-8-31 18:03:40
好吧,我觉得这是一个和谐的演示。我认为它是一个自定义应用程序-在电缆断开时不需要重新启动堆栈,但可能有一些问题需要用这种方法来解决。不管怎样,你是对的,把栈倒下来,然后在没有问题的情况下完成工作。-“堆删除失败!”意味着仍然有模块分配的数据,因此堆不能被释放。之后,另一个分配尝试作为另一个调用初始化的一部分通常会失败,堆栈将不运行。当然,网络上的板是不可访问的。什么模块仍然对它的缓冲器保持……很难说。例如,它可以是应用程序,如果它不处理待定的UDP缓冲区。您可以启用TeTCPIPthStaskFraseTraceEngEnabl,并且可以使用控制台中的“HeAPFipe”来查看哪些模块仍然分配了数据。-另一个测试是为应用程序选择外部堆并查看如果这种行为更好。使用外部堆,TCP/IP堆栈不管理堆本身。但是,如果某个地方内存不足,最终你会注意到它。-但是事实上,你得到了例外,这真的很糟糕。在Mac驱动程序中,我很久没有听到这样的事情了。它可以是任何东西,甚至是ISR或其他代码,可以在MAC驱动程序维护的列表上执行。您可以尝试更新到堆栈的最新版本(不需要替换整个和声框架,您可以只尝试更新堆栈,希望它能建立OK)并运行测试,看看是否有E有任何变化。虽然这里似乎有更深层次的问题。

以上来自于百度翻译


      以下为原文

    OK, I thought this was a demo distributed with Harmony. I take it it is a custom application.
- There shouldn't be any need to restart the stack when the cable is disconnected, but probably there was some issue that needed to be solved with this approach. Anyway, you're right, turn stack down and then up shold work without any problems.
 
- The message ""Heap Delete fail!" means that there's data still allocated by the modules, so the heap could not be freed. After that, another allocation attempt as part of the another call to Initialization will normally fail and the stack won't be running. Of course the board won't be accessible on the network.
What module still holds on to its buffers...hard to say. For example it could be the application, if it doesn't process the pending UDP buffers.
You can enable the TCPIP_STACK_DRAM_TRACE_ENABLE and you'll be able to use "heapinfo" from the console to see what module still has allocated data.
 
- Another test is to select the external heap for your app and see if this behaves better. With an external heap, the TCP/IP stack does not manage the heap itself. But if there is a memory leak somewhere, eventually you're going to notice it anyway. 
 
- But the fact that you're getting exceptions, this is really bad. And I haven't heard in a long while of something like this in the MAC driver. It could be anything, even an ISR or some other code that steps over the MAC driver maintained lists.
You can try to update to the latest version of the stack (no need to replace the whole Harmony framework, you can try only updating the stack, hopefully it will build OK) and run a test, see if there's any change. Although it seems that there are deeper issues here.
 
 
举报

樊周依

2018-8-31 18:10:33
根据您的建议,我刚刚定义了TCPIpHytStAgJavaRead,TraceEngBayLaye,还必须定义TCPIpHyStActhFraseDebug,但是,我没有您提到的控制台,并且不能在EpARTARDO的任何地方找到“HeAPFipe”,在USAART2上有调试输出,但我需要知道在那里输出什么“HeAPFEPO”

以上来自于百度翻译


      以下为原文

    Thanks for that great info.
As per your suggestion, I just defined  TCPIP_STACK_DRAM_TRACE_ENABLE 
 
I also had to #define  TCPIP_STACK_DRAM_DEBUG_ENABLE 
 
 
However, I do not have that console you mentioned and cannot find "heapinfo" anywhere in the project
 
I do have debug output on USART2 but I would need to know what to output there for the "heapinfo"
举报

更多回帖

发帖
×
20
完善资料,
赚取积分