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_BSS_1 0x00815000
{
*(KE_HEAP)
}
散点索(ImageLength(RAM_BSS_1)<0x3000)
}
这意味着12k用于堆分配。这是足够的吗?
如果我的SW中存在内存泄漏,它将重置Malloc触发,并且更多堆空间无帮助重置问题?
我如何找到它们,当我需要释放这些内存时?实际上这会让我很多。有没有应用笔记可以帮助我理解Ke Melloc机制。
谢谢〜
Device:
嗨bigheadbaby,
关于堆分配,您将能够找到在.map文件中为内核消息分配多少堆(搜索堆_db_area,heap_env_area,heap_msg_area)。一个0x3000堆非常大,如果这表明你的堆大小,我会认真怀疑。如果您的SW中存在内存泄漏,并且在分配内存时,请在某些点处保持分配内存,您将在WRAP_PLATFROM_RESET中结束。没有具体方法可以找到内存泄漏的位置。如果要使用ke_malloc以分配房间,则应从NON_RET_HEAP分配,并且只要您不再需要该房间即可使用KE_FREE()释放空间,并确保所有消息处理程序返回KE_MSG_CONSUMED按顺序返回KE_MSG_CONSUMED为了释放分配的空间。
谢谢mt_dialog.
亲爱的mt_dialog:
谢谢你的解释。
似乎我发现了一些可能导致重置的可能性
我们延迟了(1)主循环,我猜funcion rwip_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.
谢谢〜~~
嗨bigheadbaby,
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()
谢谢,PM_DIALOG.
Many thanks ~
最后,请帮我了解函数Rwip_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_schedule()是一段时间循环,以找到回调来处理这些消息,
-------------------------------------
这是否意味着它会在一段时间内完成所有消息,或者它不能最终导致内存累积???
-------------------------------------
如果rwip_schedule()可以在时间完成所有消息和释放内存,则有可能导致此错误的原因,我只想了解有关Ke计划机制的更多信息,如果可以,请为我提供一些细节。如果有一些PDF笔记可以帮助我理解这一点,请也会才能实现我
再次感谢
嗨bigheadbaby,
DA14580仅在BLE核心处于活动状态以及RWIP_SCHEDULE()函数执行时安排挂起的消息。消息可以向堆栈异步发送,但在执行RWIP_Schedule时,它们将同步地服务。在主循环的活动部分中,内核将被授予对RWIP_SCHEDULE()调用的控件,并且只要需要处理消息和事件,它将保持控制。由于内核要求BLE硬件来处理消息,因此在Schedule_While_ble_On()中呼叫呼叫_while_ble_on()中发生。我强烈建议您查看7.2.1主回调段落嗯- b - 051: DA14580 (SD软件平台参考K5)用户手册。您可以找到它并从我们的支持门户下载它。关于你的问题,我无法理解你的意思是什么,所以请你澄清你的问题吗?你还有这个错误吗?
谢谢,PM_DIALOG.
谢谢
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
左侧最多列中的主复选框转或关闭给定的订阅。根据网站的设置,您可能有活动订阅的其他选项.------------------------------------------------------
嗨bigheadbaby,
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.
谢谢,PM_DIALOG.
I still dont know where to find this SLA
Is a mail access can I reach this link?
嗨bigheadbaby,
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.
谢谢,PM_DIALOG.