⚠️
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
shpasser
Offline
Last seen:8 months 4 weeks ago
Joined:2018-11-02 09:31
DA14580 as SPI slave

Good Morning,

It is some time I'm having issues while using DA14580 as an SPI slave. My implementation is based on "prox_reporter_ext_spi" example.

Setup:

The current pin configuration is as follows (same as in the example):

GPIO_ConfigurePin(SPI_GPIO_PORT, SPI_CLK_PIN, INPUT_PULLUP, PID_SPI_CLK, false);
GPIO_ConfigurePin(SPI_GPIO_PORT, SPI_CS_PIN, INPUT_PULLDOWN, PID_SPI_EN, false);
GPIO_ConfigurePin(SPI_GPIO_PORT, SPI_DO_PIN, OUTPUT, PID_SPI_DO, false);
GPIO_ConfigurePin(SPI_GPIO_PORT, SPI_DI_PIN, INPUT_PULLDOWN, PID_SPI_DI, false);

Besides DA14580 we have another slave using the same SPI interface (except the CS pin) - SPI flash.

The master is STM32L4.

Parameters:

While trying to use different SPI clock frequencies we settled on 1.25MHz which provides a stable communication.

In addition in order to make the communication stable I had to add delay of several milliseconds after each SPI transaction.

Issues:

1. Sometimes the communication with the SPI flash gets "stuck" and nothing but system reset helps.

2. After the initial initialization of DA14580 (reset via the reset pin and software loading via UART) in order to

reset DA14580 again I have to perform several reset sequences (reset ON/OFF) with delay in between in order

to start loading the software via UART.

Questions:

1. While reading the serial boot document (AN-B-001) I noticed that the maximal recommended SPI clock speed is 500kHz.

Would you advice to use 500kHz instead of 1.25MHz in my case and why?

2. In most cases that I've seen, SPI interface pins are not configured with pull up/down resistors except the CS pin.

Would you advice to remove these pull up/down settings? If you suggest to leave them as is please explain why.

3. Any reasons regarding the described "reset" issue?

Thanks in advance,

Ron.

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

Hi shpasser,

Thanks for you question online. Do you have a custom board with the DA14580 and STM32L4? When the DA14580 acting as SPI Slave, we have observed some issues with the cables’ sensitivity. Regarding the sensitivity, due to spikes and reflections, in most of the cases, this was the reason that there wasn't any communication from the DA14580's side towards the master. Would it be possible to use a logic analyzer, probe the SPI lines and share an SPI capture?

Regarding your questions, I will check them internally and let you know.

Thanks, PM_Dialog

shpasser
Offline
Last seen:8 months 4 weeks ago
Joined:2018-11-02 09:31
I am indeed using a custom

I am indeed using a custom board with STM32L4 and DA14580 on it.

I checked with our board designer and he says there is no way we will be able to connect a logic analyzer.

Thanks in advance.

shpasser
Offline
Last seen:8 months 4 weeks ago
Joined:2018-11-02 09:31
Please answer my questions

Please answer my questions

PM_Dialog
Offline
Last seen:1 day 17 hours ago
Staff
Joined:2018-02-08 11:03
Hi shpasser,

Hi shpasser,

Apologies for the delay and thanks for pinging me – probably I missed your previous reply. Please find below me answers:

  1. Yes, according to AN-B-001 document, in case of a continuous SPI clock, the frequency of this clock must not be higher than 500 kHz. To do so, my recommendation would be to lower down the clock to 500 kHz. The SPI master configuration for the DA14580 is quite sensitive and the wiring can cause lot problems since it can mistakenly receive small spikes or reflections as pulses.
  2. My suggestion would be to leave the pull up/down resistors as they are in the default configuration on the prox_reporter_ext_spi. I have sked internally the HW team to provide why should be left as it is.
  3. According to your description, I am not able to understand which a possible reason for would be the “reset” reason. Since you are unable to connect a Logic Analyzer and provide a SPI trace, we can’t investigate which the route cause is. Probably, this might my due to the 1.25MHz clock speed which is higher that the recommend one.

Thanks, PM_Dialog