AnsweredAssumed Answered

CMSIS SPI Driver wait forever in SendData function

Question asked by button.benjamin on Feb 11, 2014
Latest reply on Feb 12, 2015 by padoan.davide.001
Hi all,

I'm trying to use the SPI interface on a STM32F207 with CMSIS.
Below you my sample code can be seen. The problem there is that within the function drv_Info->SendData(...) the function waits for the semaphore_busy but it somewhere hold and never released and therfore the function waits there forever.

How can I make the SendData(..) function work?
Is my code correct?

Every hint is very welcome
Benjamin

void th_SPI (void const *argument){
    ARM_SPI_STATUS              status;
    ARM_DRV_VERSION             version;
    ARM_SPI_CAPABILITIES    drv_capabilities;
    uint32_t busSpeed;
    uint8_t sendData[3];
    uint32_t cr1;
     
    sendData[0] = 16;
    sendData[1] = 24;
    sendData[2] = 144;
     
    drv_info = &Driver_SPI1;
    status = drv_info->Initialize(spiSignalCB);
    status = drv_info->PowerControl(ARM_POWER_FULL);
     
    SPI1->CR2 |= SPI_CR2_SSOE;  //enable SlaveSelect
    SPI1->CR1 |= SPI_CR1_MSTR;  //necessary to enable Master Mode
 
    status = drv_info->Configure(ARM_SPI_CPOL1_CPHA1,ARM_SPI_MSB_LSB); //clk polarity and phase see Reference manual and ad7794 datasheet
    busSpeed = drv_info->BusSpeed(1e4);
    drv_info->SlaveSelect(ARM_SPI_SS_ACTIVE);
 
    status = drv_info->SendData(sendData,3);
     
    if(status == ARM_SPI_ERROR){
        status ++;
    }
}

Outcomes