1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

143 Commits

Author SHA1 Message Date
Benjamin Valentin
8cd85472c5 usbus/cdc_ecm: port to netdev_new_api 2024-11-21 19:14:16 +01:00
Mikolai Gütschow
67edd6c417
sys/usb_cdc_acm_stdio: only submit and flush for non-empty buffer 2024-11-13 20:08:34 +01:00
Marian Buschsieweke
6b80a1a61e
sys/usb: Use luid_base for stable USB serials
This is useful when having multiple instances of the same board
connected via USB CDC ACM and telling the TTYs apart.
2024-10-29 09:40:22 +01:00
Benjamin Valentin
312a550f1a treewide: remove THREAD_CREATE_STACKTEST from thread creation 2024-07-29 11:45:58 +02:00
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Dylan Laduranty
f44ef812d3 sys/usbus: answer get_status if request is standard type
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-03-17 16:47:07 +01:00
Benjamin Valentin
68c8a9a3a2 sys/usb/cdc/acm: port to new interface 2024-02-09 15:24:22 +01:00
Frederik Haxel
64ba553d1f sys: Use size_t print format specifier
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
2023-12-21 12:02:19 +01:00
Benjamin Valentin
c2f93c05f1 treewide: mtd_default_get_dev() -> mtd_dev_get() 2023-11-10 19:53:48 +01:00
Gunar Schorcht
a783a159af sys/usbus/msc: use MTD pointers in XFA for LUN handling 2023-10-02 12:28:08 +02:00
Marian Buschsieweke
dd7bec50b5
sys/usb/usbus_hid: fix compilation with clang
Well, it is actually a cosmetic issue. But I agree with clang that it
is ugly enough to refuse compiling over it :D
2023-07-18 12:24:08 +02:00
zvecr
9139813d17 Implement USB_FEATURE_DEVICE_REMOTE_WAKEUP handling 2023-07-05 23:40:07 +01:00
3b505a2883
pkg/tinyusb: sys: fix stdio buffered inclusion in Kconfig 2023-06-17 15:12:31 +02:00
1826331529
sys/usbus: move dependency resolution in its own Makefile.dep 2023-06-15 10:27:38 +02:00
MrKevinWeiss
d283919f1c
sys/usb/Kconfig: Fix default PID 2023-06-02 12:47:01 +02:00
MrKevinWeiss
d419898d6a
sys/usb: Rework usb kconfig model 2023-05-31 12:55:52 +02:00
Benjamin Valentin
153dbd2495 usbus: don't trigger assertion in usbus_urb_submit() 2023-05-24 18:25:34 +02:00
Marian Buschsieweke
28c1630f54
sys/usb/usbus_msc: fix typo in C expression
Rather than setting the correct blk_len, the code only wrote 1 and 0
into the three bytes due to the use of a logic and where a bitwise
and should be used.
2023-05-20 22:18:27 +02:00
Dylan Laduranty
b1ffce3ccd usbus: remove deprecated USBUS_HANDLER_FLAG_TR_FAIL flag
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-04-19 20:54:30 +02:00
Gunar Schorcht
e46fa4a0b2 sys/usbus: use USBDEV_SET_ADDR_AFTER_STATUS
Use symbol `USBDEV_SET_ADDR_AFTER_STATUS` to determine whether the device address has to be set directly after SETUP stage or after the associated STATUS stage.
2023-04-16 17:14:08 +02:00
7b2db7bf2b
usbus: Implement GET STATUS and SET/CLEAR FEATURE requests
This extends support for the GET STATUS requests to support endpoints
and interfaces as recipient. It also adds the SET and CLEAR FEATURE
requests for the endpoints with support to set and clear the halt
condition on an endpoint.
2023-04-11 11:12:53 +02:00
13b4f8de2c
usbus: Implement endpoint halt condition.
Instead of directly stalling an endpoint, handlers should enable the
halt condition on an usbus endpoint to signal error condition.
This can then be cleared via a CLEAR FEATURE request from the host.
2023-04-11 11:12:49 +02:00
Gunar Schorcht
44e9db86c0 sys/usbus/msc: fix EP sizes and buffer alignment for HS in DMA-mode 2023-04-07 19:06:24 +02:00
Dylan Laduranty
608d49c51a usbus/msc: ready MSC bulk OUT endpoint in USB_MSC_SETUP_REQ_GML request
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-04-05 20:16:53 +02:00
Dylan Laduranty
9e88db7f50 usbus/msc: remove call to usbdev_control_slicer_ready()
This function should not be called by the driver as USBUS will handle it already. So remove this call to prevent duplication

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-04-05 20:14:59 +02:00
8044e578b5
cdc_ecm: Update max supported transfer size after reset 2023-03-31 16:43:44 +02:00
8b41443913
usbus: Add functions to query max packet sizes 2023-03-31 16:43:44 +02:00
Dylan Laduranty
65475af1bb usbus/dfu: do not create alt interface if not needed
If riotboot is built with NUM_SLOTS=1, there is no reason to advertise a second slot in the bootloader

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-13 21:52:06 +01:00
Gunar Schorcht
1fa988d135 sys/usbus: handle exceeding of number of endpoints
If the number of endpoints is not sufficient for an application, it should not be silently ignored and cause a non-working application. Rather, should cause an assertion as it is a configuration issue.
2023-03-10 07:59:14 +01:00
bors[bot]
513676f6e0
Merge #17086
17086: usbdev: Add dedicated stall functions r=benpicco a=bergzand

