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

72 Commits

Author SHA1 Message Date
Benjamin Valentin
c2f93c05f1 treewide: mtd_default_get_dev() -> mtd_dev_get() 2023-11-10 19:53:48 +01:00
bors[bot]
03d3874e51
Merge #19465 #19981 #19995
19465: drivers/mtd: use XFA for pointers to defined MTDs r=benpicco a=gschorcht

### Contribution description

This PR provides the support to hold pointers to defined MTDs within a XFA. The XFA allows
- to access MTDs of different types (`mtd_flashpage`, `mtd_sdcard`, `mtd_emulated`, ...) by an index
- to determine the number of MTDs defined in the system.

### Testing procedure

To be defined once PR #19443 is merged because emulated MTDs will allow to test this PR on arbitrary boards.

### Porting Guide

For external boards:
 - remove the `MTD_NUMOF` definition from `board.h`
 - add `MTD_XFA_ADD(<mtd_dev>, <idx>);` to the definition of `<mtd_dev>`.
 - `MTD_0`, `MTD_1`, … defines are no longer needed.

### Issues/PRs references

 Related to PR #19443

19981: Fletcher32: Add incremental API r=benpicco a=bergzand

### Contribution description

This PR extends the current fletcher32 checksum with an incremental API mode. This way the bytes to be checksummed can be supplied via multiple successive calls and do not have to be provided in a single consecutive buffer.

I've also rephrased the warning with the original function a bit as that function uses an `unaligned_get_u16` to access the data. The data thus does not require alignment, but the length does need to be supplied as number of 16 bit words.

### Testing procedure

The test has been extended


### Issues/PRs references

None

19995: sys/psa_crypto: Fix macro for public key max size and SE example r=benpicco a=Einhornhool

### Contribution description
#### 1. Wrong public key size when using secure elements, introduced by  #19954
Fixed conditions for key size macros in `crypto_sizes.h`.

#### 2. EdDSA and ECDSA examples fail when using a secure element because of unsopported changes introduced by #19954
Updated `example/psa_crypto` to use only supported functions for secure elements.

### Testing procedure
Build `example/psa_crypto` for secure elements and run application

Output on master:
```
2023-10-19 14:33:24,372 # main(): This is RIOT! (Version: 2019.07-devel-22378-gb6772)
2023-10-19 14:33:24,372 # HMAC SHA256 took 56393 us
2023-10-19 14:33:24,372 # Cipher AES 128 took 68826 us
2023-10-19 14:33:24,372 # *** RIOT kernel panic:
2023-10-19 14:33:24,373 # HARD FAULT HANDLER
2023-10-19 14:33:24,373 # 
2023-10-19 14:33:24,373 # *** rebooting...

```
Output with fixes:
```
2023-10-19 13:35:24,715 # main(): This is RIOT! (Version: 2019.07-devel-22384-g8ef66-dev/psa-crypto-fixes)
2023-10-19 13:35:24,715 # HMAC SHA256 took 56374 us
2023-10-19 13:35:24,715 # Cipher AES 128 took 68805 us
2023-10-19 13:35:24,715 # ECDSA took 281164 us
2023-10-19 13:35:24,715 # All Done
```


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
Co-authored-by: Lena Boeckmann <lena.boeckmann@haw-hamburg.de>
2023-10-19 19:01:12 +00:00
Marian Buschsieweke
edc43201db
tree-wide: fix typos in doc and comments
This should not change any generated binary
2023-10-16 12:17:48 +02:00
Gunar Schorcht
a783a159af sys/usbus/msc: use MTD pointers in XFA for LUN handling 2023-10-02 12:28:08 +02:00
zvecr
9139813d17 Implement USB_FEATURE_DEVICE_REMOTE_WAKEUP handling 2023-07-05 23:40:07 +01:00
MrKevinWeiss
d419898d6a
sys/usb: Rework usb kconfig model 2023-05-31 12:55:52 +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
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
8b41443913
usbus: Add functions to query max packet sizes 2023-03-31 16:43:44 +02:00
86e2953470
usbopt: add USBOPT_ENUMERATED_SPEED 2023-03-31 16:43:44 +02:00
Gunar Schorcht
6d273e7966 sys/usbus: define the number of required EPs for each class
To be able to check during compilation that the number of endpoints provided by a USB peripheral is not exceeded, each interface class has to define the number of IN and OUT endpoints it requires.
2023-03-12 13:15:44 +01:00
bors[bot]
bdecf57516
Merge #19356
19356: usbus/msc: add CONFIG_USBUS_MSC_AUTO_MTD option to create LUNs on init r=dylad a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2023-03-09 19:49:51 +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
bors[bot]
6c1de71606
Merge #19358
19358: sys/usbus/cdc/ecm: fix High-Speed mode r=dylad a=gschorcht

### Contribution description

This PR provides some changes to fix the USBUS CDC ECM interface in High-Speed mode.

In High-Speed mode, the EP data size has to be at least 512 bytes instead of 64 Byte in Full-Speed mode. To be able to define configurations like EP data sizes depending on whether Full-Speed or High-Speed USB device peripherals are used, the feature `periph_usbdev_hs`/`HAD_PERIPH_USBDEV_HS` is introduced.

### Testing procedure

