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

SPI_3 setting change and pin assignment

Hi

i was trying to setup spi_2 for external sensor interface with nrf9160-dk but even after setting CONFIG_SPI_3=n and CONFIG_SPI_2=y the spi_2 enabled but spi_3 isn't changing to disabled. spi_3 is working with default pins but there is not and cs pin assigned when i try to setup it using overley file it start creating error and setting are not changing the m i making some mistake or it can't be changed by user because if i not disable spi_3 i can't use spi_2 as explained in some tickets both uses same addresses. kindly guide me. one more issue is using spi_write(spi_dev,&spi_cfg, pdata); the zephyer will start rebooting again and again can't able to find out the reason behind it. please share any example code to interface adxl345 in spi mode or guide me to resolve the error.

my project and sensor data sheet is attached kindly make the required changes and rebuild the project so i can able to compair for my mistakes and learn to setup it. i am trying to modify pin as sck-pin = <31>;
mosi-pin = <20>;
miso-pin = <30>;
ss-pin = <28>;

but not succeed. please help me out for the same also and guide me.7484.ADXL345.pdf6472.spi_adxl345.zip

Parents
  • Hi!

    What NCS tag are you working on? I'm trying to build your project but I'm getting a lot of warnings that could be the reason it's not working. 

    Additionally, the overlay in the project you attached sets SPI2 to disabled while also setting all the pins, so I'm wondering if there's some mistake there? You would like to disable SPI3 and enable SPI2, is this correct?

    And you are building for the secure board, nrf9160dk_nrf9160?

    Best regards,

    Heidi

Reply
  • Hi!

    What NCS tag are you working on? I'm trying to build your project but I'm getting a lot of warnings that could be the reason it's not working. 

    Additionally, the overlay in the project you attached sets SPI2 to disabled while also setting all the pins, so I'm wondering if there's some mistake there? You would like to disable SPI3 and enable SPI2, is this correct?

    And you are building for the secure board, nrf9160dk_nrf9160?

    Best regards,

    Heidi

Children
  • yes, i am building for secure board, nrf9160dk_nrf9160 ncs tag is 1.4.0 i am using

    can you help me out by editing the working code i was trying to build it for spi2 but spi3 was not getting disabled by proj.conf so i am forced to use spi3 that's the only reason.

    or please share a working code for spi sensor interface adxl345.

  • Hi! Unfortunately we don't have the capacity (especially now, during the holidays) to provide you with a working code. The best I can do at the moment is point you to what might be going wrong in the code you've provided me.

    And I think you should focus on getting rid of some of the biggest warnings that are showing up when I build your code for the secure board on NCS tag 1.4.0. 

    It doesn't look like Zephyr has an out-of-the-box sample for the ADXL345, but they do have a driver for it, see the documentation here (ncs/zephyr/drivers/sensor/adxl345) so you might consider using this.

    Best regards,

    Heidi

Related