发送写操作而无响应时固件崩溃

14 posts / 0 new
最后一篇文章
GCB布莱尔
离线
最后一次见到:4年7个月前
硕士
已加入:2014-09-08 10:21
发送写操作而无响应时固件崩溃

你好,

I am trying to send some data from a tablet to our firmware using write without response.
当我发送超过1200字节的固件崩溃。调试器停止,所有核心寄存器都设置为0,调用堆栈为空

What we do is, we send 200 bytes and then read a characteristic to tell us if the data arrived ok or not. Then we send the next 200 bytes.
我看不到任何寄存器或处理程序,可以帮助我调试的情况。

知道如何调试或修复它吗?我们正处于项目的关键时期。

布莱恩
离线
最后一次见到:5年11个月前
Expert 硕士
已加入:2014-10-16 18:10
Are you on Windows 8? I get

你在Windows 8上吗?我的行为和你一样,但原因不同。我相信这是由于STRH指令来自未对齐的内存。这应该会导致一个硬故障,而不是一个完全重置崩溃,而在Windows7上工作时,我得到的硬故障。是的,编译器应该对齐内存,但是有些地方出错了。

GCB布莱尔
离线
最后一次见到:4年7个月前
硕士
已加入:2014-09-08 10:21
I am on windows 8 yes. It is

我在Windows8上是的。这是一个严重的问题,虽然,因为它是不可能的,我调试。我只知道问题是一致的。
我可以试着找一台Windows7机器,但是为什么你认为我在Windows8上没有硬故障呢?他们之间有那么大的区别吗?

GCB布莱尔
离线
最后一次见到:4年7个月前
硕士
已加入:2014-09-08 10:21
好吧,我试过Windows7,

好的,我试了Windows7,结果完全一样!

布莱恩
离线
最后一次见到:5年11个月前
Expert 硕士
已加入:2014-10-16 18:10
很抱歉听到这个消息。是的

很抱歉听到这个消息。是的just a guess because that's what I get. However, I don't understand it at all. But I am certainly familiar with the problem! There is absolutely no way I have found to debug it either. In my case I have the DA14580 connected to Tera Term and when that error happens I get just a bunch of garbage being printed to the screen; exactly like one gets before uploading the HEX file. I have not had that happen on Windows 7 but that is my case which is clearly happening while the system is initializing (before it ever gets to app_init()). You are clearly up and running. I have to say sometimes I get the hardfault on Windows 8 as well. Small changes in the organization of this struct make a big difference.

这里还有一些你可以看的东西。我假设你有一个缓冲区来接收写入的数据。检查out/lst目录中的映射。看看它是在跳转表之前加载的,还是在arch\u main中加载的。

先找一条像这样的线
rwip\ U rf 0x0008071c数据0 rom_symdef.txt文件绝对的

现在寻找你的阵型。在我的例子中,我使用的结构是在系统中这些关键任务项之前加载的。即使大小是正确的,如果它被对齐错误的灾难可能会发生(显然)。缺点是我无法控制系统加载数组的位置。我也在记忆枯竭的边缘(我正在写一个完全托管的中心)。如果该缓冲区(假设您有一个)正好位于跳转表堆之类的关键对象之前,请查看是否可以在缓冲区和该表之间插入一个较小的缓冲区。您需要在该缓冲区中使用某些内容,否则编译器将对其进行优化(除非您在优化级别0下运行)。

我并不是说这能解决任何问题,但考虑到其他的选择(不知道该怎么办),这是值得一试的。

GCB布莱尔
离线
最后一次见到:4年7个月前
硕士
已加入:2014-09-08 10:21
布莱恩,

布莱恩,

就是这样,我没有缓冲区,所有的缓冲区都来自堆栈。数据直接来自堆栈的gattc\u write\u cmd\u ind\u处理程序,我使用attmdb\u att\u set\u value将其保存到数据库中。
在这个过程中,我根本不使用缓冲区。
谢谢你的帮助,布莱恩,希望Dialog的人能给我们更多的启示。我猜他们用的是同样的方法

AK_Dialog
离线
最后一次见到:2周2天前
工作人员
已加入:2013-12-16 15:49
你好,

你好,

This maybe caused by the fact that the DA14580 goes into sleep mode or the Watchdog timer jumps in.

Are you using sleep mode? Is the Watchdog used?

对话蓝牙支持团队。

GCB布莱尔
离线
最后一次见到:4年7个月前
硕士
已加入:2014-09-08 10:21
你好,

你好,

看门狗和延长睡眠和深度睡眠模式都被禁用。

AK_Dialog
离线
最后一次见到:2周2天前
工作人员
已加入:2013-12-16 15:49
嗨,如果你查一下我们的密码

您好,如果您查看我们的代码,您可以看到出于调试目的,NMI处理程序(NMI\u handler.c)和Harfault处理程序(hardfault\u handler.c)将转储内存中的ARM寄存器(包括PC和SP)。在“崩溃”之后,您可以访问调试器并调查“last”状态。

对话蓝牙支持团队。

GCB布莱尔
离线
最后一次见到:4年7个月前
硕士
已加入:2014-09-08 10:21
它与调试器崩溃

它与调试器崩溃attached.
不调用硬故障,包括PC在内的所有寄存器都为空。
我需要尽快让这个为客户工作,所以我很高兴向您发送我们的固件和android代码,如果它有帮助

GCB布莱尔
离线
最后一次见到:4年7个月前
硕士
已加入:2014-09-08 10:21
你好,

你好,

我怀疑这是一个堆栈问题,所以我将BLE\u CONNECTION\u MAX\u USER增加到2,这将增加堆栈(#define NON\u RET\u HEAP\u SIZE,#define ENV\u HEAP\u SIZE#define MSG\u HEAP\u SIZE)

我现在可以发送我的数据而不会崩溃。
However if I double the amount of data I send to 3200 bytes, of course it crashes. It is obvious a memory issue inside the stack
As I said in my original post, I read the characteristic back every 200 bytes to make sure the data has been written so I can't see why there should be any stack overflow issues.

你能帮忙吗?

GCB布莱尔
离线
最后一次见到:4年7个月前
硕士
已加入:2014-09-08 10:21
你好,

你好,

我怎样才能在这个问题上得到帮助?已经过去5天了,你唯一的回复就是查看我在原来的帖子中已经告诉你的一些事情。

GCB布莱尔
离线
最后一次见到:4年7个月前
硕士
已加入:2014-09-08 10:21
我解决了问题,我

我解决了这个问题,我没有从处理每次写入数据的任务中返回任何内容。很遗憾没有错误处理

维生素A
离线
最后一次见到:1 week 18 hours ago
工作人员
已加入:2014-02-07 14:10
Good to hear the issue was

很高兴听到问题解决了。很抱歉延迟了回复。