Use `tests/usbus_cdc_ecm`  and any board with USB HS connector, for example:
```
USEMODULE=periph_usbdev_hs_utmi BOARD=stm32f723e-disco make -j8 -C tests/usbus_cdc_ecm flash
```
`ping` command works with this PR but doesn't work without this PR.

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-03-07 20:17:01 +00:00
Gunar Schorcht
4f49fc817c usbus/cdc/ecm: increase EP data size in HS mode
CDC ECM driver/netdev is only working in High-Speed mode if the EP data size is at least 512 byte.
2023-03-07 11:29:39 +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
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
81625fd5f2 doc: sort all stdio implementations into sys_stdio group 2023-01-13 11:08:22 +01:00
Karl Fessel
af8589059e sys/includes: replace kernel_defines.h 2022-11-22 13:39:35 +01:00
Karl Fessel
05f114d0af doc: fix unbalaced grouping
- most were trivial
    - missing group close or open
    - extra space
    - no doxygen comment
- name commad might open an implicit group
    this hould also be implicit cosed but does not happen somtimes
- crazy: internal declared groups have to be closed internal
2022-09-14 15:05:25 +02:00
benpicco
f33b3ad10d
Merge pull request #17242 from bergzand/pr/hid/add_descriptor_defines
usb/hid: Add HID report descriptor defines
2022-01-10 12:28:01 +01:00
758a0bc174
usb/hid: Add HID report descriptor defines 2022-01-10 11:35:58 +01:00
Ollrogge
58764f2e16 usbus/hid: Remove unimplemented function declaration 2022-01-05 21:46:15 +01:00
Ollrogge
8ec310b085 usbus/hid: Remove unimplemented function declaration 2021-12-27 21:18:43 +01:00
587d25a38e
USBUS/hid: Adapt to xmit API 2021-11-16 20:17:05 +01:00
5455c40c7a
USBUS/cdc_ecm: Adapt to xmit API 2021-11-16 20:17:04 +01:00
1a0bc3d8bc
USBUS/cdc_acm: Adapt to xmit API 2021-11-16 20:17:04 +01:00
7d9a177f25
USBUS: Adapt to xmit API
Converts the control endpoint to xmit API
2021-11-16 20:17:04 +01:00
59e85cf921
usbdev: Refactor to xmit API
This API change refactors the usbdev API to supply buffers via the
usbdev_ep_xmit function. This changes from the usbdev_ep_ready call to allow
separate buffers per call. An usbdev_ep_buf_t pseudotype is available and must
be used when defining buffers used for endpoints to adhere to the DMA alignment
restrictions often required with usb peripherals.

Main advantage is that the usbdev peripherals no longer have to allocate
oversized buffers for the endpoint data, potentially saving multiple KiB
of unused buffer space. These allocations are now the responsibility of
the individual USB interfaces in the firmware
2021-11-16 11:21:00 +01:00
df39337ebf
usbopt: resolve vera++ issues 2021-11-04 13:49:34 +01:00
0ce6bfc1a2
usbus: Deprecate USBUS_HANDLER_FLAG_TR_FAIL event 2021-10-24 19:33:29 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Ollrogge
2c2eb88c0e usbus/hid: uncrustify files 2021-08-04 14:54:33 +02:00
Ollrogge
834ac3f5a5 usbus/hid_io: add missing header file, add RX callback function 2021-08-04 14:54:33 +02:00
Antonio Galea
9c9056844e USB CDC: fix typo in definitions 2021-02-22 14:56:37 +01:00
dylad
669a8ec7b3 usbus/dfu: introduce initial Device Firmware Upgrade support for USBUS 2021-01-12 11:34:22 +01:00
Build Bot
122d7a0f35 usbus/hid: add minimal implementation 2021-01-11 00:24:30 +01:00
9cd753228c
usbus: Add USB peripheral serial string support 2020-12-17 11:37:05 +01:00
1eb30f1cd7
Merge pull request #15566 from dylad/pr/usbus/string_descr_for_alt_if
usbus: add optional string descriptor for alt interface
2020-12-09 14:52:40 +01:00
dylad
7b8feef326 usbus: add usbus_add_interface_alt helper function 2020-12-09 09:38:15 +01:00
dylad
dde5e94233 usbus: add optional string descriptor for alt interface 2020-12-08 15:39:14 +01:00
0b801c4de0 all: adapt to moved sched defines 2020-11-23 16:56:34 +01:00
Leandro Lanzieri
8b857844fc
usbus/cdc/ecm: Move USBUS_CDC_ECM_CONFIG_SPEED to 'CONFIG_' 2020-04-08 16:30:58 +02:00
Leandro Lanzieri
335b0ceb50
usbus/cdc/ecm: Move USBUS_CDC_ECM_CONFIG_SPEED_UPSTREAM to 'CONFIG_' 2020-04-08 16:27:04 +02:00
Leandro Lanzieri
88e50658f3
usbus/cdc/ecm: Move USBUS_CDC_ECM_CONFIG_SPEED_DOWNSTREAM to 'CONFIG_' 2020-04-08 16:24:59 +02:00
Leandro Lanzieri
934bede70e
usbus/cdc/acm: Expose configurations to Kconfig 2020-04-07 14:34:57 +02:00
Leandro Lanzieri
51c4f119a5
usbus/cdc/acm: Move USBUS_CDC_ACM_BULK_EP_SIZE to 'CONFIG_' namespace 2020-04-07 14:34:56 +02:00