Porting IoT MultiSensor to ISM14585 module

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
11个帖子/ 0新
最后一篇
gme_johannes
离线
最后一次露面:3 weeks 2 days ago
加入:2017-12-22 10:09
Porting IoT MultiSensor to ISM14585 module

Dear Dialog Support,

我们正在与新的Inventek ISM14585 module. We want to port the MSK firmware to this module, using BMI160 (and later add BMM150). On the MultiSensor DK I have successfully replaced the acc/gyro with BMI160 and got it running.

现在我有一些麻烦移植固件。

观察

(1)我不得不undef use_spi_flash_config,否则我有一个硬故障(等待spi读取闪光灯)。我不知道问题可能是什么。ISM14585的内部闪存是Gigadevice GD25D系列。

(2) I have deactivated most routines of env. sensors and the magnetometer in the code. When I start the firmware, and connect with the IoT app, UART shows the following:

======== IOT +开始========信息:传感器启动信息:传感器暂停信息:adv启动,值:160信息:IoT +连接信息:传感器启动信息:传感器暂停信息:dws cmd:21信息:DWS CMD:22信息:DWS CMD:11信息:DWS CMD:1信息:传感器启动信息:DWS CMD:17信息:17信息:DWS CMD:13信息:DWS CMD:20信息:DWS CMD:26

在此之后,没有任何反应。该应用程序没有显示任何传感器数据。

发现

(A) I measured that the BMI160 interrupt is constantly high, it seems the DRDY interrupt is not working.
Apart from that, I see CS, CLK, MISO, MOSI without any abnormalities.

(B) In UM-B-101, appendix A, I discovered that the MultiSensor DK actually uses a secondary bootloader that takes care of some configuration steps; but it did not seem to me that it does anything crucial for BMI160 (whereas it does some configuration for the original acc/gyro).
In the ISM14585, OTP is burned with a secondary bootloader since the internal flash CS is mapped to P0_7 instead of P0_3 (thus it would not boot from in dev mode without this).

我的问题

(1)什么可能是我从BMI160的中断下降的原因是多少?
(2) Is the special secondary bootloader necessary? Can I port the firmware by just flashing the resulting hex file into the flash?

Your help is very much appreciated.

BR Johannes

Device:
mhv_dialog.
离线
最后一次露面:2 months 4 weeks ago
职员
加入:2013-12-06 15:10
嗨Johannes,

嗨Johannes,

Please let me know which GPIOs are connected to the BMI160 so I can run it on my side.

  1. 显然,BMI160的所有初始化以及GPIO映射都必须正确工作
  2. The secondary bootloader is not necessary. It is possible to specify the required GPIOs for bootloading through a register of the OTP header instead. You can flash your resulting hex file (actually SmartSnippets toolbox will convert it to a binary file first) directy into the flash. You must set the SPI GPIOs in SmartSnippets toolbox to specify that P0_7 is SPI CS.

I am not a big fan of using the Sensor IoT tag firmware as a startingpoint for your application. You will be left with lots of halfway supported pieces of code that will end up biting you. A better approach would be to use the empty_peripheral_template project and slowly move pieces of code into that project.

/MHv

gme_johannes
离线
最后一次露面:3 weeks 2 days ago
加入:2017-12-22 10:09
嗨mhv,

嗨mhv,

广告1 .:
GPIO mapping is trivial, SPI bus is shared with flash on the standard ports for CLK/MOSI/MISO, CS (P1_3) and DRDY/INT (P0_1) I have configured correctly. Initialization should work OOB with MultiSensor DK, since the DK is capable of operating with BMI160 (which we have verified).

广告2 .:
制造商Inventek已被刻为OTP的二级引导加载程序。我会与他们讨论为什么他们没有按照你建议这样做。也许这是一种误解。
我知道如何配置SmartSnippet,毕竟我拥有固件运行和广告(从Flash启动)。
在UM-B-101中,表示MS DK次级引导加载程序[...]

Initializes the IMU (ICM42605 or BMI160) device to operate in SPI mode.

Which is why I asked about the necessity of this specific bootloader. From looking into the code, I am under the impression that the bootloader does configure something for ICM42605, but not for the optionally populated BMI160.

对于我们以前的原型,这是基于Murata Zy的原型,我们已经移植了“旧”物联网传感器SDK,这恰好好了。当然从划痕开始是一个更清洁的解决方案,但使用有限的人力,剥去现有的项目是更快的方法......

BR Johannes

mhv_dialog.
离线
最后一次露面:2 months 4 weeks ago
职员
加入:2013-12-06 15:10
嗨Johannes,

嗨Johannes,

The IMU initialization in the secondary bootloader is not important (I frankly have no idea why we placed it there), and I don't see any reference to the BMI160 in the code. Sorry for asking obvious questions, but I assume that you have wired the BMI160 exactly as it was connected in your multi sensor kit (using the same interrupt etc). I would also assume that you have correctly initialized the bus (in the secondary bootloader this was managed for the ICM IMU - including selction of the GPIOs).

我今天晚些时候直接与您联系,以帮助排除故障。

/MHv

gme_johannes
离线
最后一次露面:3 weeks 2 days ago
加入:2017-12-22 10:09
嗨mhv,

嗨mhv,

我有更多的发现。

(1)初始化似乎是正确的,无论引导加载程序都可能做,MS DK还正确配置GPIO。GPIOS和SPI参数配置在set_pad_functions和iot_dk_spi_init中:

