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

Is there any sample for spi based on nrf5340?

Is there any sample for spi based on nrf5340?

Parents
  • Hi.

    There are no SPI samples that are created especially for the nRF5340.

    However, both the spi_flash and spi_fujitsu_fram samples (in ncs/zephyr/samples/drivers) should work on the nRF5340 with a few modifications.

    The spi_fujitsu_fram sample should work as long as an mb85rs64v is connected to SPI1.

    The spi_flash sample will require you to add connect a flash chip that has a driver in Zephyr and add it to the device tree.

    One of my colleagues has an SPI sample on his personal Github account: https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/spi

    While it was written for the nRF9160, it should work without any modifications on the nRF5340 (though the 53 might use different pins). Note that it has not been updated in a while, so it might not work on newer versions of NCS without some modifications.

    Best regards,

    Didrik

  • Hi Didrik

    Thank you. I tried your colleague's code on ncs v1.2.0,but there are still some errors that cannot be solved.

    The transmission should be successful even without external spi equipment, so using nrf5340-pdk for test should be ok

    When I try to run his code,it stopped at spi_transceive.

    This is log

    So I add spi_cs_control parameter to spi_cfg,but there are still some errors.

    This is the modified code and configuration

    6237.spi.zip

Reply
  • Hi Didrik

    Thank you. I tried your colleague's code on ncs v1.2.0,but there are still some errors that cannot be solved.

    The transmission should be successful even without external spi equipment, so using nrf5340-pdk for test should be ok

    When I try to run his code,it stopped at spi_transceive.

    This is log

    So I add spi_cs_control parameter to spi_cfg,but there are still some errors.

    This is the modified code and configuration

    6237.spi.zip

Children
No Data
Related