[nRF52833-DK][Zephyr]WS2812 example not work?

Hi Nordic,

I am using nRf52833-DK with zephry, an now I'm tring to drive ws2812 led strip.

I notice that there is no nRf52833-DK example in zephyr/samples/drivers/led_ws2812/boards.

So I copy y nrf52dk_nrf52832.conf and nrf52dk_nrf52832.overlay to same path , and rename to nrf52833dk_nrf52833.conf and nrf52833dk_nrf52833.overlay.

Here is the example build wilth "west build -b nrf52dk_nrf52832 samples/drivers/led_ws2812/ --pristine", and it work's well.

 

But if I build with " west build -b nrf52833dk_nrf52833 samples/drivers/led_ws2812/ --pristine", it not working like in video.

Is any way to fix it?

Parents
  • Hi,

    This is not neasasaerly a Nordic issue, more of a zephyr related, as the sample you are using is not one of ours. But your issue is that you have not made the correct overlay file.


    Check out how the device tre works https://nrfconnect.github.io/vscode-nrf-connect/devicetree/install.html  here if you want to use our tools, or Zephyrs https://docs.zephyrproject.org/latest/build/dts/howtos.html here.

    It is not clear exactly what is not wokring for the video and picture you share, do you get anny build errors?

    I reccomed you ask in the Zephyr forum also.

    Regards,
    Jonathan

  • I accept this as an answer because is not neasasaerly a Nordic issue, more of a zephyr related.
    The problem  still happens.

    ws2812/52833.overlay and .conf should as same as 51822, because it just copy paste and renames.
     

    The pic and video show when I build nrf52dk_nrf52832 it work well, keep red lighing.

    But if I build nrf52833dk_nrf52833 option, the led keep blink, which mean the signal from 52833 to ws2812 is incorrect.

    I use same hardware(nRF52833-DK), same dts overlay and  .conf, so I think the only different is zephyr bord config.
    But I can't find out where has different.

  • Hi, sorry for slow response. 



    Wols said:
    I notice there has a huge difference in 52833 and 52832 code.

    What do you mean here? Is this just related to the dts files?

    If you check here you can compare how the two dts files are
    sdk-zephyr/nrf52833dk_nrf52833.dts at main · nrfconnect/sdk-zephyr · GitHub 

    sdk-zephyr/nrf52dk_nrf52832.dts at main · nrfconnect/sdk-zephyr · GitHub


    So the arduino_spi on the nrf52832 DK

    arduino_spi: &spi2 {
    	compatible = "nordic,nrf-spi";
    	status = "okay";
    	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
    	pinctrl-0 = <&spi2_default>;
    	pinctrl-1 = <&spi2_sleep>;
    	pinctrl-names = "default", "sleep";
    };


    and for the nRF52833 DK

    arduino_spi: &spi3 {
    	status = "okay";
    	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
    	pinctrl-0 = <&spi3_default>;
    	pinctrl-1 = <&spi3_sleep>;
    	pinctrl-names = "default", "sleep";
    };

    Have you tried to change any of the values in the nRF52 bindings file? sdk-zephyr/nrf52-bindings.h at main · nrfconnect/sdk-zephyr · GitHub 

    Regards,
    Jonathan

  • I mean I add print chunk to zephyr/drivers/spi/spi_nrfx_spim.c.

    I think 52833 and 52832 chunk should be same size, but not.

    I just wondering it's the problem coming from.

    zephyr/drivers/spi/spi_nrfx_spim.c
    static void transfer_next_chunk(const struct device *dev)
    {
    	...
    	if (chunk_len > dev_config->max_chunk_len) {
    			chunk_len = dev_config->max_chunk_len;
    		}
    	printk("%d \n", chunk_len);
    	printk("%d \n", dev_config->max_chunk_len);
    	printk("-----------------------------------\n");

    west build -b nrf52833dk_nrf52833 zephyr/samples/drivers/led_ws2812/ --pristine

    chunk_len : 384
    dev_config->max_chunk_len : 65535

    west build -b nrf52dk_nrf52832 zephyr/samples/drivers/led_ws2812/ --pristine

    chunk_len : 129
    dev_config->max_chunk_len : 255

  • Hi,

    Wols said:
    I think 52833 and 52832 chunk should be same size, but not.

    The nRF52833 supports a longer EasyDMA MAXCNT bit length than the nRF52832. So this is expected.



    nRF52832:

    0b 11111111 -> 255 bytes

    nRF52833:


    0b 1111111111111111 -> 65 535 bytes


    BR,
    Sigurd

  • Hi Sigurd,

    Thanks that's cool.

    But the ws2812 example on nrf52833 still does not work.

    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/wols/zephyrproject/zephyr/samples/drivers/led_ws2812
    -- Found Python3: /home/wols/zephyrproject/.venv/bin/python3 (found suitable exact version "3.8.10") found components: Interpreter 
    -- Cache files will be written to: /home/wols/.cache/zephyr
    -- Zephyr version: 3.1.99 (/home/wols/zephyrproject/zephyr)
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf52833dk_nrf52833
    -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
    -- Found host-tools: zephyr 0.14.1 (/home/wols/zephyr-sdk-0.14.1)
    -- Found dtc: /home/wols/zephyr-sdk-0.14.1/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (/home/wols/zephyr-sdk-0.14.1)
    -- Found BOARD.dts: /home/wols/zephyrproject/zephyr/boards/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833.dts
    -- Found devicetree overlay: /home/wols/zephyrproject/zephyr/samples/drivers/led_ws2812/boards/nrf52833dk_nrf52833.overlay
    -- Generated zephyr.dts: /home/wols/zephyrproject/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /home/wols/zephyrproject/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /home/wols/zephyrproject/build/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: /home/wols/zephyrproject/build/zephyr/dts.cmake
    Parsing /home/wols/zephyrproject/zephyr/samples/drivers/led_ws2812/Kconfig
    Loaded configuration '/home/wols/zephyrproject/zephyr/boards/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833_defconfig'
    Merged configuration '/home/wols/zephyrproject/zephyr/samples/drivers/led_ws2812/prj.conf'
    Merged configuration '/home/wols/zephyrproject/zephyr/samples/drivers/led_ws2812/boards/nrf52833dk_nrf52833.conf'
    Configuration saved to '/home/wols/zephyrproject/build/zephyr/.config'
    Kconfig header saved to '/home/wols/zephyrproject/build/zephyr/include/generated/autoconf.h'
    
    warning: SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 (defined at drivers/spi/Kconfig.nrfx:13) was
    assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies: SOC_NRF52832
    (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58
    and/or look up SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 in the menuconfig/guiconfig interface. The
    Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices
    sections of the manual might be helpful too.
    
    -- The C compiler identification is GNU 10.3.0
    -- The CXX compiler identification is GNU 10.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/wols/zephyr-sdk-0.14.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/wols/zephyrproject/build
    

    I switch to 52832 temporarily, but I wish I can find the reason why it doesn't work on 52833.

    The singal show on probe really wired.

  • Hi,

    Looking at the discord thread you linked to, it seems like the conclusion is that it's somehow related to your toolchain/build system setup.

    Maybe you can try to use nRF Connect SDK instead of vanilla zephyr? See this getting started guide:
    http://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.2/nrf/gs_assistant.html

Reply Children
  • Thanks for your suggestion, I'll have a try.

    I am really confused about what difference between nrfSDK and zyphyr.

    I means when I want a spi or i2c example, the nrfSDK example page tell me go zephyr look for basic eamxple. 

    The nRF Connect SDK provides samples that specifically target Nordic Semiconductor devices and show how to implement typical use cases with Nordic Semiconductor libraries and drivers.
    
    Samples showcase a single feature or library, while Applications include a variety of libraries to implement a specific use case.
    
    Zephyr also provides a variety of application samples and demos. Documentation for those is available in Zephyr’s Samples and Demos section. For very simple samples, see the Basic Samples. Those samples are a good starting point for understanding how to put together your own application.
    
    

Related