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,否则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) 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,

I have some more findings.

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

void periph_init(void) { // Power up peripherals' power domain SetBits16(PMU_CTRL_REG, PERIPH_SLEEP, 0); while (!(GetWord16(SYS_STAT_REG) & PER_IS_UP)); SetBits16(CLK_16M_REG, XTAL16_BIAS_SH_ENABLE, 1); //rom patch patch_func(); //Init pads set_pad_functions(); // (Re)Initialize peripherals 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正确编程),似乎是问题开始。固件对中断没有反应。

Following the observation (3) I have inspected the behavior with Ozone (spoiler: I used it for the first time). A breakpoint in

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引脚)

then shows that the callback is never executed, although the pin goes HIGH. The pin is correctly configured according to our schematic:

#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项目并慢慢将代码移动到该项目中。但是,我将在内部努力获得反馈。我会尽快回复你。

Thanks, PM_Dialog

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

Hi PM_Dialog,

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.
也许我应该开始使用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.

Can you please tell me - urgently - if interrupts on port 0 are not possible? What is the restriction here? SDK6? MultiSensor 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;

Thanks, PM_Dialog

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

Hi PM_Dialog,

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

Thanks,

约翰内斯