你好,
我无法理解da1458x_config_advanced.h文件下宏的目的/含义。你能解释一下每个人的意思吗?
#define DB_HEAP_SZ
#define ENV_HEAP_SZ
#define MSG_HEAP_SZ
#define non_ret_heap_sz.
Actually, I am sending the GATT database from a different controller over UART and allocating the services, characteristics and descriptors using TASK_APP and using KE_MSG_ALLOC.
添加一些后,控件将转移到wrap\u platform\u reset()。当我读到一些关于对话框支持的答案时,我发现当内存不足时会发生这种情况。
所以,我增加了所有这些的值,现在我的GATT数据库运行良好。
不过,我想确切地了解上述每个宏的用途或用途。
谢谢,
hrishikesh.
Device:
嗨,德里希,
这些宏定义了用于不同用途的内存段的大小。例如,调用KE\u MSG\u ALLOC将从MSG节(其大小由MSG\u HEAP\u SZ定义)分配请求量的内存。DB代表GATT数据库,ENV代表内核和BLE堆栈的内部用法,而NON-RET代表通用用法。
我有大量的服务和特点(6个服务和33个特点)。我这边每个服务的总大小是:
S1: 1278 bytes bytes
S2: 570 bytes
S3:751字节
S4: 1455 bytes
S5:745字节
S6: 214 bytes
每项服务的特征都是TLV8类型,因此它们的尺寸更大。
您可以建议可以使用的大小宏的值。我使用的当前值:
#define DB_HEAP_SZ 2048
#define env_heap_sz 1536.
#define MSG_HEAP_SZ 2048
#定义非\u RET \u HEAP \u SZ 1024
有了这些值,当我添加服务S4时,DA14580就没有响应了。我认为这是一个记忆问题。
我试过在一些组合中增加这些,但没有运气。
我终于可以用以下值来实现它:
#定义DB_HEAP_SZ 3072
#定义ENV_HEAP_SZ 3584
#定义MSG\u HEAP\u SZ 1600
#定义非\u RET \u HEAP \u SZ 1024
Could you please justify these values and let me know in case of any problems (like max size etc)
你好,
We need to add a couple of new services and around 10 characteristics. With this what is happening is that the increased sizes of the macros (mentioned above) are going out of bounds for the execution region ZI_RET20. What is the correct way of handling this?
同时编译,我收到错误:
Error: L6220E: Execution region ZI_RET20 size (9764 bytes) exceeds limit (8888 bytes) Region contains 0 bytes of padding and 0 bytes of veeners
Error: L6221E: Execution region ZI_RET20 with execution range () overlaps with execution region ZI_RET21 with execution range ()
I need atleast 2kB more memory. How to do increase the region size and till how much maximum can I do that.
你好,德里希,
我为延迟道歉。
因此,为了获得更好的主意,您现在拥有多个服务,包括2个自定义服务(允许在580上),并且REST是标准服务。
当您提到DA14580变得无响应时,您是否尝试调试它是否是由于堆栈问题而不是堆问题。请验证是否存在与堆栈崩溃相关的任何问题。您可以通过简单地用一个模式填充内存并查看它被修改到哪个部分来实现这一点。
总内存将根据描述,将只是所有的动态分配在每种类型的总和。
Best,
LC
不可以。我的所有服务和特征都是自定义具有128位UUID的。
我们有大量的服务(8-10个),特征(50-55个),特征值大小也相当大(每个特征差不多150个字节)
No I could not debug that failure since DA14580 is a part of a module (which has our MCU and DA14580). So we cannot debug it. Although, I could verify that it is related to memory as, when I reduce the input services and characteristics it works fine. Only, when I introduce a service or characteristic, the DA14580 does not respond after a certain command while adding the GATT database over UART
你好,德里希,
这个DA14580型has 8 kB of Retention RAM. You can only hold so much of Data in the Ret RAMs. This can be monitored from the MAP file and the application can be tuned as per the available memory. Please forward me your MAP file so that I can check on the memory usage.
另外,您的应用程序是否进入深度睡眠状态?您需要保留内存中的所有服务/字符吗?我想知道,如果您没有操作deep sleep来释放一些保留RAM,是否可以将数据移动到常规RAM。
只是确认一下,你用的是DA14581还是HCI?
Best,
LC
你好,
Thanks a lot for your support. Sorry for the late reply.
As of now, we are planning to use extended sleep. As per my understanding, the 8kB retention RAM along with entire sys RAM is retained during this sleep mode. Right?
So, I think it should be fine to move some data to regular RAM. I will try to move stuff on my own first. In case of any issues, I would send over the map file. Could you please share your email id for the same.
此外,我还想了解一些事情:
1. While adding a service, a total size is given and I assume that the stack allocates that much amount of memory for the characteristic values (as per the size) of that service. So out of the below, which type of heap is used for storing this:
DB\ U HEAP\ U SZ或ENV\ U HEAP\ U SZ或MSG\ U HEAP\ U SZ
2. If we decide to use extended sleep, Is it ok if I keep the env heap and msg heap in the retention RAM (utilizing the 8KB available) and move the db heap to sys RAM (or some other combination)? Will there be any problems in such a scenario?
三。如果我们决定使用深度睡眠模式,我们可以通过修改API SystemInit()中值0-23之间的EM\u映射配置来保留8kB以上的内存。如果是,使用这种配置可以保留多少最大内存量。
另一方面,请告诉我使用延长睡眠模式和深度睡眠模式的标准BLE外设的当前值。我只想了解一下目前收视率的不同。
谢谢,
hrishikesh.
你好,德里希,
请提供您的电子邮件,我将转发安全文件夹TP。这可以用于上传地图文件。
1. Adding any Services/Chars, the memory is allocated from DB_HEAP_SZ. However, since the overall code and data increases, the RAM usage (other heaps) will aslo increase accordingly.
2. It does not differ where you retain the memory in Extended sleep. So you can use any combination that fits the Memory organization.
3. When in Deep Sleep, all you can retain is only 8kB.
4. On a DA14580, typically the Extended Sleep currents range in between 1.2 - 1.4 uA and that of a Deep Sleep is approximately around 650nA. But please keep in mind, this can differ by the hardware design and the components used.
Best,
LC
你好,
Thanks for your reply. With this I assume that all the memory is retained in extended sleep mode. I am planning to use the extended sleep mode.
So, in terms of functionality what is the difference between extended and deep sleep mode? If there are any pointers for the same. then it would be useful for me to understand.
我已经基于ble\u app\u barebone示例应用程序(SDK:5.0.4)创建了我的应用程序。那么,默认情况下,这里使用的电源模式是什么?
此外,我已经将指针“app_on_system_powered”设置为定期呼叫的函数。我看到它要么返回goto_sleep和leep_powered。它与电源模式有关(在这种情况下延长睡眠)吗?
如果我连续返回并保持此函数的动力,会发生什么?
And, if I return GOTO_SLEEP, then will any activity on the UART or the BLE wake it up?
简而言之,我需要了解这些返回值的表明和结果。
谢谢,
hrishikesh.
嗨,德里希,
我们的数据表和用户手册中解释了睡眠模式。你可以查看7.1.1睡眠模式in ourUM-B-051_DA1458x_Software_Platform_Reference文件。
这个sleep mode is defined in theuser_config.h.项目中的文件。中的默认值白骨是Arch_sleep_off.which is usually the default in our SDK. That means it is in Active mode.
这个.app_on_system_powered当应用程序电源关闭后,应用程序想要保持系统活动状态。这旨在为应用程序提供一些数据/背景处理的额外处理时间。基于此处调用的函数将确定应用程序是否必须保持供电或可以睡眠。如果你去睡觉,那么它将在睡眠模式的末尾唤醒,以寻址BLE事件。有关唤醒DA14580的方法,请参阅我们的UM。但默认情况下,UART不会唤醒系统,而BLE则不会唤醒系统。
Best,
LC
你好,
谢谢你的回复。两件事:
1如果我修改了user\u config.h以使用扩展睡眠模式,但在整个返回过程中,通过我的app\u on \u system\u POWERED回调保持\u通电,是否会使用扩展睡眠模式?或者BLE仍然可以进入延长睡眠模式?
设置:我们的模块是一个外围解决方案,有一个外部MCU和DA14580。外部MCU通过GATT数据库和UART向DA14580发送广告数据,以便开始广告。
Now, ideally DA14580 can go in extended sleep. Going ahead, it might receive:
从单片机(ov。事件er UART) like indication (req to be sent to BLE central), updated advertisement data, disconnection request OR
ii. BLE central might send GATT read write commands to DA14580.
因此,我们如何适当地处理所有这些,并且仍然保持DA14580在延长睡眠中进行省电。
2.是否有一个应用笔记,有助于在扩展睡眠模式下读取BLE_APP_PERITELAL的读数。配置,引脚,方案和其他细节?我们可以先尝试在DA14580上,然后在模块上复制它以取实际读数。我看到training_04_sleep_modes_current_measurement_v1.0.pdf。我会通过这个检查。
你好,德里希,
1如果在运行期间保持应用程序处于活动状态app_on_system_powered过程中,无论启用了什么睡眠模式,系统都不会进入睡眠状态。
此外,如果假设您在下一个BLE事件即将发生在下一个BLE事件即将发生的情况下,我们提供了睡眠的许可,它是足够智能的,以确定它是否经济睡眠。如果它不是它会保持活跃。
为了你的申请,
从您的解释中,我了解到您正在UART上使用HCI实现。在这种情况下,可以使用外部唤醒机制从外部事件中唤醒系统。要设置此设置,您将在进入睡眠前在特定分配的GPIO上启用中断。在休眠期间,如果MCU发送此GPIO上的事件,系统将唤醒,您可以执行所需的处理。
注意:如果短缺GPIO,则可以使用其中一个接口(UART)引脚,您将在睡眠状态之前将其作为GPIO使其成为GPIO,并在唤醒之后修改为UART。请参考System Softwaresection inUM-B-051:DA14580以进一步了解该机制的工作原理。
2. Yes there is an app noteAN-B-051 SmartSnippets Power Profiler Calibrationfor guiding you through the current measurements. Also refer toAN-B-051 SmartSnippets Power Profiler Calibrationfor callibration of the dev kit to get acurate results.
Best,
LC