This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to use HAL_UART_SPI ??

Other Parts Discussed in Thread: CC2540

Hi All,

  In the HAL,I can find the driver of SPI Vai UART interface.

I try to read and write the flash(W25Q32) with SPI .When I enable the master mode,and My app

stop at the  end of halSetSleepMode().

Is there some demo about using HAL_UART_SPI ?

Thanks.

Landao

  • Refer to the _hal_uart_spi.c, there are some lines describe the following info. Do you do it?

    // If POWER_SAVING is enabled in the 8051-SOC slave, then any master transmit must be preceded by a
    // dummy zero byte transfer to give the slave time to wake from PM2/3 & enable its 1.8V and signal
    // such success by responding with its SRDY active low.

  • Hi YiKai ,

     I have read this message .When I define HAL_SPI_MASTER,I wonder which mode should My CC2540 be in ? It is a SPI master or not?

    If it is a SPI master ,I could access My flash(W25Q32) with MISO MOSI SCK..

    but why the master (CC2540) sleep? This is the point .

  • There is a definition POWER_SAVING in your CC2540 project and it makes the device sleep. You can use  osal_pwrmgr_device(PWRMGR_ALWAYS_ON) to make the device not to sleep when you are doing SPI communication. After you finish, use osal_pwrmgr_device(PWRMGR_BATTERY) to turn it back to power saving.