61 Commits

Author SHA1 Message Date
Jean-Michel Picod
e3d2e7d778 Fix USB enumeration on OS X (#640)
Hopefully without breaking the others.

Summary of the changes:
- Device descriptor reports the device is bus powered and requires
  100mA max.
- HID descriptor version bumped to 1.11 (was 1.10)
- Added string index for Interface and HID descriptors (which seems to
  make OS X happy)
2023-07-26 14:21:55 +02:00
kaczmarczyck
f25cdd6acc Tock V2 port - rebased and updated (#620)
* Changes from #580

* fixes USB cancel panic

* style fixes

* Update src/env/tock/storage.rs

Co-authored-by: Zach Halvorsen <zhalvorsen@google.com>

---------

Co-authored-by: Zach Halvorsen <zhalvorsen@google.com>
2023-05-05 09:55:16 +02:00
kaczmarczyck
932924ea85 removes metadata storage type (#538) 2022-08-29 12:05:58 +02:00
Liam Murphy
4a2217f025 Interleave sending and receiving of packets to reduce rx latency (#515)
* Interleave sending and receiving of packets to reduce latency in receiving of packets

* Add patch to CtapUsbSyscallDriver

* Minor tweaks from review

* Log when overwritting an existing reply

* Only log when 'debug_ctap' is enabled

* Make ctap mod public, as per review

* Rename send_or_recv to send_and_maybe_recv

* fix typo

* Don't process packets on other transport while doing keepalive

* Don't process packets on other transport while doing keepalive

* More accurately determine if reply has finished

* Move comment closer to appropriate location

* Add tests for canceling keepalive packets

* Added a TODO for kaczmarczyck re ctap module being public

* remove the unnecessary sleep()s

* undo messed up commit

* address pylint warnings

* Fix merge mess up, and patch fido2 Usage Page

* Fix up completely borked merge

* Remove patch to FIDO usage, after #523.

* remove obsolete aspects to diff

Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
2022-08-04 14:54:22 +02:00
Liam Murphy
0dad7b19ff Set the Vendor HID Usage to 1 (#523) 2022-08-04 13:32:34 +02:00
Liam Murphy
2bc405165e Process incoming packets on different interfaces in a round robin fashion. (#514)
* Round-robin order for receiving packets

* Update next packet after sending packet

* fix up some formatted raised during review

* remove the whitespace noise from last commit
2022-07-26 13:07:26 +02:00
Liam Murphy
fbe00d57f9 Fix USB deadlock handling pending packets (#513) 2022-07-15 08:23:27 +02:00
Julien Cretin
8549e2e436 Configure the flash as read-only at boot 2022-06-30 16:56:05 +02:00
Liam Murphy
2544afbfee Connect Vendor HID interface between USB driver and CTAP app (#490)
* Connect Vendor HID endpoint to Ctap app

* tweaks from review

* formatting nit

* revert tock submodule revision

* fix formatting of deploy.py for yapf error

* Changes based on review

* Track state for each USB endpoint separately

* Rename patch file to ensure correct patching order

* Adjust patch from changes #494 and #500

* rustfmt

* rustfmt

* Deprecate patch 11 in favor of this full working code
2022-06-20 07:31:31 +02:00
kaczmarczyck
1d53f3c921 Adapts libtock drivers for vendor HID (#500)
* adapts libtock drivers for vendor HID

* status with timeout
2022-06-16 17:56:44 +02:00
Liam Murphy
7e0c0938bb Avoid app re-entry by passing App argument to relevant calls (#494)
* Avoid app re-entry by passing App argument to relevant calls

* Remove underscoring leading name

* fixups

* allows passing in capabilities to CtapHid (#496)

* Fix libfido in configure (#499)

* fix capitalization of Ctap2 in configure

* changes setup to match new libfido2 version

Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
2022-06-16 15:44:33 +02:00
Liam Murphy
dc3e34b824 Use VENDOR_HID when creating USB config when Vendor HID enabled (#495)
* Use VENDOR_HID when creating USB config when Vendor HID enabled

* reduce noise
2022-06-10 12:56:29 +02:00
Liam Murphy
2b541d853b Create a 2nd USB interface for the Vendor HID (#472)
* Add USB interface for Vendor HID.

This new interface is enumerated by the host, but the device transmits
all packets on the existing interface, so the device won't function
correct in this mode until this this fixed.

The changes are in tock, and so appear as a patch here. These are:
* supporting multiple HIDs in the USB configuration
* adding the HID descriptors for the new inteface
* supporting the vendor_hid feature in relevant Cargo.toml files.
NOTE: only boards/nordic/nrf52840dk_opensk has been updated.

As the changes are in tockos, deploy script needed to pass vendor_hid
feature to tockos build stage.

Demo of output:
lsusb -v -d 1915:521f | grep "NumInterfaces"
    bNumInterfaces          2

* fix some whitespace from review

* Add vendor_hid feature in all boards in this repo, not via a patch in tock.

The boards directories are copied to tockos as part of
setup-submodules.sh

* Remove nesting from HID config in create_descriptor_buffers()

* update comments about HID descriptor use.
2022-05-03 10:35:35 +02:00
Liam Murphy
2db7971430 Remove unused ctap module (capsules/src/usb/ctap.rs) (#451)
* Remove unused ctap module (capsules/src/usb/ctap.rs)

* fixed patch format to match existing patches
2022-04-05 08:18:36 +02:00
Julien Cretin
37e9d6d64d Do not set the stack size outside prod (#415)
* Add support for multiple modules

* Add macos fix

* Update setup-submodules script
2021-11-30 18:11:42 +01:00
kaczmarczyck
9b780ef7d7 New boards with layouts for dual partition setups (#387)
* upgradable boards

* updates the install manual for proper SSL config

* storage locations from build script

* deploy script improvements

* UTC time
2021-10-06 18:33:40 +02:00
Julien Cretin
18ba4368e4 Revert the MPU hack by splitting the store in 2 2021-09-16 10:30:50 +02:00
Julien Cretin
7a975acf33 Hack for Nordic in process.rs 2021-09-13 18:50:13 +02:00
Julien Cretin
2d5fdd1034 Configure the number of pages in the board
This permits to have portable apps.
2021-09-13 18:50:13 +02:00
Jean-Michel Picod
c1f2551d0d Bump Tock kernel version (#374)
* Bump Tock kernel version

* Update boards to new kernel

* Update patches to new kernel

* Update PR template

* Bump libtock-rs

* Use new layout from libtock-rs

* Fix clippy warnings due to updated toolchain

* Fix new toolchain file format

* Bump elf2tab to v0.7.0

* Fix worklow and setup.sh script to use the TOML rust-toolchain file

* New libtock-rs style of declaring the stack.

* Fix padding in layout file.

The layout from libtock-rs generates invalid flash padding.
The value is 32-bit and therefore setting padding to 0xff yields
0xff000000 instead of 0xffffffff that we want.

* adds tock patch for app break hard fault

* sets in deploy, removed patch 04-mpu-fix

* fixed the if deploy

* fixes indentation

* updates board names in install.md

* fix docs and deploy style

Co-authored-by: Fabian Kaczmarczyck <kaczmarczyck@google.com>
Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
2021-09-10 08:32:34 +02:00
Julien Cretin
69f1b672f1 Fix all boards and move diff to directory 2021-08-07 11:29:07 +02:00
Julien Cretin
ad0605c2fa Make flash syscall interface async 2021-08-07 11:29:07 +02:00
Fabian Kaczmarczyck
eefc171076 adds a storage type for later usage 2021-07-05 13:13:14 +02:00
kaczmarczyck
ce0ee6c054 Kernel minimization (#334)
* adds patch to remove unused kernel components

* new boards, rebase patches to match

* rename boards for deployment
2021-06-28 14:55:20 +02:00
Jean-Michel Picod
712fa0f6a2 Small improvements on kernel patch 2020-12-16 18:22:15 +01:00
Jean-Michel Picod
8595ed5e28 Addressing review comments. 2020-12-16 18:22:15 +01:00
Jean-Michel Picod
ca0606a557 Bump versions to 1.0 for FIDO2 certification. 2020-12-16 18:22:15 +01:00
Jean-Michel Picod
6e5a8cdf6d Add kernel support for firmware protection 2020-12-16 18:22:15 +01:00
Jean-Michel Picod
b002b4669e Update UICR registers. 2020-12-16 18:22:15 +01:00
Guillaume Endignoux
2ca541fb33 Fix formatting. 2020-10-02 13:52:24 +02:00
Guillaume Endignoux
359b243eb6 Add component for USB CTAP. 2020-09-24 12:28:29 +02:00
Jean-Michel Picod
62151ed614 Fix MPU issue 2020-09-16 17:15:33 +02:00
Jean-Michel Picod
9e8e83fb32 Patch cleanup 2020-09-16 11:48:59 +02:00
Jean-Michel Picod
5ca23c4e05 Update patches for newer kernel 2020-09-16 11:35:19 +02:00
Jean-Michel Picod
a660d5cfda Remove unnecessary patch 2020-09-16 10:40:08 +02:00
Guillaume Endignoux
e1fd1f2257 Remove obsolete patches for libtock-rs. 2020-08-07 15:09:07 +02:00
Guillaume Endignoux
2094f8156c Increase size of console buffering. 2020-06-19 18:22:47 +02:00
Guillaume Endignoux
a7c79c4f23 Resolve review comments. 2020-06-19 18:16:09 +02:00
Guillaume Endignoux
c7493d1b9d Reduce the number of syscalls made by the console in libtock-rs. 2020-06-19 18:16:09 +02:00
Julien Cretin
c3c652b8c3 Define the storage locations for the dongle
Fixes #113.
2020-06-10 12:54:00 +02:00
Julien Cretin
ba5caf0691 Filter syscall at platform-level instead of driver-level 2020-05-14 20:19:21 +02:00
Julien Cretin
cf31110922 Define the storage locations in the board 2020-05-13 15:17:35 +02:00
Julien Cretin
ecf02eb6ce Only store the storage location in the Kernel 2020-05-08 17:00:59 +02:00
Julien Cretin
5c2b72ce83 Move storage bound checking to driver 2020-04-29 15:09:50 +02:00
Julien Cretin
88920035fa Permit the app to read the storage 2020-04-29 13:50:42 +02:00
Julien Cretin
6247098069 Do not use writeable flash regions for persistent storage
They don't play well with DFU.
2020-04-29 12:52:31 +02:00
Guillaume Endignoux
4b9486d0bd Sync with upstream Tock to have reproducible builds. 2020-04-08 15:45:46 +02:00
Jean-Michel Picod
0e1c76455d Address review round #2 2020-03-12 12:12:45 +01:00
Jean-Michel Picod
550098d560 Remove duplicate patch 2020-03-11 17:54:37 +01:00
Jean-Michel Picod
e63482af1c Revamp deploy.py
Now the script supports more flashing methods:
- JLink (with tockloader)
- OpenOCD (with tockloader)
- pyOCD
- Nordic DFU
- none (will produce an IntelHex file)

Also merged the contributions from:
- Yihui Xiong to support the Makerdiary USB dongle board
- Dennis Geurts to support Nordic DFU

Doc updated accordingly.

Imported 2 patches for Tock kernel:
- 06-add-set_vector_table_offset.patch (upstream tock/tock#1579)
- 07-nrf52-bootloader.patch (upstream tock/tock#1681)
2020-03-11 17:54:37 +01:00