SpiConfig = XSpiPs_LookupConfig(DeviceId);
ttif (NULL == SpiConfig) {
tttreturn XST_FAILURE;
tt}
ttStatus = XSpiPs_CfgInitialize(&Spi, SpiConfig, SpiConfig->BaseAddress);
ttif (Status != XST_SUCCESS) {
tttreturn XST_FAILURE;
tt}
ttXSpiPs_SetOptions(&Spi, XSPIPS_MANUAL_START_OPTION |
tttttXSPIPS_MASTER_OPTION);
ttXSpiPs_SetClkPrescaler(&Spi, XSPIPS_CLK_PRESCALE_128);
tttt {
tttt int Status;
tttt XSpiPs_SetSlaveSelect(&Spi, 0x5);
tttt Status = XSpiPs_PolledTransfer(&Spi, SendBufPtr, NULL,
tttt ttt4 + ByteCount);
tttt if (Status != XST_SUCCESS) {
tttt ttprint("
failed to transfer
");}
tt}
With the code above I always get either failed to transfer or the SPI hangs. This is a PS SPI. None of the output pins show any activity, using a uZed running as bare metal. Using "peripheral test" the SPI passes.