Issues when using Zephyr with the nRF52840 DK

Hi,

I just started working with Zephyr and having some problems right out of the gate.

Board: Nordic nRF52840DK
Example: i2c/spi_fujitsu_fram
Branch: Main

When I'm using the SPI examples, I cannot see any activity on the pins. I have checked the SCK pin (p0.31) and nothing is happening, it's just constantly low. The only changed I've done is to replace DT_ALIAS with DT_NODELABEL to get it to build and put an infinate loop around the first SPI function call to see the activity with my logic trace.

After testing the SPI example, I decided to check out the I2C example to see if that works, and it does! I can see activity on the SCL pin. So just to do some sanity checking I wanted to test i2c1, since it's using the same pins as spi1, but when I changed to i2c1 I cannot build the application.

So to the questions:

1. Does anyone know why the SPI example doesn't work? I have seen this thread but as CONFIG_SPI=y is already in the prj.conf file and adding CONFIG_SPI_1=y breaks the build, it doesn't seem to be a fix for me.

2. Why can't I change to i2c1 in the I2C example? It's not using SPI so it shouldn't be a conflict.

I should probably use one of the release branches but then I get errors when building all examples so I've just stuck with the branch that has provided the least problems when building.

Thanks,
Elin

Parents
  • Hi,

    For the SPI example, are any errors printed when you run the sample? Looks like it should print "Could not verify FRAM ID" if the first spi function fails. Is there activity on any of the other pins? Do you see anything on any of the pins if you remove the loop you added?

    For the i2c sample, did you remember to disable spi1 and enable i2c1 in an overlay file? Which i2c sample are you using?

  • Hi Øivind, 

    Thanks for the response. 

    SPI:
    Yes, it says "Could not verify FRAM ID" which I guess makes sense since I don't have the Fujitsu FRAM connected. I haven't checked all the pins on the whole board, but pin p0.31, p0.30 and p1.08 does not have any activity on it. 

    I2C:
    I believe that I did it, but might not be the correct way of doing it. How is the proper way of doing it? What do you mean by i2c sample? 

    I have another issue when I try to configure a GPIO in the I2C example. I have followed the guides in the documentation as well as the solutions here and here but none of them work. When I'm trying the last solution, aka adding these lines and using PORT and PIN in the gpio_pin_configure() function.

    #define PORT DT_ALIAS_GPIO_1_LABEL
    #define PIN  1

    This should configure the p1.01 pin but I get this error "error: 'DT_N_S_soc_S_gpio_50000300' undeclared (first use in this function); did you mean 'DT_N_S_soc_S_gpio_50000300_ORD'?
    5770 | #define DT_N_NODELABEL_gpio1 DT_N_S_soc_S_gpio_50000300"". I checked the generated file devicetree_unfixed.h but I cannot see the DT_ALIAS_GPIO_1_LABEL there so I modified it slightly to be more similar to the blinky example. But even after changing to this, I get the same error. 

    #define GPIO_1 DT_NODELABEL(gpio1)
    
    #define PORT GPIO_1 
    #define PIN  1

    Why doesn't this work? Should it be configured in a different way? 

    Thanks, 
    Elin 

Reply
  • Hi Øivind, 

    Thanks for the response. 

    SPI:
    Yes, it says "Could not verify FRAM ID" which I guess makes sense since I don't have the Fujitsu FRAM connected. I haven't checked all the pins on the whole board, but pin p0.31, p0.30 and p1.08 does not have any activity on it. 

    I2C:
    I believe that I did it, but might not be the correct way of doing it. How is the proper way of doing it? What do you mean by i2c sample? 

    I have another issue when I try to configure a GPIO in the I2C example. I have followed the guides in the documentation as well as the solutions here and here but none of them work. When I'm trying the last solution, aka adding these lines and using PORT and PIN in the gpio_pin_configure() function.

    #define PORT DT_ALIAS_GPIO_1_LABEL
    #define PIN  1

    This should configure the p1.01 pin but I get this error "error: 'DT_N_S_soc_S_gpio_50000300' undeclared (first use in this function); did you mean 'DT_N_S_soc_S_gpio_50000300_ORD'?
    5770 | #define DT_N_NODELABEL_gpio1 DT_N_S_soc_S_gpio_50000300"". I checked the generated file devicetree_unfixed.h but I cannot see the DT_ALIAS_GPIO_1_LABEL there so I modified it slightly to be more similar to the blinky example. But even after changing to this, I get the same error. 

    #define GPIO_1 DT_NODELABEL(gpio1)
    
    #define PORT GPIO_1 
    #define PIN  1

    Why doesn't this work? Should it be configured in a different way? 

    Thanks, 
    Elin 

Children
Related