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

a Nrf52 function mapping to nrf51

Hi all,

I am working on interfacing an SD card as well as an OLED Display with my nrf51422 on SDK 12.2.0.

Although, both are on SPI and hence i need to configure them as multiple slaves using multiple master instances instead. I got a way on how to do it which is given here.[link text]:-

(devzone.nordicsemi.com/.../

Although this is done over nrf52, and i m getting a problem in the line:-

"volatile spi_control_block_t * my_setup = mw_spi_instance.drv_inst_idx;"

which says "mw_spi_instance" is undeclared.

Thus i want to know on how i should proceed further. Is there a parallel function in nrf51422 which can be supported replacing it?

Thank you in advance.

Parents
  • This was not meant as a full example. You need to merge it into the SPI example from the SDK. m_rx_buffer, rx_length, spi_xfer_done, m_tx_buf, m_length, m_rx_buf, amd m_length is defined there.

Reply
  • This was not meant as a full example. You need to merge it into the SPI example from the SDK. m_rx_buffer, rx_length, spi_xfer_done, m_tx_buf, m_length, m_rx_buf, amd m_length is defined there.

Children
  • Hello, thank you for your support, although i have a doubt, my one slave is working perfectly fine with this, the second one is not getting initialized in debug session, what could be the possible mistake that i am committing.?

    My second device is SD card and in debugging, it is getting stuck in initializing it.

    Thank you in advance.

  • How does your init function for that device look? Which call is is getting stuck at?

  • Hello, Thank you very much.. The chip select between my card and display was not happening because of a small mistake that i was doing, now it is working very fine.

    I wanted to know if there is any other method to do this? I don't want to alter any of my drv files and i wanted to know the necessity of this line. I am a beginner:-

    APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, m_tx_buf, m_length, m_rx_buf, m_length)); while (!spi_xfer_done) { __WFE(); }

    Thank you in advance.