-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds USB to UART bridge intended for PCA20035. Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no> Signed-off-by: Bernt Johan Damslora <bernt.johan.damslora@nordicsemi.no>
- Loading branch information
1 parent
5ffa5b7
commit f4c2c52
Showing
7 changed files
with
385 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# | ||
# Copyright (c) 2018 Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.8.2) | ||
|
||
include($ENV{ZEPHYR_BASE}/../nrf/cmake/boilerplate.cmake) | ||
|
||
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) | ||
project(NONE) | ||
|
||
target_sources(app PRIVATE src/main.c) | ||
zephyr_include_directories(src) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.. _usb_uart_bridge_sample: | ||
|
||
USB-UART bridge | ||
############### | ||
|
||
The USB-UART bridge acts as a serial adapter, exposing 2 UART pairs to a USB host as 2 CDC ACM devices. | ||
|
||
|
||
Requirements | ||
************ | ||
|
||
* One of the following development boards: | ||
|
||
* Thingy:91 board (PCA20035) | ||
|
||
* A USB host which can communicate with CDC ACM devices, like a Windows or Linux PC | ||
|
||
|
||
Building and running | ||
******************** | ||
.. |sample path| replace:: :file:`samples/usb/usb_uart_bridge` | ||
|
||
.. include:: /includes/build_and_run.txt | ||
|
||
|
||
Testing | ||
======= | ||
|
||
After programming the sample to your board, test it by performing the following steps: | ||
|
||
1. Connect the board to the host via a USB cable | ||
#. Observe that the CDC ACM devices enumerate on the USB host (Typically COM ports on Windows, /dev/tty* on Linux) | ||
#. Use a serial client on the USB host to communicate over the board's UART pins | ||
|
||
|
||
Dependencies | ||
************ | ||
|
||
This sample uses the following Zephyr subsystems: | ||
|
||
* :ref:`zephyr:usb_device_stack` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#General | ||
CONFIG_REBOOT=y | ||
CONFIG_HEAP_MEM_POOL_SIZE=16384 | ||
CONFIG_GPIO=y | ||
CONFIG_POLL=y | ||
CONFIG_BOOTLOADER_MCUBOOT=y | ||
|
||
# USB | ||
CONFIG_USB=y | ||
CONFIG_USB_DEVICE_STACK=y | ||
CONFIG_USB_DEVICE_MANUFACTURER="Nordic Semiconductor" | ||
CONFIG_USB_DEVICE_PRODUCT="Thingy:91 UART" | ||
CONFIG_USB_DEVICE_VID=0x1915 | ||
CONFIG_USB_DEVICE_PID=0x520F | ||
CONFIG_USB_DEVICE_SN="PCA20035 12PLACEHLDRS" | ||
CONFIG_USB_COMPOSITE_DEVICE=y | ||
CONFIG_USB_CDC_ACM=y | ||
CONFIG_USB_CDC_ACM_RINGBUF_SIZE=4096 | ||
CONFIG_USB_CDC_ACM_DEVICE_COUNT=2 | ||
|
||
# Logging | ||
CONFIG_LOG=y | ||
CONFIG_USE_SEGGER_RTT=y | ||
CONFIG_LOG_BACKEND_RTT=y | ||
CONFIG_LOG_BACKEND_RTT_MODE_DROP=y | ||
|
||
# UART | ||
CONFIG_SERIAL=y | ||
CONFIG_UART_INTERRUPT_DRIVEN=y | ||
CONFIG_UART_LINE_CTRL=y | ||
CONFIG_UART_0_NRF_UARTE=y | ||
CONFIG_UART_0_NRF_FLOW_CONTROL=n | ||
CONFIG_UART_1_NRF_UARTE=y | ||
CONFIG_UART_1_NRF_FLOW_CONTROL=n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
sample: | ||
description: USB-UART bridge sample | ||
name: USB-UART bridge | ||
tests: | ||
test_build: | ||
build_only: true | ||
build_on_all: true | ||
platform_whitelist: nrf52840_pca20035 | ||
tags: ci_build |
Oops, something went wrong.