Commit Graph

22850 Commits (b3dec25ceb0e7636b97d34ceccebc700c2f39c66)

Author SHA1 Message Date
Maciej Bocianski 49504d66ca Fix for USB set_clear_feature_test for OSX 2019-02-22 10:53:13 -06:00
Russ Butler f31eb68ec5 Update USBTester product name
Change the name reported by USBTester from CDC DEVICE to
MBED TEST DEVICE.
2019-02-22 10:53:12 -06:00
Russ Butler 754134c6a2 Add pyusb to requirements
Add pyusb to requirements so the greentea USB tests work.
2019-02-22 10:53:11 -06:00
Russ Butler dc29fdefcc Add USBPhy template
Add a template for implementing a USBPhy.
2019-02-22 10:52:35 -06:00
Russ Butler 76aa7e0b6d Move USBPhy and related files to USB directory
Move the USBPhy header files into usb/device/USBPhy. Also move hal
and target USB files since mbed 2 does not compile when these files
are present without the USBPhy headers.

Directory restructure summary:
platform/USBPhy*
    to usb/device/USBPhy/USBPhy*
hal/*
    to usb/device/hal/*
targets/TARGET_Freescale/usb/*
    to usb/device/targets/TARGET_Freescale/*
targets/TARGET_NXP/TARGET_LPC176X/usb/*
    to usb/device/targets/TARGET_NXP/*
2019-02-22 10:52:35 -06:00
Maciej Bocianski 33bef331e6 USB generic tests 2019-02-22 10:52:35 -06:00
Russ Butler 7673ccd1c9 Improve LPC1768 USB stability
Make the following changes to improve stability:
-When disconnecting set address to disabled to prevent nacks
-Clear EP_SLOW one and only once for every interrupt where it is set_address
-Disable and clear control endpoint interrupts when disconnecting
2019-02-22 10:52:35 -06:00
Russ Butler aa76c776c9 Disable endpoints when disconnecting on Kinetis
Even thought the USB phy is disabled during disconnect, endpoints
still nack packets sent. This patch disables all endpoints so after
disconnect no USB traffic will be sent. This allows brief disconnects
of ~200us (or more) to be reliably detected by the host PC.
2019-02-22 10:52:35 -06:00
Russ Butler 0653799b5a Limit USB control transfer size
Limit the size of control reads to the max packet size of endpoint
zero. This fixes the handling of large transfers.
2019-02-22 10:52:35 -06:00
Russ Butler 2a84e3a4f6 Correct Kinetis 256 byte ctrl transfers
Correctly handle control transfers which are a multiple of 256 bytes
by checking for a non-zero value in the upper byte of size.
2019-02-22 10:52:35 -06:00
Russ Butler 08428f8300 Fix Kinetis endpoint initialization
Fully setup endpoint before enabling it in endpoint_add. This prevents
undefined behavior due to previous configuration.
2019-02-22 10:52:34 -06:00
Russ Butler b7eb7820e3 Remove the USB directory from mbed 2 travis
Don't include the USB directory when testing mbed 2 on travis.
2019-02-22 10:52:34 -06:00
Russ Butler 0eac26038d Update USBCDC and USBSerial
Update the USBCDC and USBSerial classes to the new API. This patch also
updates the blocking behavior to unblock at the appropriate times and
to let the processor sleep when blocking rather than busy waiting.
2019-02-22 10:52:34 -06:00
Russ Butler 0d8c8f0a28 Add USB utility classes
Add an allocation free linked list implementation. Additionally add
the class AsyncOp which provides blocking and wakeup funcionality
to simplify making asynchronous operations block.
2019-02-22 10:52:34 -06:00
Russ Butler c0df783249 Update USBPhy doxygen
Update USBPhy doxygen to pull in handbook copyedits. Also update the
docs to reflect the enhanced USBPhy API.
2019-02-22 10:52:34 -06:00
Russ Butler 2708200a19 Update the Kinetis USB driver to the new API
Update this driver to match the new zero-copy API.
2019-02-22 10:52:34 -06:00
Russ Butler 4ab3a485d1 Update the LPC17XX driver to the new API
Update this driver to match the new zero-copy API.
2019-02-22 10:52:34 -06:00
Russ Butler aedeee068a Update USBTester for the new USB API
Update the class USBTester so it works with the new zero-copy
USBDevice API.
2019-02-22 10:52:34 -06:00
Russ Butler 09c1d2cf1e Add abort API to USBDevice
Add the function endpoint_abort and ensure ongoing transfer are
aborted when an endpoint is removed.
2019-02-22 10:52:34 -06:00
Russ Butler 544282d934 Update USBDevice to reflect the updated USBPhy
Update USBDevice so the USB buffers are user supplied.
2019-02-22 10:52:34 -06:00
Russ Butler b75f0d4275 Update USBPhy to allow zero copy transfers
Update the USBPhy to allow for zero copy USB transfers on devices
which support it. This also aligns more closely with the CMSIS USB
driver model.
2019-02-22 10:52:33 -06:00
Russ Butler 4c398a308f Call disconnect when uninitializing USB
Disconnect USB when uninitializing USB so it is in a well defined
state.
2019-02-22 10:52:33 -06:00
Russ Butler 12231917ef Explicitly return when endpoint 0 is stalled
Stalling endpoint 0 indicates the end of a control transfer.
Return immediately when this occurs rather than continuing processing.

In particular, this patch prevents status from erroneously being
sent when _request_setup returns false inside _complete_request.
2019-02-22 10:52:33 -06:00
Russ Butler 8e2361a6b5 Allow transfer to start when configuring USB
Allow reads and writes to be started when entering the configured
state.
2019-02-22 10:52:33 -06:00
Russ Butler 7c96e22fa7 Move USBDevice processing out of user callbacks
Perform processing triggered by user callbacks when USB is being
unlocked rather than synchronously. This prevents recursive callbacks
which reduces stack usage. This also prevents state change inside
the user callback which makes the code easier to reason about.
2019-02-22 10:52:33 -06:00
Russ Butler ff157a237a Update stall state on set and clear feature
Call USBDevice::endpoint_stall/unstall in the request to set/clear
halt so the endpoint state is properly updated in the array
_endpoint_info.
2019-02-22 10:52:33 -06:00
Russ Butler 23f3c01633 Fix USB init problems
Initialize the _transfer structure so the behavior is the same
regardless of prior memory contents. This fixes a hang during
USB testing when CI flags are used.
2019-02-22 10:52:33 -06:00
Russ Butler de12bb57fa Update USBTester for simplified read handling
Remove read_start and replace read_finish with read to match the new
USBDevice API.
2019-02-22 10:52:33 -06:00
Russ Butler 3168a92231 Change USBDevice read handling
Remove the USBDevice function read_start and automatically start all
reads internally in USBDevice. This patch also renames the function
read_finish to read.
2019-02-22 10:52:33 -06:00
Russ Butler 57ca5bc335 Add and assert USB callback completion
Assert that when a callback is completed it is the active callback.
2019-02-22 10:52:33 -06:00
Russ Butler 23615a7769 Update Kinetis USB to match the USBPhy API
Copy the Kinetis USB driver files from
mbed-os\features\unsupported\USBDevice\targets\TARGET_Freescale
and update them to match the new USBPhy API.
2019-02-22 10:52:33 -06:00
Russ Butler 25fb3183cf Add Kinetis USB files 2019-02-22 10:52:32 -06:00
Russ Butler 2e7e026d2f Remove mbed 2 USB tests from Travis
Remove the mbed 2 USB tests since USB support will be part of mbed 5.
2019-02-22 10:52:32 -06:00
Russ Butler 4be11ff158 Add USBPhy for the LPC17xx
Move the LPC17xx USB driver files from
mbed-os\features\unsupported\USBDevice\targets\TARGET_NXP
and update them to match the new USBPhy API.
2019-02-22 10:52:32 -06:00
Russ Butler f9f12766d8 Add USBDevice test code
Add a USB test and the class USBTester.cpp to go along with it.
2019-02-22 10:52:32 -06:00
Russ Butler caace4ac61 Update USBDevice and configure to use a USBPhy
Update the USBDevice class API so it matches mbed-os's naming
conventions, has a more robust API and uses USBPhy as its backend.
2019-02-22 10:52:32 -06:00
Russ Butler f7cb2cd280 Update USB licenses and format code
Update USB licenses from MIT to Apache 2 and run astyle on the code.
2019-02-22 10:52:32 -06:00
Russ Butler a4b6cfe90a Copy USBDevice from unsupported
Copy the USBDevice code out of unsupported and into a top level USB
folder in preparation for development.

squash
2019-02-22 10:52:32 -06:00
Russ Butler 8ae123f2d4 Add USBPhy, USB HAL and Utility class
Add the USBPhy and USBPhyEvents abstract classes, the HAL header using
this class and the EndpointResolver utility class.
2019-02-22 10:52:32 -06:00
Cruz Monrreal e03b3b68c1
Merge pull request #9806 from SenRamakri/sen_UpdateStatsARMCCFlags
Update mbed_stats.c to use __ARMCC_VERSION flag for compatibility with AC6
2019-02-21 21:36:33 -06:00
Cruz Monrreal 497d0d65c3
Merge pull request #9802 from orenc17/patch-2
Fix psa_system_reset() on PSA IPC platform
2019-02-21 17:31:11 -06:00
Cruz Monrreal 870bd05904
Merge pull request #9708 from davidsaada/david_protected_storage
Implement PSA protected storage & restructure PSA storage implementation
2019-02-21 17:30:56 -06:00
Cruz Monrreal 50af2c341c
Merge pull request #9752 from mirelachirica/add_comment_fix_warning
Add comment fix warning
2019-02-21 17:30:34 -06:00
Senthil Ramakrishnan 3fb8224237 Update mbed_stats.c to use __ARMCC_VERSION flag to be compatible with AC6 2019-02-21 17:12:09 -06:00
Cruz Monrreal 77591fbdd3
Merge pull request #9772 from kfnta/tfm_extras
Additions to TF-M source integration
2019-02-21 15:32:28 -06:00
Cruz Monrreal 2ecb0a5031
Merge pull request #9798 from jeromecoutant/PR_LPTICKER_BOOTLOADER
STM32 LPTICKER (LPTIM): correct init execution after bootloader
2019-02-21 13:55:20 -06:00
Oren Cohen 3c5c205a23 Add flash IAP to sequana_psa m4 2019-02-21 20:59:19 +02:00
Oren Cohen 922cdeab82 Update crypto IPC handling of negative errors 2019-02-21 20:59:18 +02:00
David Saada 41eb5cbfd9 Implement PSA protected storage & restructure PSA storage implementation
- Move all PSA storage code under psa/storage directory
- Create a global PSA error codes header, eliminating ITS specific ones
- Create a common header file for PSA storage type definitions,
  eliminating ITS specific ones
- Create a common implementation for PS & ITS
- Implement protected storage feature
- Change ITS test to be common to PS as well
2019-02-21 20:58:59 +02:00
Cruz Monrreal 235a75f5b8
Merge pull request #9796 from SeppoTakalo/wiced_binaries
New Wiced binaries
2019-02-21 12:10:16 -06:00