Add networking stack from TinyUSB. #334
No reviewers
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk!334
Loading…
Reference in a new issue
No description provided.
Delete branch "luigifcruz/patch-piccolosdr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm not sure if this is a path the maintainers want to pursue. But I added a
tinyusb_nettarget on CMakeLists to import the necessary headers and files to make it possible to use the Pico as a network device based on the RNDIS example from TinyUSB.As of now, I use these patches to build my PiccoloSDR project without known problems.
might be useful; not sure why some things are on tinyusb_common, and some on tinyusb_host and none on tinyusb_net!
Rebased to the latest branch. :)
presumably you meant tinyusb_net here
I've been playing around with the rndis stuff in tiny usb. I can't really see the point of running a dhcp server on the device. What would you use this for?
It would be nicer if dhcp could somehow obtain an address for the pico and use that as a network to get access to the internet. But I can't really get network sharing to work reliably. It looks like it sort of works on Windows if you're lucky. I'm not sure I can get it to work at all on Ubuntu.
Unless this is easy to use, I can't really see this being worth it?
I mean, this is not the easiest way to get data out of the Pico. But, unfortunately, it's the only way to do it with a decent speed without extra hardware. I can get a stable 5 Mbps running an
iperf3server on the Pico using the TinyUSB interface. This enables projects like my PiccoloSDR that require large amounts of data to be transferred to the computer. I also can think about a few projects that would require the bandwidth offered by this stack. For example, digital signal analyzer using the PIO, digital oscilloscope, high-sampling rate sensors, etc.Regarding compatibility, the current version of the PiccoloSDR, which uses this PR, works very well with Linux and macOS (including Apple Silicon). You plug it in, an IP is automatically assigned, and you can access it with zero configuration. I never tested this on Windows, but looks like Microsoft added support to USB NCM on Windows 11. This theoretically solves support for Windows.
While developing PiccoloSDR, a major hurdle was patching the SDK to give me the right headers and binaries. The actual development of the network application was trivial. This PR comes at almost zero cost for those who don't use this feature while significantly facilitating the development process of network apps for those who need it.
i'm just confused by the PR in general; why are existing libraries being modified; can you just not add a new "tinyusb_net library"?
I guess you could, but tiny usb already seems to pile everything into tinyusb_device_base? What's more confusing is that this doesn't live in the pico-sdk anymore.
We're missing networking/rndis_reports.c and the include folder lib/networking, which are easy enough to add to your own project.
I'm more interested in knowing if we can use this for real.
@luigifcruz Sorry, I missed your comment. So your use case is just to connect two computers and communicate with IP stacks. The IP address comes from the Pico - effectively a small private network.
I am trying to build a subsampling receiver, learning as I go, and to my surprise the excellent demo from luigifcruz wouldn't work with stock SDK. 😅
Now seriously, using UDP to stream data over USB is a decent idea and with DHCP server it works out-of-box. I believe that USB tethering on Android works like that as well. It saves you the hassle of configuring network interfaces manually or writing specific device drivers.
I can imagine using it like that in a classroom setting.
(Sorry for butting in just to +1.)
@luigifcruz @mordae Did you test by connecting to Windows or a Linux PC? I still don't seem to get an IP address when connecting to Linux.
Ignore me - I had a static IP address assigned. It worked ok after I removed this.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.