### Contribution description

This PR adds dedicated stall functions for usbdev peripherals. Two
functions are added. The first function (usbdev_ep_stall) to enable and
disable the stall condition on generic endpoints. The second function is
a dedicated function to set the stall condition on endpoint zero in both
directions. This status can only be set and should automatically be
cleared by the usbdev implementation (or hardware) after a new setup
request is received from the host.

### Testing procedure

- examples/usbus_minimal should still enumerate correctly on the host side.
- #17085 can be used to demonstrate the ep0_stall function with the `tests/usbus_cdc_acm_stdio/` test

### Issues/PRs references

None

Co-authored-by: Koen Zandberg <koen@bergzand.net>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-03-10 00:12:40 +00:00
Benjamin Valentin
bbda85221e usbus/msc: add CONFIG_USBUS_MSC_AUTO_MTD option to create LUNs on init 2023-03-09 16:57:17 +01:00
Dylan Laduranty
a7e16536ab Kconfig: add Kconfig for USB MSC
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-02 22:04:08 +01:00
Dylan Laduranty
d49ed218ab usbus/msc: add initial support for Mass Storage Class
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-01 21:50:13 +01:00
5f43e07c06
usbus: Use new usbdev ep0 stall function 2023-02-28 11:00:06 +01:00
ba88608749
usbus/cdc_ecm: Make use of URBs for inbound frames 2023-02-27 10:09:55 +01:00
7bfdd73818
usbus: Add URB support
This commit adds support for URBs (USB Request/Response Blocks). These
allow for submitting multi-transfer sized buffers with USBUS handling
the individual usbdev xmits. Multiple URBs can be queued at once for a
single endpoint and USBUS will handle them in the order of submission.

OUT endpoint URBs must always consist of a whole number of full-sized
transfers (N x MaxEndpointSize). They will automatically finish after
the endpoint received a transfer less than the endpoint size.

IN endpoints can be arbitrary-sized and do not have to consist of a
whole number of full-sized transmissions. They support a flag to
indicate that the last transfer in the sequence must be less than a full
sized transfer (USBUS_URB_FLAG_AUTO_ZLP) and this adds a zero length
transfer at the end of the transmissions if the last transfer was equal
to the maximum transfer size.

URBs can be cancelled, but if the URB is already being processed it will
be cancelled after the current transmission within the URB is finished.
If it is still in the queue it will immediately be removed from the
queue.
2023-02-27 10:09:53 +01:00
Benjamin Valentin
59f067171f core/init: call vfs_bind_stdio() in early_init() 2023-01-08 22:26:13 +01:00
Gunar Schorcht
5f0d9ff3a6 sys/usb/ubsus/cdc/acm: move board reset function
The  board reset function `usb_board_reset_coding_cb` can be used on any CDC ACM interface. It is not necessary that the highlevel STDIO is used. Therefore, the call of the board reset function `usb_board_reset_coding_cb` has been moved from the USBUS STDIO CDC ACM implementation to USBUS CDC ACM implementation and is thus a feature of the USBUS CDC ACM interface that don't require any other functionality.
2022-12-11 11:17:15 +01:00
Gunar Schorcht
93215df868 sys/usb/usbus: enable USBUS stdio_cdc_acm only if tinyUSB is not used 2022-12-03 12:52:45 +01:00
Gunar Schorcht
09e94b3e15 sys/usb/usbus/dfu: check min sector size for STM32 F2/F4/F7
STM32F2/4/7 MCUs use sectors instead of pages, where the minimum sector size is defined by FLASHPAGE_MIN_SECTOR_SIZE, which is 16KB or 32KB (the first sector) depending on the CPU_MODEL. In this case SLOT0_OFFSET must be a multiple of the minimum sector size to cover a whole sector.
2022-11-30 19:28:14 +01:00
Ollrogge
0f9577df60 usbus/hid: fix buffer overflow in hid_io 2022-11-10 20:33:29 +01:00
Gunar Schorcht
5685718bcf sys/usb: enable common USB Kconfig for tinyUSB 2022-11-09 06:57:55 +01:00
Benjamin Valentin
838a5e4bd3 netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +02:00
Benjamin Valentin
aef967fdef USBUS/cdc_ecm: register with netdev 2022-09-16 13:22:42 +02:00
Marian Buschsieweke
eaace28804
sys/usb: Set USB model to $(BOARD) by default 2022-08-29 16:39:05 +02:00
benpicco
c18c56aa03
Merge pull request #17380 from qmk/bind_extra_usb_config
usbus: Bind extra USB config
2022-01-09 17:58:38 +01:00
Gunar Schorcht
af621ec91b sys/usb/cdc/acm: implementation of stdio_available 2022-01-03 16:14:11 +01:00
zvecr
bf241a117c usbus: Bind extra USB config 2021-12-10 23:34:59 +00:00
Marian Buschsieweke
d571f150ec
sys/usb/usbus/dfu: use container_of() 2021-12-03 10:12:39 +01:00
Leandro Lanzieri
398df91a99
sys/usb/usbus: model cdc acm stdio in Kconfig 2021-11-26 11:06:47 +01:00