Тёмный

Zephyr and Nordic nRF Connect SDK - 02 Text output, devicetree, Leds and Buttons 

Подписаться
Просмотров 4,8 тыс.
% 101

nRF Connect SDK is the new SDK from Nordic Semiconductor and replaces the old nRF5 SDK. It is based on the Zephyr real-time operating system. Zephyr supports multithreading. The hardware is configured via a device tree and components are activated or deactivated via a configuration file. Internal and external resources such as I²C-bus or sensors can be controlled via drivers. The nRF connect SDK supports the network technologies OpenThread, ZigBee, BLE and Matter. Visual Studio Code can be used as a development environment. In this video, I make an introduction into the devicetree and show you how to program a led and a button with Zephyr.
You can support me on Patreon:
www.patreon.com/WSNandIoT
##Hardware###########
Developer board nRF52840-dk:
www.nordicsemi.com/Products/Development-hardware/nrf52840-dk
00:00 Introduction
00:30 Creating your own project
03:02 Text output with printk
04:41 Virtual COM-Port access via VS Code
06:06 Programm the GPIOs with nRF library
09:01 Devicetree and overlay file
10:57 Programming the GPIO-ports over the devicetree
14:11 LEDs in the devicetree
18:07 Programming the LEDs with dt specification structure
20:47 Programming the buttons with dt specification structure
25:59 Outro

Наука

Опубликовано:

 

1 окт 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 11   
@JackSparrow-zp3qv
@JackSparrow-zp3qv Год назад
Thanks for the lessons on Zephyr & nRF Connect SDK! Coming from register or API concepts of MCU programming I've been struggling to understand the concepts of DeviceTree and how it links to hardware resources of the device. Really appreciate your creation of this educational content!
@elitecookies8155
@elitecookies8155 Год назад
When using SDK V2.2.0, you may find that the code for programming GPIO from the device tree doesn't work and the terminal gets stuck on *** Booting Zephyr OS build v3.2.99 ***. This is because the function device_get_binding("GPIO_0") is deprecated. To fix this, you can replace it with DEVICE_DT_GET(DT_NODELABEL(gpio0)) and the Blinky application will work correctly. The series is a superb resource to have, I greatly appreciate the knowledge you're sharing.
@wsniot
@wsniot Год назад
Yes, you are right. Before there was a special label with GPIO_0 in the device tree, but it is removed. Makes sense because it made things more confusing.
@johannesbergmann8559
@johannesbergmann8559 Год назад
Thank for your video, it helped me a lot!
@SurajZachariahManesh
@SurajZachariahManesh Год назад
Thanks, really helpful.
@FSousa-hu8ko
@FSousa-hu8ko Год назад
Thanks
@erwinn58
@erwinn58 Год назад
How do you get that option where vscode already tells you the possible line of code you want to write?
@Stabby666
@Stabby666 Год назад
I'm just starting to use Nordic parts and there's an insane amount of code, configuration and overlay files required compared to other architectures, to do the simplest things like read a GPIO pin. I mean this video is almost 30 minutes long to turn on an output and read an input. You can do that (in fact, read and write 8 pins at a time) with a couple of lines of code with say, Atmel parts in under a minute. The worst thing is that they use macros within macros within macros everywhere in the SDK. So there's often no way of telling what an error even means as you get reams and reams of errors all expanded out from various macros with names like "DT_N_S_leds_S_led_0_P_gpios_IDX_0_VAL_pin" 🤣
@wsniot
@wsniot Год назад
I have also used Atmel products before and your criticisms are quite valid. However, the approach has fundamentally changed as microcontrollers become more powerful. Nordic also previously used its own environment with the nRF5 SDK. However, this was specifically for the nRF5 series. Nordic has now switched to the free RTOS Zephyr as a development environment. With this, the source code remains largely independent of the board used and you have integrated scheduling and task handling. Nordic has only limited influence on the implementation by Zephyr. The macros are sometimes really annoying, especially at the beginning. But you get used to it with time. You wouldn't have to use many of this macros either, but then you have to generate and initialize the variables yourself, which makes the sourcode much longer. You could also continue to control the pins directly, but then you would be programming board-specific again. If you get used to the macros, understand the concept of the DeviceTree and the activation of certain modules, Zephyr becomes quite comfortable. 😉
@mrafayshams3089
@mrafayshams3089 Год назад
Can we follow along this series of videos using the NRF52840 Dongle?
@wsniot
@wsniot Год назад
In theory it's possible with some adjustments, but I wouldn't recommend it for beginners. Might even be better to use the Seeed Xiao nrf52840 than the Nordic dongle as it has a UF2 bootloader.