亲爱的Dialog支持人员,
我们正在使用新的Inventek ISM14585模块。我们希望使用BMI160(稍后添加BMM150)将MSK固件移植到此模块。在多传感器DK上,我成功地用BMI160替换了acc/陀螺仪并使其运行。
Now I have some trouble porting the firmware.
Observations:
(1)我不得不undef USE_SPI_FLASH_CONFIG,否则I got a hard fault (waiting for SPI to read the flash). I don't know what the problem could be. The internal flash of ISM14585 is a GigaDevice GD25D series.
(2) 我已经停用了env的大部分程序。传感器和磁强计在代码里。当我启动固件并连接物联网应用程序时,UART显示以下内容:
========IoT+ STARTED======== INFO: Sensors Initilization INFO: Sensors Suspend INFO: Adv Started, value:160 INFO: IoT+ Connected INFO: Sensors Initilization INFO: Sensors Suspend INFO: DWS cmd: 21 INFO: DWS cmd: 22 INFO: DWS cmd: 11 INFO: DWS cmd: 1 INFO: Sensors Started INFO: DWS cmd: 17 INFO: DWS cmd: 13 INFO: DWS cmd: 20 INFO: DWS cmd: 26
After this, nothing happens. The app does not show any sensor data.
Findings:
(A) 我测量到BMI160中断一直很高,似乎DRDY中断不起作用。
除此之外,我看到CS,CLK,MISO,MOSI没有任何异常。
(B) 在UM-B-101的附录A中,我发现多传感器DK实际上使用了一个辅助引导加载程序,负责一些配置步骤;但在我看来,它并没有为BMI160做任何重要的事情(尽管它为原来的acc/陀螺仪做了一些配置)。
在ISM14585中,OTP使用辅助引导加载程序进行烧录,因为内部flash CS映射到P0\u7而不是P0\u3(因此,如果没有这个,它将无法在dev模式下引导)。
My Questions:
(1) What can be the reason that I don't see the interrupt from BMI160 going low?
(2) 是否需要特殊的辅助引导加载程序?我可以通过将生成的十六进制文件闪存到闪存中来移植固件吗?
非常感谢你的帮助。
约翰内斯

Hi Johannes,
请让我知道哪些GPIO连接到BMI160,这样我就可以在我这边运行它了。
我不太喜欢使用传感器物联网标签固件作为应用程序的起点。你将被留下许多半途而废的代码片段,最终会咬你一口。更好的方法是使用空的模板项目,然后慢慢地将代码片段移动到该项目中。
/MHv公司
Hi MHv,
ad 1.:
GPIO映射很简单,SPI总线与flash在CLK/MOSI/MISO、CS(P1\u3)和DRDY/INT(P0\u1)的标准端口上共享,我已正确配置。初始化应该与多传感器DK一起工作,因为DK能够与BMI160一起工作(我们已经验证)。
ad 2.:
A secondary bootloader has been burned to OTP by the manufacturer Inventek. I will discuss with them why they have not done it as you suggested. Maybe it is a misunderstanding.
我知道如何配置SmartSnippets, after all I have the firmware running and advertising (booting from flash).
In UM-B-101 it is stated that the MS DK secondary bootloader [...]
这就是为什么我问这个特定的引导程序的必要性。通过查看代码,我的印象是引导加载程序确实为ICM42605配置了一些东西,但没有为可选填充的BMI160配置。
For our previous prototype, that was based on the Murata ZY, we have ported the "old" IoT Sensor SDK, which as worked just fine. Certainly starting from scratch is a cleaner solution, but with limited manpower, stripping down an existing project is the faster approach...
约翰内斯
Hi Johannes,
辅助引导加载程序中的IMU初始化并不重要(坦率地说,我不知道我们为什么将它放在那里),而且我在代码中没有看到任何对BMI160的引用。很抱歉问了这么明显的问题,但我假设您已将BMI160完全按照多传感器套件中的连接方式连接(使用相同的中断等)。我还假设您已经正确初始化了总线(在辅助引导加载程序中,这是为ICM IMU管理的,包括gpio的选择)。
I will reach out to you directly later today to help troubleshoot this.
/MHv公司
Hi MHv,
I have some more findings.
(1) The initialization seems to be correct, whatever the bootloader may do, the MS DK also configures the GPIOs correctly. GPIOs and SPI parameters are configured in set_pad_functions and iot_dk_spi_init:
(2) I observe the exepcted activity on MISO, MOSI, CLK, CS with an oscilloscope. SPI seems to be working fine.
(3) I observe that the BMI160 interrupt goes high (shows again that the BMI160 seems to be programmed correctly through SPI), and this seems to be were the problem starts. The firmware does not react to the interrupt.
Following the observation (3) I have inspected the behavior with Ozone (spoiler: I used it for the first time). A breakpoint in
在文件中,interface.c显示中断确实正在被配置。中的断点
then shows that the callback is never executed, although the pin goes HIGH. The pin is correctly configured according to our schematic:
[编辑;删除了一部分,我现在认为是正常的,没有帮助找到问题]
In your earlier response you indicated that you wanted to contact me, but I did not receive a notification or email. Do you require my contact info?
约翰内斯
编辑:
(a) The same is true is I enable the wake on motion feature. I can observe that the device goes to sleep, the interrupt is low. When I move the sensor, the pin indeed goes high, but the firmware does not react to it.
(b) I have disabled sleep mode for those tests.
亲爱的Dialog支持人员,
我仍在急切地等待答复。中断不起作用的原因是什么?如何进一步调查臭氧的问题?
约翰内斯
Hi gme_johannes,
My apologies for the delay. I totally agree with MHv_Dialog and I think the best approach would be to use the empty_peripheral_template project and slowly move pieces of code into that project. However, I will the Team internally to get their feedback. I will get back to you as soon as possible.
谢谢,下午好
嗨,PM\U对话,
considering how much our project has in common with the MultiSensor DK (everything except for: missing env sensors, different magnetometer, different pinout, different flash/PA), I hope that you can understand that I still favor the approach of stripping down/modifying the MultiSensor DK. I hope that you have some ideas how to investigate why I don't see the interrupt.
Maybe I should start with testing the interrupt functionality itself with the empty_peripheral_template.
约翰内斯
嗨,PM\U对话,
[any news? Any idea how I can solve this problem? Instructions for verification with Ozone would be great.]
编辑:
After lenghty investigations in the code, I noticed that in
仅检查寄存器P1和P2。然后我看到UM-B-101第20页写着:
Can you please tell me - urgently - if interrupts on port 0 are not possible? What is the restriction here? SDK6? MultiSensor DK? DA14585?
编辑2:
I have modified the callback function and just added according conditions for port 0, it seems to work without a flaw.
It isVERYunfortunate how long it took for me to find this out. Sure, it is documented... but I would never have guessed that the implementation is incomplete. I would be very curious to understand the reason.
约翰内斯
Hi gme_johannes,
根据UM-B-101文件,585 MSK固件扩展了中断处理的可能性,以便唤醒。当前此模块支持端口1和2中的中断,因为端口0保留给其他作用域。请记住,585 MSK的设计是为了配合MSK的硬件。请看表1UM-B-101:DA14585物联网多传感器开发工具包开发人员指南文档以检查端口0分配。此外,如果您检查wkup\u ad\u cb()的源代码,您将看到它是为端口1和2配置的。
谢谢,下午好
嗨,PM\U对话,
as I've written in the second edit, I have solved the problem. It was unproblematic to get the interrupt on port 0, after all.
Thanks,
Johannes