Hi,
I want to use the SPI together with an external flash for SUOTA. The pin configuration for the flash SPI is like on the Dev Kit Basic Board [1].
Additionally I want to control a second slave with a extra CS pin for selecting the device.
1. Referring to the SUOTA example presentation [2] there is no need of the spi_flash driver [3] because the boot routine checks if there is any external flash and if yes the program will be loaded from the external flash. I read this on the BootROM Sequence in the datasheet [4]. Is my assumption right?
2. Is it possible to use the CS pin for the second slave on a different port than the SPI interface?
I need it on port 2 pin 1. But as the code snipped below I don't think this would work because the pins are related to the port. Is this right?
user_periph_setup.h
```
#define SPI_GPIO_PORT GPIO_PORT_0
#define SPI_CLK_PIN GPIO_PIN_0
*#define SPI_CS_PIN GPIO_PIN_3*
#define SPI_DI_PIN GPIO_PIN_5
#define SPI_DO_PIN GPIO_PIN_6
```
user_periph_setup.c
```
*GPIO_ConfigurePin(SPI_GPIO_PORT, SPI_CS_PIN, OUTPUT, PID_SPI_EN, true);*
GPIO_ConfigurePin(SPI_GPIO_PORT, SPI_CLK_PIN, OUTPUT, PID_SPI_CLK, false);
GPIO_ConfigurePin(SPI_GPIO_PORT, SPI_DO_PIN, OUTPUT, PID_SPI_DO, false);
GPIO_ConfigurePin(SPI_GPIO_PORT, SPI_DI_PIN, INPUT, PID_SPI_DI, false);
```
3. If i want to use the SUOTA feature and additionally controll a second SPI slave. Which driver do I have to use? Only the SPI driver [5]?
4.spi_flash项目[6]只是检查if the SPI interface is working correctly and has nothing to do with the SUOTA. Is this right?
Hardware and SDK Version:
* DA14585
* SDK 6.0.10.511
[1]https://support.dialog-semiconductor.com/system/files/resources/E-DA1458...
[2]https://support.dialog-semiconductor.com/system/files/resources/Training...
[3] 6.0.10.511\sdk\platform\driver\spi_flash
[4]https://support.dialog-semiconductor.com/system/files/resources/DA14585_...
[5] 6.0.10.511\sdk\platform\driver\spi
[6] 6.0.10.511\projects\target_apps\peripheral_examples\spi\spi_flash
Thanks and best regards!
Hi Firefox2005,
Regarding the BootROM sequesnce, is independent from the spi_flash driver and the SUOTA functionality. You can control a second slave with a extra CS pin for selecting the device as you mentioned, but you should make sure that the second SPI slave is not active during procedure. The GPIOs are by default at zero and they are active low, so this means that the second SPI slave is by default active. To avoid that, you can add a pull-up in order to get it inactive during booting procedure and make sure that the DA14585 will boot from the external SPI flash. Since you do that, you can have SUOTA functionality and you can get active the second slave by configuring the CS at low. If you want to use the SUOTA feature and additionally control a second SPI slave, yes you can use the SPI driver. Also you have correctly mentioned that the spi_flash project does not implement SUOTA functionality and it demonstrates how to initiate, read, write and erase an SPI Flash memory using the SPI Flash driver.
Thanks, PM_Dialog