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

Completely lost with Zephyr. Trying to add code to nrf_desktop. Help!

Hi Everyone,

This new way of doing firmware seems to have taken such a turn from what I've been doing for the past 20 years that I don't know where to begin. All I'm trying to do is make a minor addition to a sample project, but my head is now spinning with Zephyr, West, Chocolatey, KConfig, devicetree, yaml files... it all seems so complicated and I haven't found any kind of guide to it all that makes sense to me.

My task is to take the nrf_desktop app and add in support for WS2812 LEDs. I found the ElectronutLabs-bluey example for LED control, and I figured out how to generate the nrf_desktop project using nRF Connect for Desktop - but I can't figure out where in the nrf_desktop project to start adding the I2S init code and things from the bluey project. There's no init section of the code where I can set up my peripherals. There's no main loop where I can put in a hook to update my LEDs periodically. Main() just launches an event manager, which I assume is the Zephyr RTOS startup call, but it's not like a FreeRTOS project... with those it's easy to see where tasks are created and if you follow the model in the examples you can add your own tasks. The c files in this project all seem to have extra stuff in them to declare them as MODULEs with EVENT_LISTENER and EVENT_SUBSCRIBE calls. It's a long way from the simple C programming I'm familiar with.

I'm guessing I have to learn how to edit the .conf and other files to set up the I2S peripheral when the project is created, and then add a Zephyr task where I can finally put my code to do my periodic updates. Is there documentation on how to do that?

What about West and all that command line Linux-y looking stuff - is that relevant when using nRF Connect?

Where do I begin to learn how to work with this? 

Thanks,

Glen

Related