void periph_init(void){//上电外设'Power Domain SetBits16(PMU_CTRL_REG,PERIPH_SLEEP,0);而(!(getword16(sys_stat_reg)&per_is_up));setBits16(CLK_16M_REG,XTAL16_BIAS_SH_ENABLE,1);// rom修补程序patch_func();// init pads set_pad_functions();//(re)初始化外设iot_dk_spi_init(Accel_cs_port,Accel_CS_PIN,SPI_XTAL_DIV_2);

(2)我观察MISO,MOSI,CLK,CS与示波器的emcted活动。SPI似乎很好。

(3)我观察到BMI160中断变高(再次显示BMI160似乎通过SPI正确编程),似乎是问题开始。固件对中断没有反应。

观察(3)我用臭氧检查行为(扰流板:我第一次使用它)。一个断点

void si_setup_interrupts(si_list_entity_t *ptr)

in the file sensors_interface.c shows that the interrupt is indeed being configured. A breakpoint in

void si_gpio_irq_cb(uint8_t端口,uint32_t引脚)

然后显示回调从未执行,尽管引脚变高。根据我们的原理图正确配置PIN:

#define accel_drdy_port gpio_port_0 #define accel_drdy_pin gpio_pin_1 [...] gpio_configurepin(Accel_drdy_port,Accel_drdy_pin,input_pulldown,PID_GPIO,FALSE);

[edit; deleted a part that I now figured is normal and does not help to find the problem]

在您之前的回复中,您表示您希望与我联系,但我没有收到通知或电子邮件。您需要我的联系信息吗?

BR Johannes

edit:

(a)相同是真的,我可以在运动功能上启用唤醒。我可以观察到设备睡眠,中断低。当我移动传感器时,引脚确实变高,但固件对其没有反应。
(b)我已经为这些测试禁用了睡眠模式。

gme_johannes
离线
最后一次露面:3 weeks 2 days ago
加入:2017-12-22 10:09
Dear Dialog Support,

Dear Dialog Support,

I am still urgently waiting for an answer. What could be the reason for the interrupt not to work? How can I further investigate this issue with Ozone?

BR Johannes

PM_Dialog
离线
最后一次露面:1 day 7 hours ago
职员
加入:2018-02-08 11:03
嗨gme_johannes,

嗨gme_johannes,

我为延迟道歉。我完全同意mhv_dialog,我认为最好的方法是使用empty_peripheral_template项目并慢慢将代码移动到该项目中。但是,我将在内部努力获得反馈。我会尽快回复你。

谢谢,PM_Dialog

gme_johannes
离线
最后一次露面:3 weeks 2 days ago
加入:2017-12-22 10:09
Hi PM_Dialog,

Hi PM_Dialog,

考虑到我们的项目与多人传感器DK有多少次(除了:缺少Env传感器,不同的磁力计,不同的引脚,不同的Flash / Pa),我希望您能理解我仍然有利于剥离/修改的方法多传感器DK。我希望你有一些想法如何调查为什么我没有看到中断。
也许我应该开始使用empty_peripheral_template测试中断功能本身。

BR Johannes

gme_johannes
离线
最后一次露面:3 weeks 2 days ago
加入:2017-12-22 10:09
Hi PM_Dialog,

Hi PM_Dialog,

[任何新闻?任何想法如何解决这个问题?臭氧验证说明将是很棒的。]

edit:
在代码中的长期调查之后,我注意到了

void wkup_ad_cb(void)

only registers P1 and P2 are checked. Then I saw tha in UM-B-101 page 20 it is stated:

Currently this module supports interrupts in port 1 and 2. This hardware configuration does not support other ports.

你能告诉我 - 迫切会告诉我 - 如果港口0上的中断是不可能的吗?这里的限制是什么?SDK6?多传感器DK?da14585?

edit2:
我已经修改了回调函数并刚刚根据端口0的条件添加,似乎没有缺陷的工作。
这是非常不幸的是我找到这一点需要多长时间。当然,它被记录在内......但我永远不会猜到实施是不完整的。我非常好奇地理解原因。

BR Johannes

PM_Dialog
离线
最后一次露面:1 day 7 hours ago
职员
加入:2018-02-08 11:03
嗨gme_johannes,

嗨gme_johannes,

According to UM-B-101 document, the 585 MSK firmware extends the possibilities of interrupt handling in order to wake up. Currently this module supports interrupts in port 1 and 2 because port 0 is reserved for other scope. Keep in mind that 585 MSK is designed to work together with MSK hardware. Please take a look at Table 1 ofUM-B-101: DA14585 IoT Multi Sensor Development Kit Developer Guidedocument in order to check the port 0 assignment. In addition, if you check the source code of wkup_ad_cb(), you will see that is configured for port 1 and 2.

// IO Ports registers volatile uint32_t *ptr_P1 = (volatile uint32_t *)P1_DATA_REG; volatile uint32_t *ptr_P2 = (volatile uint32_t *)P2_DATA_REG;

谢谢,PM_Dialog

gme_johannes
离线
最后一次露面:3 weeks 2 days ago
加入:2017-12-22 10:09
Hi PM_Dialog,

Hi PM_Dialog,

正如我在第二个编辑中写的那样,我已经解决了这个问题。毕竟在端口0上获取中断是毫无疑问的。

谢谢,

约翰内斯