Re-use dedicated flash-SPI during FW operation

⚠️
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.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
5 posts / 0 new
Last post
gme_johannes
Offline
Last seen:2 weeks 3 days ago
加入:2017-12-22 10:09
Re-use dedicated flash-SPI during FW operation

Hi,
this is probably a trivial question:
I am using the Murata ZY with DA14580 internally. To connect to an SPI flash I have to use pins 0,5,6 (and 3 for CS) on bank 0 according to AN-B-023.
Can I use the same CLK/DI/DO for an SPI bus connecting to other peripherals, which will be accessed once the firmware is in the SRAM?
Since the bootup process should be completely independent from the operation of the firmware in the later stage, I guess there is no problem with that, as long as I make sure that the CS for all other components on this SPI bus stay disabled during the bootup routine.
Can this be achieved? Are all GPIOs in a defined state (should need to be pulled up for this) during the boot procedure?

Regards,
Johannes

Device:
MT_dialog
Offline
Last seen:2 months 4 weeks ago
Staff
加入:2015-06-08 11:34
Hi gme_johannes,

Hi gme_johannes,

Yes as you said, you will be able to use additional SPI sensors/memories on the same SPI bus as the primary flash memory, but you will have to be carefull and make sure that you keep the CS of the other device high and not toggling during the booting sequence since, if not, this might corrupt the image when the downloading of the SPI booting sequence occurs. All the pins of the 580 are default to input pull-down except from the pins of zero port which will be toggling depending on the state of the bootloader, so in order to do this you could use an external pull up in order to keep the CS high of the additional device, or burn the secondary bootloader and configure the pins as you like.

Thanks MT_dialog

gme_johannes
Offline
Last seen:2 weeks 3 days ago
加入:2017-12-22 10:09
Thank you for your answer.

Thank you for your answer.
Adding external pull-ups will require around 12k to achieve 0.7*VDD (taking into account the 100k pullup in the slave device).
This will lead to 10x current (330µA instead of 33µA) during SPI transmission with the IC.
Maybe not an issue, I didn't calculate the active SPI time at specific readout rates.

Nevertheless, maybe it is a better option to power the slaves through a GPIO of the device, and turn them on only after the firmware is loaded.
Any thoughts on that?

Best regards
Johannes

MT_dialog
Offline
Last seen:2 months 4 weeks ago
Staff
加入:2015-06-08 11:34
Hi gme_johannes,

Hi gme_johannes,

I suppose that you mean to power the external devices by gpios, so when the bootloader is executing they are pulled-down by default so they wont reply in any SPI command and have those gpios active only when the device powers up. I am not in favor of that practice, to power a device from a gpio, haven't test it, but it sounds ok as long as the sensor stays within the indicated sourcing current capability of the gpios which is about 4.8mA.

Thanks MT_dialog

gme_johannes
Offline
Last seen:2 weeks 3 days ago
加入:2017-12-22 10:09
Thank you for your comment.

Thank you for your comment.
I was aware of the 4.8mA limit and noticed only recently, that the magnetometer (BMM150) has a peak current draw of 20mA (although it probably stays below the 4.8mA with proper decoupling caps).
Nevertheless I will discard the idea, it's not a clean solution.

It seems that using the secondary bootloader and configuring the pins to my liking is the most elegant solution, as you have pointed out before.

Best regards,
Johannes