Тёмный

Seeed Studio XIAO nRF52840 2: Zephyr, nRF Connect SDK, GPIO and UART 

Подписаться
Просмотров 6 тыс.
% 92

Seeed Studio XIAO nRF52840: Zephyr, nRF Connect SDK, GPIO and UART
The XIAO BLE is an inexpensive developer board from Seeed and is equipped with the Nordic Semiconductor SoC nRF52840. It can be programmed with the nRF Connect SDK. It supports BLE and also OpenThread via the RTOS Zephyr. The Xiao has an Arduino bootloader and the firmware in uf2 format can be easily transferred to the chip using drag and drop. In this video, we demonstrate programming a GPIO pin to make an LED blink. We then proceed to program the UART interface (uart0) and establish communication with a PC terminal program using a USB-UART bridge (FTDI FT232).
You can support me at Patreon:
www.patreon.com/WSNandIoT
---Hardware------
Seeed Studio XIAO nRF52840:
www.seeedstudio.com/Seeed-XIAO-BLE-nRF52840-p-5201.html
---Software---------
nRF Connect SDK:
www.nordicsemi.com/Products/Development-software/nRF-Connect-SDK
Visual Studio Code:
code.visualstudio.com/
Book
WSN & IoT (Grundlagen, Protokolle und Anwendungen):
amzn.eu/d/hAbTgD0
00:00 Introduction
00:27 Book introduction WSN & IoT
01:41 Connect a LiPo battery on XIAO BLE
02:54 Pinout XIAO BLE
03:45 GPIO pin programming with zephyr
05:53 wiring diagram LED-xiao-GPIO
06:52 kprint and USB-Output
08:35 Wiring diagram UART XIAO BLE
09:22 Create a UART-project and setting prj.conf-file
11:43 Programming the uart with zephyr
15:16 Outro

Наука

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

 

