This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf51822 spi slave problems

Hi,

I'm trying to communicate between a stm32f4 (spi master) and a nrf51822 (spi slave). I have configured the MISO, MOSI, CS and SCLK of the nrf. I use the spi_slave_example for testing the communication.

First question is : why the MISO pin is configured as input?

The stm32f4 can well communicate with my other sensors through spi, but with the nrf nothing append. The callback method is never call. I don't understand why.

I don't really understand what is the goal of the spi_slave_buffers_set method.

Is there a special address or sequence to send to the nrf for start slave communication?

Thank you already for your help

Parents
  • When any peripheral that needs GPIOs to function properly is started, this specific peripheral overrides the GPIO-configuration to suit its needs. In this case MISO becomes an output.

    For each completed transaction, the semaphore is released. You'll then need to call the spi_slave_buffers_set again to acquire it again.

    There should not be a special sequence, as long as everything is configured correctly (SPI mode/bit order) and it's physically connected correctly.

    Do you get any interrupts at all? Do you receive 0xAA/0x55 data on the ST-side?

Reply
  • When any peripheral that needs GPIOs to function properly is started, this specific peripheral overrides the GPIO-configuration to suit its needs. In this case MISO becomes an output.

    For each completed transaction, the semaphore is released. You'll then need to call the spi_slave_buffers_set again to acquire it again.

    There should not be a special sequence, as long as everything is configured correctly (SPI mode/bit order) and it's physically connected correctly.

    Do you get any interrupts at all? Do you receive 0xAA/0x55 data on the ST-side?

Children
No Data
Related