- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The document named "WICED Smart Hardware Interfaces" tell the maximum transaction size is 16 bytes for SPIFFY1 and SPIFFY2.
I tried to send 24 bytes data by the following code.
static const int CS_PORT = 33 / 16;
static const int CS_PIN = 33 % 16;
static const int MAX_BYTES = 16;
void
SPI_write(int pinCS, uint8_t* data, int length) {
while (length > 0) {
int bytes = length;
if (bytes > MAX_BYTES)
bytes = MAX_BYTES;
gpio_setPinOutput(CS_PORT, CS_PIN, GPIO_PIN_OUTPUT_LOW);
spiffyd_txData(SPIFFYD_2, bytes, data);
gpio_setPinOutput(CS_PORT, CS_PIN, GPIO_PIN_OUTPUT_HIGH);
length -= bytes;
data += bytes;
}
}
But the firmware crashed in spiffyd_txData.
How to send data exceed 16 bytes?
Solved! Go to Solution.
- Labels:
-
SPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi boont,
Thanks for the reply.
I checked out the spi_comm_master sample app.
It starts to send SPI data as master in application_spiffy2_send_bytes called from the following functions.
- spi_comm_master_fine_timeout ... Fine Timer Callback
- application_gpio_interrupt_handler ... GPIO interrupt handler
- spi_comm_master_write_handler ... BLE write handler
I understood that my app must use Fine Timer Callback to send data more than 15 bytes if it does not support FlowControl with slave !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check out this thread.
Very long SPI Transfer on the BCM20737
You may also like to check out the spi_comm_master/slave apps in the SDK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi boont,
Thanks for the reply.
I checked out the spi_comm_master sample app.
It starts to send SPI data as master in application_spiffy2_send_bytes called from the following functions.
- spi_comm_master_fine_timeout ... Fine Timer Callback
- application_gpio_interrupt_handler ... GPIO interrupt handler
- spi_comm_master_write_handler ... BLE write handler
I understood that my app must use Fine Timer Callback to send data more than 15 bytes if it does not support FlowControl with slave !