In normal USB-Serial SPI slave operation, it is expected to read the exact number of bytes of data written. Else, the Slave will return error.
The device operating as SPI slave will not allow new data to be written when the expected count is reached.
What should be done if the device is set up as a slave and the master does not know how many bytes will come through?
Could you send a read for an amount larger than what you expect? and potentially get back the desired data and then a bunch of zeros?
You can use the SPI slave CDC class in this case.
You can define a larger read size than the expected data write size from master, the SPI CDC slave will return the amount of data being received.
In case you define a smaller slave read size than the master write size, the slave read API will return as soon as the defined size in the SPI read is received.
For application development we have CyUSBSerialVCP library and an example project as well. Please refer to the USB-Serial SDK.
Also, when using SPI CDC class instead of developing a windows application, you can make use of a serial terminal like teraterm to capture the data continuously and display it.
Please let me know if you have any more queries.