28 май 2023

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 27   
@maksymkoval1754
@maksymkoval1754 Год назад
XIAO nRF52840 is a really great board! I'm glad you started tutorials with it.
@bluestek
@bluestek Год назад
Thank you so much!!! Having a workflow for working the nRF52840 makes this chip so much more fun to play with!
@CalinGilan
@CalinGilan 6 месяцев назад
I really really appreciate your tutorial. It was the only thing I found online that was of high quality for this lil board!! Your video is also super well annotated. As someone who is trying to get into embedded stuff, this has helped tremendously
@mrafayshams3089
@mrafayshams3089 Год назад
Thank you so much!
@wsniot
@wsniot Год назад
My pleasure!
@mariamn4752
@mariamn4752 Год назад
Thanks!
@wsniot
@wsniot Год назад
Thx for the support. I appreciate it.
@NoumanAli
@NoumanAli 10 месяцев назад
Can you kindly make a video using UARTE? I have another question: can we arbitrarily make any pin as UART Tx and Rx pins?
@mariamn4752
@mariamn4752 Год назад
Thanks so much for the video! I was wondering how to edit the code to be able to read sensor data using UART?
@wsniot
@wsniot Год назад
IF a sensor has another interface than UART and your device is battery powered, i would recommend not to using UART since the receiving over UART uses a lot energy. But anyway receiving is similar but a little bit more complex and there are multiple ways. I prefer to using two buffers. If the buffer is full you would otherwise to have to start the receiving new: static uint8_t rx_buf1[10] = {0}; static uint8_t rx_buf2[10] = {0}; static uint8_t rx_buf_num=1; void uart1_cb(const struct device *dev, struct uart_event *evt, void *user_data){ ARG_UNUSED(dev); switch (evt->type) { case UART_RX_RDY: ;//empty statement int offset = evt->data.rx.offset; int len = evt->data.rx.len; for (size_t i = offset; i < (offset+len); i++){ if (evt->data.rx.buf[i]==' '){ printk(" "); }else{ printk("%c", evt->data.rx.buf[i]); } } break; case UART_RX_BUF_REQUEST: if(rx_buf_num==1){ uart_rx_buf_rsp(uart_dev,rx_buf2, sizeof(rx_buf2)); rx_buf_num=2; }else{ uart_rx_buf_rsp(uart_dev,rx_buf1, sizeof(rx_buf1)); rx_buf_num=1; } break; default: break; } } Dont forget to enable the receiving: uart_callback_set(uart_dev, uart1_cb, NULL); uart_rx_enable(uart_dev, rx_buf1, sizeof(rx_buf1), 100 * USEC_PER_MSEC);
@mariamn4752
@mariamn4752 Год назад
@@wsniot thank you for your reply. i will test it out
@DanielMorales-rc1bw
@DanielMorales-rc1bw Год назад
Is this board compatible with software serial communication?
@soulprospector6931
@soulprospector6931 Год назад
Hey I have a major question about this chip. You mentioned that UART and I2C pins can nit work togeather at the same time. I am trying to use BLE UART as well as an I2C temp sensor. My temp sensor is not working correctly. Could this be why? Even tho I have not used the tx and rx pins?
@wsniot
@wsniot Год назад
UART0 and I2C1 should work together in the default XIAO project. I2C0 and UART1 is disabled by default because of the number limitation of the pins. Did you use pullup resistors for the data and clock line of the I²C-bus? It should use the internal as default, but sometimes its disabled or it is also more stable if you use external pullups.
@soulprospector6931
@soulprospector6931 Год назад
@wsniot hey thanks for responding, and yes the temp sensor I'm using has 2 10k pull-up resistors installed on it already. I'm using the mcp9808 temp sensor from adafruit. For some reason, the temp sensor keeps returning a value of "nan", and I can't figure out why.
@soulprospector6931
@soulprospector6931 Год назад
@wsniot to me it seems like there I'd a problem with initializing the i2c bus on the xaio nrf52840. I am using the arduino IDE to program like how you showed in your tutorial. Not sure what I'm doing wrong, but you seem like you know more about this chip than anyone else on youtube
@KlausB-x2u
@KlausB-x2u Год назад
Did you manage to use the XIAO BLE as matter device? If so, may you share how to do it?
@wsniot
@wsniot Год назад
I didnt try the Xiao BLE yet, but actually it should work. If i find the time i will check it out, but at the moment still other tasks are in my priority lists first.
@KlausB-x2u
@KlausB-x2u Год назад
@@wsniot Thanks for your answer. I tried for the last days, could compile changing the nrf52840DK overlays and configs but after flashing everything is dead and I can't figure out what's going on. I'll definitely keep following your channel and hope you'll find the time. ;)
@HomoSapiensMember
@HomoSapiensMember 10 месяцев назад
was banging my head on the table over the 'connected devices' not showing my xiao ble :'(
@wsniot
@wsniot 9 месяцев назад
I hope you had enough aspirin😉.
@MrIgorek123
@MrIgorek123 9 месяцев назад
so it's normal that this board is not visible in 'connected devices' table?
@wsniot
@wsniot 9 месяцев назад
@@MrIgorek123 Yes. This device has no j-link programmer/debugger integrated. It has a bootloader for transfering the firmware like using a usb-flash stick. Otherwise the USB acts only as USB-UART-communication, means you can use a COM-Port for interchanging data with the MCU.
@browaruspierogus2182
@browaruspierogus2182 Год назад
any specific advantages of Zephyr?
@wsniot
@wsniot Год назад
Advantages over what? Arduino IDE? Zephyr is a very powerful RTOS with many features, such as task scheduling, modular design, many libraries, hardware controllers via device tree and so on. It also offers support for Thread, Matter, BLE, BLE-Mesh and ZigBee, for example.
@browaruspierogus2182
@browaruspierogus2182 Год назад
@@wsniot over freeRTOS. Looks like it is some 'distro' of RTOS
@raniaamara6715
@raniaamara6715 2 месяца назад
hi i wanna work with the lsm6ds3 integrated in the seeed when i build it always builds xiao_ble.dts not xiao_ble_nrf52840_sense.dts can you help me please