Port IoT code to Murata ZY (DA14580)

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
gme_johannes
Offline
Last seen:23 hours 8 min ago
Joined:2017-12-22 10:09
Port IoT code to Murata ZY (DA14580)

I am working with IoT Sensor Kit SDK v5.160.1.19 and want to port the project to the Murata ZY module, which incorporates DA14580.

I have attached W25X20 flash to the bootable SPI bus (AN-B-023 Table 3).
In Keil, I have removed __DA14583__ from the preprocessor symbols.

I have made the following changes to the code:

user_periph_setup.h
#define SPI_FLASH_DEFAULT_SIZE --> changed to 262144

user_periph_setup.c
spi_driver_cs_pad.* --> changed to SPI flash CE pin/port on my board

user_platform.h
#define SPI_FLASH_* --> changed to SPI flash ports on my board
#define BMI* --> changed to same ports (SPI bus is shared between sensors and flash)
#define BMM* --> changed to same ports (SPI bus is shared between sensors and flash)
#define SPI_*_PIN --> changed to same ports
#define DA14583_SPI_FLASH* --> changed to same ports
#define DA14583_SPI_FLASH_SIZE --> changed to 0x40000

gpio.c
RESERVE_GPIO(DA14583_INTERNAL_FLASH_SPI_*) --> changed to SPI flash ports on my board

Furthermore I have changed the interrupt pins accordingly.
Unfortunately after flashing the ROM (with "bootable" enabled) the device does not start advertising.

Questions:
(1) What other steps am I missing to port the code successfully to DA14580?
(2) The sensors are not yet connected to SPI (I have left their CS unconnected), can this be a problem? Will the code halt before advertising BT?
(3) Do I have to make changes in the code regarding battery/power? IoT Sensor kit is operating in BOOST mode from coin cell, I am operating from 3.3V.
(4) Is there recommended Kyle project for first bring-up? I am thinking of a firmware which will just output some text through the UART such that I can verify successful booting from the SPI flash. I have seen in Training7 of the Prototype Bring-up Guide . Is the empty_peripheral_template suitable for such a test, or is this just suitable to test BT?

Best regards
Johannes

Device:
PM_Dialog
Offline
Last seen:1 day 22 hours ago
Staff
Joined:2018-02-08 11:03
Hi gme_johannes,

Hi gme_johannes,

  1. This is not something that we can provide guidance, this kind of porting has not been attempted from Dialog since there is no reference design of the IoT using the 580. What you will have to do is debug the code and check where the code stalls, the fact that have just changed the flash settings doesn't mean that the fw will operate over a 580, for example have you kept the same pins for the sensors ? The code might stall at that point when trying to communicate with the external devices.
  2. Yes, that is an issue, but if you don’t debug the code you won’t be able to know what exactly happened. The fw communicates with the sensors from the user_wrbl_app_on_init() function.
  3. The IoT reference design is using the 583 device which CANNOT operate in boost mode but only in buck, so you won’t have any issues with this.
  4. You can use the peripheral_examples and the UART example, as soon as you power the device and have attached the proper wires for accessing the UART then you should see the device printing.

Thanks, PM_Dialog

gme_johannes
Offline
Last seen:23 hours 8 min ago
Joined:2017-12-22 10:09
Hi,

Hi,
thank you for your answer. I understand you can not provide detailed guidance, I will try it on my own and already had some further success.
I have the code running now such that I can discover it with a BT scanner.

关于之前的问题:
(1) I have also changed GPIOs for the sensors, I forgot to mention it. However they are not connected at the moment.
(2) Thank you, I have identified what you meant.
(3) Misunderstanding from my side, I thought it was operating from a 1.5V cell, I see now that it is in fact 3.0V. Thank you.
(4) Unfortunately Kyle is showing only "boxes" in the UART terminal.
这也是case when I try it with your original DA14583 IoT sensor with original firmware (v5.160.1.19) when I press reset (probably just a glitch from booting).
Connecting through UART per se is not a problem, e.g. I can access and program through it (hence I assume baud rate is set correctly to 56k in smart snippets).
Is there no output on UART in the default project? I had assume that something like this "DBG_MSG("ADV UNDR COMPLT\r\n");" will be output to UART as default.

Best regards
Johannes

PM_Dialog
Offline
Last seen:1 day 22 hours ago
Staff
Joined:2018-02-08 11:03
Hi gme_johannes

Hi gme_johannes

我不能够明白你的意思with your last statement “Kyle is showing only boxes in the UART terminal”.Could you please explain little bit more what you mean exactly? As If I understand correctly, you mean that if you attach the UART pins to an FTDI cable and open a terminal, you only get that output? If this is the problem, you are able to see the bootloader executing, so there is no firmware downloaded to your device. You have requested in your previous post something basic, a firmware that will just print out a few characters over the UART, if you download the indicated firmware you will be able to see what you want to print. Regarding printing from the IoT project, you should define the CFG_PRINTF in the da1458x_config_basic.h file and attach an FTDI cable on the corresponding pins of the CIB board. After that configuration, you will be able to print.

Thanks, PM_Dialog