Copyright Wikipedia commons
This document describes the development of a USB-CDC
(Communication Device Class) device driver in noForth.
The USB standard contains matching protocols for different types of devices.
For example, for keyboards, virtual disks, and USB modems.
The USB standard is a protocol that allows devices to be connected to a computer.
USB is a bidirectional serial bus protocol. There are a number of standards with different speeds that can be used at the same time. Currently (November 2025), there are four standards for bus speed:
The protocol supports a single master (HOST) per bus and a maximum of 127 devices.
The data lines consist of two twisted wires with differential
signals.
More information about USB.
The USB connection of the RP2040 provides power and the ability to upload and install programs. The USB hardware offers a 12 Mbit/s full-speed bus. The RP2040 has software in ROM to use the USB as a bootloader. The RP2040 then turns into a virtual USB disk.
With that USB connection, instead of serial communication via a separate RS232 dongle, we can use the USB cable for interactive communication with the RP2040. That saves on extra cables, frees up the pins for other applications, and also significantly increases the communication speed.
If you have any problems, please refer to our background documentation.
We started researching data and examples in April 2024.
The first code was ready in April 2024, but by October it became clear that progress was extremely slow.
We got help, and in November we decided to develop a second, clear
implementation alongside it. At the beginning of January 2025, the output was working, and
at the end of January, the driver on top of noForth was working. After attempts to add handshake,
it was decided in March 2025 to apply the low-level ACK/NAK handshake.
Now there is a working driver for both noForth solo and noForth duo, (two CDC channels).
The complete timeline can be found here.
Copyright 2010 | Craig.Peacock@beyondlogic.org
Please note that when using a USB hub, the connection
may become less stable and occasionally freeze! Unfortunately, there is a lot of variation in quality
when it comes to USB hubs. The order listed below
and the number of requests will differ per OS. In general,
the same requests are made.
Check out the configuration tables.
After the USB basic setup procedure has been completed, the host knows that it is dealing with a USB-CDC connection. This is specified in the device and configuration descriptor. Below is an example of this procedure:
Each operating system has its own method of presenting the connected devices on the USB bus. Here is an overview:
First, open Device Manager and then Ports (COM & LPT).
The COM port of the USB driver can be found there.
Or open Control Panel and then Devices and Printers and click on the icon under which noForth etc. is listed.
Search there for information about the USB devices with: ls /dev/tty*, where the type of driver is listed. This is usually an ACM device.
Then there is lsusb -v for more information.
Look at ‘system information’ the driver is listed as:
/dev/tty.usb-modemXXXX.
Connect the RP2040 to the PC via the USB-C or micro-USB connector on the board.
Problems?
See: getting started with noForth t.
Start TeraTerm and select: COMxx Serial USB Device.
Set line delay and newline.
Launch GTKterm and select: /dev/ttyACMx
Set line delay to 1 ms and CR LF auto and you're done.
e4thcom with ACK/NAK or line delay also works.
Start Coolterm and select: /dev/tty.usb-modemXXXX
Set handshake to wait for remote echo and enter key emulation
to cr+lf