hello dear dialog staff:
I have a problem about wrap_platform_reset(), my customer said sometimes he connect Soc with the cellphone , soc will call wrap_platform_reset() and return error code 0xF2F2F2F2
我发现一些解释说:
/*
the most obvious reason for the wrap_platform_reset to occur is due to memory allocation failure, that means that there is a memory leakage in your sw, you allocate data somewhere and you never release them (you can verify that in the parameter error of the function, which should be RESET_MEM_ALLOC_FAIL).
*/
我检查了堆分配:
RAM\u BSS\u 1 0x00815000内存
{
*(克尤堆)
}
散点扫描(图像长度(RAM\u BSS\u 1)<0x3000)
}
这意味着12k用于堆分配。够了吗?
如果我的软件中有内存泄漏,它会在触发malloc时重置,而更多的堆空间对重置问题没有帮助?
我怎样才能找到它们,何时需要释放这些记忆?实际上这让我很困惑。有没有什么申请说明可以帮助我了解ke-melloc机制。
谢谢~
Device:
嗨,大头宝贝,
关于堆分配,您可以在.map文件中找到为内核消息分配了多少堆(搜索heap\u db\u区域、heap\u env\u区域、heap\u msg\u区域)。0x3000堆非常大,我严重怀疑这是否表示堆的大小。如果您的软件中存在内存泄漏,并且您一直在分配内存,那么在分配内存时的某个点上是的,您将在wrap\u platfrom\u reset中结束。没有具体的方法来找出内存泄漏的位置。如果您使用ke\u malloc来分配空间,那么应该从non\u ret\u堆进行分配,并且应该在不再需要该空间时使用ke\u free()释放空间,同时确保所有消息处理程序返回ke\u MSG\u consumped以便释放分配的空间。
谢谢你的对话
亲爱的MT\u DIALOG:
谢谢你的解释。
似乎我已经找到了一些可能,为什么它会导致复位
我们在while(1)主循环中设置了一些延迟,我猜rwip\u schedule()函数不能很好地与它一起工作。。。。。。
例如,如果我想用GPIO来填充一个软件IIC函数,似乎延迟函数会导致重置。。。这是否意味着我不能在主循环中执行任何延迟操作?
If I can, maybe I must turn off the msg that will induce memory leackage, I guess advertising may bring on some msg periodly and finally give rise to a reset. close adv action will help with this problem?? Is there any other msg may cause a reset when im not connecting with soc. then i think delay in main loop may become possible.
谢谢~~~
嗨,大头宝贝,
Could you please let me know why you put a delay into the while(1)? Is there any specific reason why you added a delay? Be aware that it is strongly recommended to NOT add any delay into this function. The reason is that the schedule_while_ble_on() function invokes the rwip_schedule() function, that serves all the pending messages. If you put a delay into while(1) this means that the schedule_while_ble_on() will be delayed too but the queue will continue receiving messages, so scheduler will have to reserve many of them. As a result, you will get the wrap_platform_reset()
谢谢,下午好
Many thanks ~
最后,请帮助我理解函数rwip\u schedule(),~~~~~帮助~~~~~
i will try to avoid delay function in while1 according to our software architecture.
I have done a test, Im now quiet sure that if adv is on , through i put a long delay in while 1, ke_malloc is called periodly but rwip_schedule() can only run after delay is finished.
但是我认为rwip\u schedule()是一个while循环,可以找到回调来处理这些msg,
-------------------------------------------
它是否意味着它将一次处理完所有的消息,或者它不能,这将最终导致内存的积累???
-------------------------------------------
如果rwip\u schedule()可以及时完成所有消息并释放内存,是否有任何原因会导致此错误,我只想了解更多有关KE schedule机制的信息,如果可以,请提供一些详细信息。如果有一些pdf文档可以帮助我理解这一点,请同时通知我
再次感谢
嗨,大头宝贝,
DA14580仅在BLE核心处于活动状态以及rwip\u schedule()函数执行时调度挂起的消息。消息可以异步地发送到堆栈,但是当rwip\u调度被执行时,它们将被同步地服务。在主循环的活动部分,内核将通过调用rwip\u schedule()被授予控制权,并且只要需要处理消息和事件,它就会保持控制权。对rwip\u schedule()的调用发生在schedule\u中,而对ble\u on()的调用则发生在schedule中,因为内核要求ble硬件处于活动状态才能处理消息。我强烈建议您查看第段的7.2.1主循环回调嗯- b - 051: DA14580 (SD软件平台参考K5)用户手册。您可以找到它并从我们的支持门户下载。关于你的问题,我不明白你的确切意思,请你澄清一下你的问题好吗?你还有这个错误吗?
谢谢,下午好
谢谢
but I cannot find where to download this application note, UM-B-051 : DA14580 Software Platform Reference (SDK5) user manual
I click the link you gave me but only these info are shown:
--------------------------------------------------------------
Version date: 20/12/2016
Version number: 1.2
Tutorials:
接收更新通知
Subscribe to this page
最左侧列中的主复选框可打开或关闭给定订阅。根据站点的设置,您可能有活动订阅的其他选项--------------------------------------------------------------
嗨,大头宝贝,
You are not able to download it because you haven’t accepted theSoftware License Agreement (SLA)但是。请尝试再次下载,并点击下载中出现的挂锁。之后你必须同意许可协议and the you should wait until your access will be granted.
谢谢,下午好
I still dont know where to find this SLA
Is a mail access can I reach this link?
嗨,大头宝贝,
Please go to product DA14580 and navigate to software and tools. Then try to download the SDK. There you 'll have to see a padlock icon - click that, accept the agreement, and you will be granted will SDK access in a couple of days.
谢谢,下午好